//ÀÌ¹ÌÁö ¸®»çÀÌÂ¡
function Resizing(img, limit_width, limit_height) {  
	if(img.width > limit_width || img.height > limit_height) {
		if((img.width/img.height) > (limit_width/limit_height)) {
			img.width = limit_width;
		} else {
		img.height = limit_height;
        }
    }
}

function frame_set(a,b)
{
	if (a=="next")
	{
		if (parseInt(document.theForm.hid.value)<b)
		{
			document.frame1.location.href="main_iframe1.php?src="+document.theForm.hid.value+"&mm="+a
			document.frame2.location.href="main_iframe2.php?src="+document.theForm.hid.value+"&mm="+a
		}
	}
	else
	{
		if (parseInt(document.theForm.hid.value)>1)
		{
			document.frame1.location.href="main_iframe1.php?src="+document.theForm.hid.value+"&mm="+a
			document.frame2.location.href="main_iframe2.php?src="+document.theForm.hid.value+"&mm="+a
		}
	}
	
}

function cmtcheck(a,b)
{
	if (document.cmtForm.cname.value=="")
	{
		alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.")
		document.cmtForm.cname.focus();
		return false;
	}
	if (document.cmtForm.pass.value=="")
	{
		alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä.")
		document.cmtForm.pass.focus();
		return false;
	}
	if (document.cmtForm.cname.value=="")
	{
		alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.")
		document.cmtForm.cname.focus();
		return false;
	}
	if (document.cmtForm.frmComment.value=="")
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.")
		document.cmtForm.frmComment.focus();
		return false;
	}
	if (document.cmtForm.frmComment.value.length<1)
	{
		alert("¸®ÇÃ³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.")
		document.cmtForm.frmComment.focus();
		return false;
	}
}

function tmt_winCentre() {

    if (document.layers) {

        var sinist = screen.width / 2 - outerWidth / 2;

        var toppo = screen.height / 2 - outerHeight / 2;

    } else {

        var sinist = -3 + screen.width / 2 - document.body.offsetWidth / 2;

        var toppo = -65 + screen.height / 2 - document.body.offsetHeight / 2;

    }

    self.moveTo(sinist, toppo);

}