<!--
var sendit;
var win;


//=================================================================================================================================
// ¿ÞÂÊ °í½ºÆ® ¸Þ´º
//=================================================================================================================================
function CheckUIElements() {
	var plustop;
	if(document.body.scrollTop < 270)
		plustop = 440;
	else
		plustop = 100;
	var yMenu1From, yMenu1To, yOffset, timeoutNextCheck;
	var wndWidth = parseInt(document.body.clientWidth);
	yMenu1From   = parseInt (ghostmenu.style.top, 10);
	yMenu1To     = document.body.scrollTop + plustop; // À§ÂÊ À§Ä¡
	timeoutNextCheck = 500;

	if ( yMenu1From != yMenu1To ) 
	{
		yOffset = Math.ceil( Math.abs( yMenu1To - yMenu1From ) / 20 );
		if ( yMenu1To < yMenu1From )
			yOffset = -yOffset;
		ghostmenu.style.top = parseInt (ghostmenu.style.top, 10) + yOffset;
		timeoutNextCheck = 10;
	}
	ghostmenu.style.left = 0;
	setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function MovePosition() {
	ghostmenu.style.top = 440;
	ghostmenu.style.left = 0;
	CheckUIElements();
	return true;
}


//=================================================================================================================================
// Faq ´äº¯ ÇÊµå View flag
//=================================================================================================================================

function InfoFaqView(obj){
	infoHidden2();
	document.all.popLayer[obj].style.display = "";
}

//=================================================================================================================================
// ¼³¹® Áú¹® ±âÅ¸ ÀÔ·Â ÇÊµå Ã¼Å©
//=================================================================================================================================

function infoView(obj){
	obj.style.display = "";
}

function infoHidden(obj){
	obj.style.display = "none";
}

function infoHidden2(obj){
	for(i=0;i<document.all.popLayer.length;i++)
	{
		document.all.popLayer[i].style.display = "none";
	}
}

//=================================================================================================================================
// ³»¿ë Á¤º¸ ·¹ÀÌ¾î ÆË¾÷ Ãâ·Â
//=================================================================================================================================

function infoshow(obj){
	if(obj.style.display == 'none')
		obj.style.display = "";
	else
		obj.style.display = "none";
}
function infomove(obj){
	obj.style.posLeft = event.clientX - 15;
	obj.style.posTop = event.clientY + 20 + document.body.scrollTop;
}

var tmpObj
function infoScheduleView(obj){
	infoHidden2();
	document.all.popLayer[obj].style.display = "";
}

function infoschedulemove(obj){
	document.all.popLayer[obj].style.posLeft = event.clientX + 8;
	document.all.popLayer[obj].style.posTop = event.clientY + 20 + document.body.scrollTop;
}

function infofixshow(height,obj){
	obj.style.posLeft = 5;
	obj.style.posTop = height;

	if(obj.style.display == 'none')
		obj.style.display = "";
	else
		obj.style.display = "none";
}

//=================================================================================================================================
// Á¦Ç° ÀÌ¹ÌÁö Å©°Ô º¸±â ÆË¾÷
//=================================================================================================================================

function pop_prodBimg(imgName)
{
	win = window.open ("/product/pop_prodbimg.asp?prodbimg=" + imgName,"pop_prodbimg","width=100,height=100,left=10000,top=10000");
	win.focus();
}

//=================================================================================================================================
// ¸ÅÆ®¸®½º »ó¼¼ º¸±â ÆË¾÷
//=================================================================================================================================
function PopMattressView(Mattress)
{
	win = window.open ("/product/pop_" + Mattress + ".asp","pop_MattressView","width=400,height=497,left=0,top=0");
	win.focus();
}

//=================================================================================================================================
// ¸ÅÆ®¸®½º ºñ±³ ÆË¾÷
//=================================================================================================================================
function PopMattressCompare(Mattress)
{
	win = window.open ("/product/pop_mattress.asp?Mattress=" + Mattress,"pop_MattressCompare","width=400,height=370,left=0,top=0");
	win.focus();
}

//=================================================================================================================================
// ÀÔ·Â¹®ÀÚ¿­ ¼ýÀÚ¸¸ ¹Þ±â
//=================================================================================================================================
function onlyNumber(txtBox) {
	var checkOK = "0123456789";
	var checkStr = txtBox;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		return false;
	} else {
		return true;
	}
}





