function winOpenDetail(G_Cod)
	{
		popupdetail  =  window.open('/Goods/Window/index.asp?G_Cod=' + G_Cod,'_Detail','width=816 height=670 scrollbars=yes scroll=yes resizable=1');  
    popupdetail.opener = self;  
	}
function winOpenDetail2(G_Cod,uid,uid2)
	{
		popupdetail  =  window.open('/cooperation/eDaily/Window/price.asp?G_Cod=' + G_Cod + '&uid=' + uid + '&uid2=' + uid2 + '&intFlag=1','_blank','width=816 height=670 scrollbars=yes scroll=yes resizable=1');  
    popupdetail.opener = self;  
	}
function winOpenMedia(G_Cod)
	{
		popupdetail  =  window.open('/Goods/Window/index.asp?flag=1&G_Cod=' + G_Cod,'_blank','width=816 height=670 scrollbars=yes scroll=yes resizable=1');  
    popupdetail.opener = self;  
	}

function storeOpen(obj,comcod,isbn)
	{
		popupstore  =  window.open(obj,'_blank');  
		popupstore.opener = self;  
		
		
		url2 = '/Goods/Window/storeOpen.asp?comcod='+ comcod +'&isbn=' + isbn
		var http = getHTTPObject();
		http.open("GET", url2, true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		http.send(null);
	}
function insCartOpen(G_Cod)
	{
		cartOpen  =  window.open('/Cart/insCart.asp?G_Cod=' + G_Cod,'_blank','width=382 height=167 scrollbars=yes scroll=yes resizable=1');  
    cartOpen.opener = self;  
	}
function lstCartOpen()
	{
		cartOpen  =  window.open('/Cart/index.asp','_blank','width=382 height=167 scrollbars=yes scroll=yes resizable=1');  
    cartOpen.opener = self;  
	}
function LoginOpen()
	{
		cartOpen  =  window.open('/Member/Login.asp','_blank','width=382 height=167 scrollbars=yes scroll=yes resizable=1');  
    cartOpen.opener = self;  
	}
function eventOpen(i_Seq,strURL)
	{
		popupstore  =  window.open('/include/winOpen.asp?chkNum=0&i_Seq=' + i_Seq + '&URL='+strURL,'_blank');  
    popupstore.opener = self;  
	}
	
//////////////////////////////////////
//È®´ë ÀÌ¹ÌÁö º¸±â
function imgResize(img){
  img1= new Image(); 
  img1.src=(img); 
  imgControll(img); 
} 

function imgControll(img){ 
  if((img1.width!=0)&&(img1.height!=0)){ 
    viewImage(img); 
  } 
  else{ 
    controller="imgControll('"+img+"')"; 
    intervalID=setTimeout(controller,20); 
  } 
} 

function viewImage(img){ 

	W=img1.width +20; 
	H=img1.height +20;
	
	if(H > 750)
	{
		H = 700;
		O="width="+W+",height="+H+",scrollbars=yes,left=10,top=10"; 
	}
	else
	{
		O="width="+W+",height="+H+",left=10,top=10"; 
	}	
	imgWin=window.open("","",O); 
	imgWin.document.write("<html><head><title>È®´ëÀÌ¹ÌÁö º¸±â</title><script>function noimg(){document.all.aaa.src='/img/midNoImg.gif';}</script></head>");
	imgWin.document.write("<body topmargin=10 leftmargin=0 oncontextmenu='return false;'  ondragstart='return false;' onselectstart='return false;' marginwidth=0 marginheight=0 border=0);>");  //oncontextmenu='return false;' ondragstart='return false;' onselectstart='return false;'
	imgWin.document.write("<center><img src="+img+" onclick='self.close()' id='aaa' align=absmiddle onError='noimg();'></center>");
	imgWin.document.write("</body></html>");	
	imgWin.document.close();
} 
///////////////////////////////////
// °Ë»ö¾î Ã³¸®
function SearchStringCheck_Top(obj)
	{
		var byteSize=0;retValue="";

		if(obj.value == "" || obj.value == "ÁÖ¼ÒÃ¢¿¡ '³ª¿Í¿ä' ¸¸ Ä¡¼¼¿ä")
			{
				alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
				obj.focus();
				return false;
			}
		else
			{
				for( var i = 0; i < obj.value.length; i++ ) 
					{
						var chr = escape(obj.value.charAt(i));		//ÀÔ·ÂµÈ °ªÀÇ ÇÏ³ªÇÏ³ª¸¦ ¾Æ½ºÅ°(ASCII) °ªÀ¸·Î º¯È¯½ÃÅ² ÈÄ...	
						if ( chr.length == 1 ) 
							{					//¿µ¹®ÀÇ °æ¿ì ¾Æ½ºÅ°°ªÀÌ 1ÀÚ¸®´Ï±î...
								if(obj.value.charAt(i) != "-" && obj.value.charAt(i) != '"' && obj.value.charAt(i) != "'" && obj.value.charAt(i) != ",")
									{
										byteSize ++;
										retValue += obj.value.charAt(i);
									}
							} 
						else if ( chr.indexOf("%u") != -1 ) 
							{		//ÇÑ±ÛÀÇ °æ¿ì"%"u·Î ½ÃÀÛÇÏ´Ï±î...
								if(chr.substring(2, 6) >= "3131" && chr.substring(2, 6) <= "3163") //ÀÚÀ½ÀÌ³ª ¸ðÀ½¸¸ ÀÖ´Â°æ¿ì
									{
										//alert("°Ë»ö¾î¿¡ °Ë»ö ºÒ°¡´É ´Ü¾îÀÎ ' "+obj.value.charAt(i)+" '°¡ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.");
										//obj.focus();
										//return false;
										//retValue += obj.value.charAt(i);
									}
								else
									{
										byteSize += 2;
										retValue += obj.value.charAt(i);
									}
							} 
						else if ( chr.indexOf("%") != -1 ) 
							{		//"~"¿Í °°Àº Æ¯¼ö¹®ÀÚÀÇ °æ¿ì ¾Æ½ºÅ°°ªÀÌ 3ÀÚ¸®´Ï±î...
								if(obj.value.charAt(i) != "-" && obj.value.charAt(i) != '"' && obj.value.charAt(i) != "'" && obj.value.charAt(i) != "," && obj.value.charAt(i) != "&")
									{
										byteSize += 2;
										retValue += obj.value.charAt(i);
									}
					//				alert("°Ë»ö¾î¿¡ °Ë»ö ºÒ°¡´ÉÇÑ Æ¯¼ö¹®ÀÚ ' "+obj.value.charAt(i)+" '°¡ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.");
					//				obj.focus();
					//				return false;
							}
					}
				if(byteSize < 2)
					{
						if(obj.value != "")
						{
							alert("Æ¯¼ö¹®ÀÚ¸¦ Á¦¿ÜÇÑ ¿µ¹®ÀÌ³ª ¼ýÀÚ, ÀÚÀ½, ¸ðÀ½µî ÇÑ´Ü¾î·Î´Â °Ë»öÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù.");
							obj.focus();
							return false;
						}
						else
						{
							return true;
						}
					}
				else
					{
						obj.value = retValue;
						return true;
					}
			}
	}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//½ºÄ«ÀÌ ½ºÅ©·¡ÆÛ...

	function RightLayer(obj,xSize,ySize)
	{
		var xMax = document.body.clientWidth, yMax = document.body.clientHeight;
		var xOffset = (xMax/2-(xSize/2)) + 466, yOffset = 120; 
		//Áß½É¿¡¼­ ¿À¸¥ÂÊÀ¸·Î ·¹ÀÌ¾î width/2 , height/2 ¸¸Å­ ÀÌµ¿ ½ÃÄÑ Ã¢ ¶Ù¿ì±â
		if (xMax < 1000)
			xOffset = 932;
		var divMenu = document.all[obj].style;
		divMenu.top = yOffset;
		divMenu.left = xOffset;
		
		MovePosition();
	}
	
	function CheckUIElements()
  {
          var yMenu1From, yMenu1To, yOffset, timeoutNextCheck;
          var wndWidth = parseInt(document.body.clientWidth);
                                          
           yMenu1From   = parseInt (BannerLayer.style.top, 10);
           yMenu1To     = document.body.scrollTop + 88; // À§ÂÊ À§Ä¡
                                          
          timeoutNextCheck = 500;
                                          
          if ( yMenu1From != yMenu1To ) {
                 yOffset = Math.ceil( Math.abs( yMenu1To - yMenu1From ) / 10 );
           if ( yMenu1To < yMenu1From )
                   yOffset = -yOffset;
                                          
  				BannerLayer.style.top = parseInt (BannerLayer.style.top, 10) + yOffset;
                                          
           timeoutNextCheck = 10;
   }
                                          
   setTimeout ("CheckUIElements()", timeoutNextCheck);
  }
                                          
  function MovePosition()
  {
   var wndWidth = parseInt(document.body.clientWidth);
                                          
   // ÆäÀÌÁö ·Îµù½Ã Æ÷Áö¼Ç
                                          
           BannerLayer.style.top = document.body.scrollTop + 88;
                                          
           BannerLayer.style.visibility = "visible";
                                          
   //initializing UI update timer
   CheckUIElements();
                                          
   return true;
  }