//¹®ÀÚ¿­ÀÇ ¾çÂÊ(¿ÞÂÊ, ¿À¸¥ÂÊ) °ø¹éÀ» Á¦°Å ÇÔ¼ö 
	function both_trim(a) 
	{
	   var search = 0
	   while ( a.charAt(search) == " ") 
	   { 
		  search = search + 1 
	   }     
	   a = a.substring(search, (a.length))
	   search = a.length - 1
	   while (a.charAt(search) ==" ") 
	   { 
		  search = search - 1 
	   }
	   return a.substring(0, search + 1)         
	}
// °Ë»öÃ¢¿¡ °ø¹é Á¦°Å
function delSpace(form)
{
	var key = form.tq.value;
	var k 	= 0;
	var m	= 0;
	k 		= key.length;
	trimStr 	= "";

	while( k-- )
	{
		if( key.charAt(k) != ' ' )
		{
			break;
		}// end if
	}// end while


	for(m = 0 ; m <= k ; m ++ )
	{
		if(key.charAt(m) != ' ')
		{
			break;
		}// end if
	}// end for


	for(var i = m ; i <= k ; i ++)
	{
		trimStr += key.charAt(i);
	}// end for

	form.tq.value = trimStr;

}// end delSpace function in script


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_showHideLayers() 
{ //v3.0
   var i,p,v,obj,args=MM_showHideLayers.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; 
      }
      //document.all["canceltext"].style.display = "";
      //document.all["canceltext"].style.visibility = "visible";
   }
}

//Çì´õ¿¡¼­ »ç¿ëµÇ´Â ½ºÅ©¸³Æ®
function getObj(obj) 
{ 
   compLayr = eval("document.all." + obj + ".style") 
   return compLayr 
} 

function showHide(name)
{ 
   obj = getObj(name) ;
	   
   if (obj.visibility=="hidden"){ 
      obj.visibility = "visible" ;
   } else {
	  obj.visibility = "hidden" ;
   } 
} 

var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dir = 1;
var offsetx = 0;
var offsety = 0;
var width = 290;
var height = 50;

document.onmousemove = mouseMove;


function mouseMove(e) {
  x=event.x + document.body.scrollLeft+10
  y=event.y + document.body.scrollTop
  if (x+width-document.body.scrollLeft > document.body.clientWidth) x=x-width-25;
  if (y+height-document.body.scrollTop > document.body.clientHeight) y=y-height;

  if (snow) {
    if (dir == 2) { moveTo(over,x+offsetx-(width/2),y+offsety); } // Center
    if (dir == 1) { moveTo(over,x+offsetx,y+offsety); } // Right
    if (dir == 0) { moveTo(over,x-offsetx-width,y+offsety); } // Left
  }
}

function moveTo(obj,xL,yL) { obj.left = xL; obj.top = yL; }

//[S]Top Button
// ±âº» ÇÔ¼ö
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

function getSty(id) {
	x = getRef(id);
	return (isNS4 ? getRef(id) : getRef(id).style);
}

var scrollerHeight = 88;
var puaseBetweenImages = 3000;
var imageIdx = 0;

function moveRightEdge() {
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;

	if (isNS4) {
		yMenuFrom   = divMenu.top;
		yMenuTo     = windows.pageYOffset + 100;   // À§ÂÊ À§Ä¡
	} else if (isDOM) {
		yMenuFrom   = parseInt (divMenu.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 300; // À§ÂÊ À§Ä¡
	}
	timeoutNextCheck = 40;

	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
			divMenu.top += yOffset;
		else if (isDOM)
			divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
			timeoutNextCheck = 10;
	}
	if(document.body.clientWidth <= 960){
		divMenu.style.left = "920px";
	} else {
		divMenu.style.left = 920+((document.body.clientWidth - 920)/2) + "px";
	}

	//alert("test : " + document.body.clientWidth);
	setTimeout ("moveRightEdge()", timeoutNextCheck);
}
function moveRightEdge2() {
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;

	if (isNS4) {
		yMenuFrom   = divMenu.top;
		yMenuTo     = windows.pageYOffset + 100;   // À§ÂÊ À§Ä¡
	} else if (isDOM) {
		yMenuFrom   = parseInt (divMenu.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 300; // À§ÂÊ À§Ä¡
	}
	timeoutNextCheck = 40;

	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
			divMenu.top += yOffset;
		else if (isDOM)
			divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
			timeoutNextCheck = 10;
	}
	if(document.body.clientWidth <= 920){
		divMenu.style.left = "920px";
	} else {
		divMenu.style.left = 920+((document.body.clientWidth - 920)/2) + "px";
	}

	//alert("test : " + document.body.clientWidth);
	setTimeout ("moveRightEdge2()", timeoutNextCheck);
}


//·¹ÀÌ¾î Æ÷Áö¼Ç
var m_loc = location.href;
var m_img_url = "";
if(m_loc.indexOf("http://") >=0){
	m_img_url = "../images/order/top_small.gif";
}else{
	m_img_url = "../images/order/top_small.gif";
}

//ÇÁ¸°Æ®ÇÏ±â
 function PagePrint(){
	printDoc = contentArea.innerHTML;
	//printDoc = printDoc.substr(0,printDoc.length-1976);

	if (confirm('ÀÎ¼âÇÏ½Ã·Á¸é »õÃ¢À» ¶ç¾î¾ßÇÕ´Ï´Ù. °è¼ÓÇÏ½Ã°Ú½À´Ï±î?')) {
		var objWin = window.open('', 'printWindow', 'width=660,height=800,scrollbars=yes');
		var strHtml = '';
		strHtml += "<html><head>\n";
		strHtml += "<title>ÀÎ¼âÈ­¸é ¹Ì¸®º¸±â</title>\n";
		strHtml += "<link rel='stylesheet' href='/style.css' type='text/css'>\n";
	/*	strHtml += "<script src='/common/common.js' language='javascript'></script>"; */
		strHtml += "<style type='text/css'>";
		strHtml += "body{";
		strHtml += "font-family:tahoma;";
		strHtml += "background-color:#FFFFFF;";
	//	strHtml += "background-image: url(''); ";
		strHtml += "margin-left:'0px'; margin-top:'0px'; ";
		strHtml += "background-repeat:repeat-x;}";
		strHtml += "</style>\n";
		strHtml += "</head>\n";
		strHtml += "<body leftMargin='0' topMargin='0' marginwidth='0' marginheight='0'>\n";
		strHtml += "<table width='640' border='0' cellspacing='0' cellpadding='0'>\n";
		strHtml += "<tr><td align='center'><a href='javascript:print()'>ÀÎ¼âÇÏ±â</a><br></td></tr>\n";
	//	strHtml += "<tr><td height='30' valign='top' style='font-size:11px'>\n";
		strHtml += "<tr><td>\n";
		strHtml += printDoc;
		strHtml += "\n</td></tr></table>\n";
		strHtml += "</body>\n";
		strHtml += "</html>\n";
		objWin.document.open();
		objWin.document.write(strHtml);
	//	objWin.document.focus();
		objWin.document.close();
    }
}
  