//=================================================================================================================================
// E-mail ÀÔ·ÂÃ¼Å©
//=================================================================================================================================
function emailCheck(obj)
{
	if (obj.value.indexOf("@") == "-1" || obj.value.indexOf(".") == "-1"){
		alert("E-mailÁÖ¼Ò¸¦ ¿Ã¹Ù¸£°Ô ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä");
		obj.value = "";
		obj.focus();
		return false;
	} else {
		return true;
	}
}




//=================================================================================================================================
// ÀÔ·Â¹®ÀÚ¿­ ¿µ¹®¸¸ ¹Þ±â
//=================================================================================================================================
function onlyEnglish(txtBox) {
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var checkStr = txtBox;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		return false;
	} else {
		return true;
	}
}




//=================================================================================================================================
// ÀÔ·Â¹®ÀÚ¿­ ¿µ¹®¸¸ ¹Þ±â
//=================================================================================================================================
function IDChar(txtBox) {
	var checkOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";
	var checkStr = txtBox;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		return false;
	} else {
		return true;
	}
}




//=================================================================================================================================
// ÀÔ·Â¹®ÀÚ¿­ÀÌ ÇÑ±ÛÀÎÁö Ã¼Å©
//=================================================================================================================================
function isHangul(obj) {
	var len;
	len = obj.value.length;
	for (var i = 0; i < len; i++)  {
		if (obj.value.charCodeAt(i) != 32 && (obj.value.charCodeAt(i) < 44032 || obj.value.charCodeAt(i) > 55203))
			return false;
	}
	return true;
}





//=================================================================================================================================
// ¸ðµç ¸µÅ©¿¡ ¸µÅ© Å×µÎ¸® ¾ø¾Ö±â
//=================================================================================================================================
function allblur() {
	for (i = 0; i < document.links.length; i++)
		document.links[i].onfocus = document.links[i].blur; 
		
}
	
//=================================================================================================================================
// ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ° Å¬¸¯ ±ÝÁö
//=================================================================================================================================

function click()
{ 
 if (event.button != 1) { document.oncontextmenu = function(){return false} ; } 
}

//document.onmousedown=click;


//=================================================================================================================================
// ÄíÅ° »ý¼º
//=================================================================================================================================
function SetCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

//=================================================================================================================================
// ÄíÅ° °¡Á®¿À±â
//=================================================================================================================================
function GetCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ){
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}


//=================================================================================================================================
// ÀÔ·Â¹®ÀÚ¿­ ¹ÙÀÌÆ® Ã¼Å©
//=================================================================================================================================
function CheckLen(obj) { 
	var t;
	var msglen;
	msglen = 0;
	l = obj.length;
	for( k = 0; k < l; k++ ) {
		t = obj.charAt( k );
		if ( escape( t ).length > 4 ) {
		msglen += 2;
		}
		else {
			msglen++;
		}
	} 
	return msglen; 
}





//=================================================================================================================================
// ÆË¾÷À¸·Î Post¹æ½Ä °ª Àü´Þ
//=================================================================================================================================
function postpopup(url,wWidth,wHeight){
	var wLeft = (screen.width - wWidth) / 2;
	var wTop = (screen.height - wheight) / 2;
	win = window.open ('', 'postpopup','scrollbars=yes,resizable=no,width='+wWidth+',height='+wHeight+',top='+wTop+',left='+wLeft);
	document.frm.method = "post";
	document.frm.action = url;
	document.frm.submit();
	win.focus();
}





//=================================================================================================================================
// µ¥ÀÌÅ¸ Àü¼ÛÁß ¸Þ¼¼Áö
//=================================================================================================================================
function connecting(){
	alert("µ¥ÀÌÅ¸¸¦ Àü¼ÛÁß ÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä");
}





//=================================================================================================================================
// °Ë»ö Ã¼Å©
//=================================================================================================================================
function search_check(frm){
	if(sendit)
	{
		connecting();
		return false;
	}
	if(!frm.keyword.value)
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä");
		frm.keyword.focus();
		return false;
	}
	sendit = true;
	return true;
}





//=================================================================================================================================
// ÀÌ¹ÌÁö Resize
//=================================================================================================================================
function imgResize(img_id,maxWidth,maxHeight)
{
	var w=document.getElementById(img_id).width;
	var h=document.getElementById(img_id).height;
	if (w<=0) 
		time_id = window.setTimeout("imgResize('"+img_id+"')",10);
	else 
	{
		if (w > maxWidth)
			document.getElementById(img_id).width = maxWidth;
		if(h > maxHeight)
			document.getElementById(img_id).height = maxHeight;
	}
}



//=================================================================================================================================
// ¿ìÆí¹øÈ£ Ã£±â
//=================================================================================================================================
function zipcode()
{
	var wl = (screen.width - 400) / 2;
	var wh = (screen.height - 300) / 2;
	win = window.open ("/Service/postal_code.asp","zipcode","width=400,height=300,left=" + wl + ",top=" + wh);
	win.focus();
}

//=================================================================================================================================
// ÇÊ¼ö Ç×¸ñ NULL Ã¼Å©
//=================================================================================================================================
function f_nul_chk(obj,lbl)
{
	if( obj.value == '' )
	{
		alert('ÇÊ¼öÇ×¸ñ ' + lbl + ' ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	return false; 
}

//=================================================================================================================================
// ¼ýÀÚ¸¸ ÀÔ·Â °¡´É
//=================================================================================================================================
function f_is_num(obj,lbl)
{
	var nLen = obj.value.length; 
	for( i = 0 ; i < nLen ; i++)
	{
		temp = obj.value.substring(i,i+1);
		if( temp < '0' || temp > '9' )
		{
			alert(lbl + ' ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.');
			obj.select();
			return true;
		}     
	}
	return false;
}





//=================================================================================================================================
// ÆË¾÷ ¸®»çÀÌÁî ¹× °¡¿îµ¥ Á¤·Ä
//=================================================================================================================================
function imgPopResize(img_id)
{
	var w=document.getElementById(img_id).width;
	var h=document.getElementById(img_id).height;
	if (w<=0) 
		time_id = window.setTimeout("imgPopResize('"+img_id+"')",10);
//	w += 10;
//	h += 30;
	var wl = 0;
	var wt = 0;
	if(w > screen.width)
	{
		w = screen.width;
		document.getElementById(img_id).width = w;
	}
	else
		wl = (screen.width - w) / 2;

	if(h > screen.height)
	{
		h = screen.height;
		document.getElementById(img_id).height = h;
	}
	else
		wt = (screen.height - h) / 2;
	window.resizeTo(w,h);
	window.moveTo(wl,wt);
}





//=================================================================================================================================
// ÀÌ¹ÌÁö Å©°Ô º¸±â °ø¿ë ÆË¾÷
//=================================================================================================================================
function BigImagePop(imgname)
{
	win = window.open ("/include/bigIMG.asp?imgurl=" + imgname,"bigimg","width=1,height=1,left=2000,top=2000");
	win.focus();
}




function movePop(w,h)
{
	var ml = (screen.width - w)/2;
	var mt = (screen.height - h)/2;
	window.moveTo(ml,mt);
}



function mouseOverAction(txt){
	if(txt != '')
	{
		document.all.mouseGhostBoxText.innerHTML = txt;
		document.all.mouseGhostBox.style.display = "";
	}
	else
		document.all.mouseGhostBox.style.display = "none";
}
function mouseMoveAction(){
	document.all.mouseGhostBox.style.posLeft = event.clientX - 15;
	document.all.mouseGhostBox.style.posTop = event.clientY + 20 + document.body.scrollTop;
}

//-->

//=================================================================================================================================
// ¸¶¿ì½º·Ñ¿À¹ö
//=================================================================================================================================
  

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_showHLayers() { //v3.0
	var i,p,v,obj,args=MM_showHLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
		obj.visibility=v; }
}
// -->



//=================================================================================================================================
// ÄíÅ° »ý¼º
//=================================================================================================================================

function SetCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setTime(todayDate.getTime() + 3600000*24*expiredays);
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


//=================================================================================================================================
// ÄíÅ° °¡Á®¿À±â
//=================================================================================================================================
function GetCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ){
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}

//=================================================================================================================================
// ÆË¾÷Ã¢ ´Ý°í ¸µÅ©ÆäÀÌÁö ÀÌµ¿
//=================================================================================================================================
function PopCloseLink(linkPage){
	var linkPage
	opener.location.href = linkPage;
   	self.close();
}


