function Login(url){
	if(url==null){
		//url = yongpyong_domain+"/index.asp";
		url = document.URL;
		var url_link = online_domain+"/popup/pop_login.asp?next_url="+escape(url);
		document.domain="yongpyong.co.kr";
		window.open(url_link, "new", "width=400,height=250,resizable=0, top=0, left=0");
	}else{
		if(confirm("·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½ºÀÔ´Ï´Ù\n\nÁö±Ý ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")) {
			var url_link = online_domain+"/popup/pop_login.asp?next_url="+escape(url);
			document.domain="yongpyong.co.kr";
			window.open(url_link, "new", "width=400,height=250,resizable=0, top=0, left=0");
		}else{
			return;
		}
	}
}
function Logout(){
	document.location.href="/logout.asp";
}
function imgResize(idx,width){
	for(i=1;i<=idx;i++){
		if ( eval('document.img_' + i + '.width >'+width) ) {
		eval('document.img_' + i + '.width ='+width) ;
		}
	}
}
/************************************************************
	LayerÃ³¸®
	LayerSH('LayerID','show ¶Ç´Â hide')
************************************************************/
function LayerSH(LayerName,Status){
	ns4 = (document.layers)?true:false
	ie4 = (document.all)?true:false
		if(ns4){
			LayerN = document.layers[LayerName]
			if (Status == 'show') LayerN.visibility = 'show';
			if (Status == 'hide') LayerN.visibility = 'hidden';
		}
		if(ie4){
			LayerN = document.all[LayerName].style
			if (Status == 'show'){
			LayerN.visibility = 'visible';
			LayerN.display = 'block';
			}
			if (Status =='hide'){
			LayerN.visibility = 'hidden';
			LayerN.display = 'none';
			}
		}
}
/************************************************************
	¹®ÀÚÄ¡È¯
	replace(form.content,"\n","<br>")
************************************************************/
function replace(string,text,by){
		var strLength = string.length, txtLength = text.length;
		if ((strLength ==0) || (txtLength==0)) return string;

		var i = string.indexOf(text);
		if((!i)&&(text != string.substring(0,txtLength))) return string;
		if(i == -1) return string;
		
		var newstr = string.substring(0,i) + by;

		if(i+txtLength < strLength)
			newstr += replace(string.substring(i+txtLength,strLength),text,by)

		return newstr;
	}
	
	
// function Pop_view(what) { 

// 	var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=10,height=10'); 
// 	imgwin.focus(); 
// 	imgwin.document.open(); 
// 	imgwin.document.write("<html>\n"); 
// 	imgwin.document.write("<head>\n"); 
// 	imgwin.document.write("<title>SOO PETCLINIC</title>\n"); 
// 	
// 	imgwin.document.write("<sc"+"ript>\n"); 
// 	imgwin.document.write("function resize() {\n"); 
// 	imgwin.document.write("pic = document.il;\n"); 
// 	//imgwin.document.write("alert(eval(pic).height);\n"); 
// 	imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
// 	imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 40; myWidth = eval(pic).width + 12;\n"); 
// 	imgwin.document.write("  } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n"); 
// 	imgwin.document.write("  clearTimeout();\n"); 
// 	imgwin.document.write("  var height = screen.height;\n"); 
// 	imgwin.document.write("  var width = screen.width;\n"); 
// 	imgwin.document.write("  var leftpos = width / 2 - myWidth / 2;\n"); 
// 	imgwin.document.write("  var toppos = height / 2 - myHeight / 2; \n"); 
// 	imgwin.document.write("  self.moveTo(leftpos, toppos);\n"); 
// 	imgwin.document.write("  self.resizeTo(myWidth, myHeight);\n"); 
// 	imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
// 	imgwin.document.write("</sc"+"ript>\n"); 
// 	
// 	imgwin.document.write("</head>\n"); 
// 	imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 
// 	
// 	imgwin.document.write("<img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();'>\n"); 
// 	imgwin.document.write("</body>\n"); 
// 	imgwin.document.close(); 

// } 
//ÀÌ¹ÌÁöÆË¾÷Ã¢Á¶Àý
function Pop_view(what) {
        var imgwin = window.open("",'PFImageViewer','scrollbars=yes,status=no,toolbar=no,resizable=yes,location=no,menu=no,width=10,height=10');
        imgwin.focus();
        imgwin.document.open();
        imgwin.document.write("<html>\n");
        imgwin.document.write("<html>\n");
        imgwin.document.write("<head>\n");
        imgwin.document.write("<title>Enjoy Your Life? Say, YongPyong</title>\n");
        imgwin.document.write("<sc"+"ript language='javascript'>\n");
        imgwin.document.write("    function resize() {\n");
        imgwin.document.write("        pic = document.image;\n");
        imgwin.document.write("        if (eval(pic).height) {\n");
        imgwin.document.write("            var name = navigator.appName;\n");
        imgwin.document.write("            if (name == 'Microsoft Internet Explorer') {\n");
        imgwin.document.write("                myHeight = eval(pic).height + 30;\n");
        imgwin.document.write("                myWidth = eval(pic).width+ 10;\n");
        imgwin.document.write("            } else {\n");
        imgwin.document.write("                myHeight = eval(pic).height + 9;\n");
        imgwin.document.write("                myWidth = eval(pic).width;\n");
        imgwin.document.write("            }\n");
        imgwin.document.write("            var heightPic = pic.height;\n");
        imgwin.document.write("            var widthPic = pic.width;\n");
        imgwin.document.write("            if (widthPic <= 1024 && heightPic <= 768){\n");
        imgwin.document.write("                self.resizeTo(myWidth, myHeight);\n");
        //imgwin.document.write("                self.moveTo(80,80);\n");
        imgwin.document.write("                document.body.style.overflow='hidden';\n");
        imgwin.document.write("            } else {\n");
        imgwin.document.write("                if (widthPic > 1024 && heightPic <= 768) {\n");
        imgwin.document.write("                    self.resizeTo(1024, myHeight+20);\n");
        //imgwin.document.write("                    self.moveTo(80,80);\n");
        imgwin.document.write("                } else if (widthPic <= 1024 && heightPic > 768) {\n");
        imgwin.document.write("                    self.resizeTo(myWidth+20, 768);\n");
        //imgwin.document.write("                    self.moveTo(80,80);\n");
        imgwin.document.write("                } else {\n");
        imgwin.document.write("                    self.resizeTo(1024, 768);\n");
        //imgwin.document.write("                    self.moveTo(80,80);\n");
        imgwin.document.write("                }\n");
        imgwin.document.write("            }\n");
        
        imgwin.document.write("  var height1 = screen.height;\n"); 
		imgwin.document.write("  var width1 = screen.width;\n"); 
		imgwin.document.write("  var leftpos = width1 / 2 - myWidth / 2;\n"); 
		imgwin.document.write("  var toppos = height1 / 2 - myHeight / 2; \n"); 
		imgwin.document.write("  self.moveTo(leftpos, toppos);\n"); 

        imgwin.document.write("        } else setTimeOut(resize(), 100);\n");
        imgwin.document.write("}\n");
        imgwin.document.write("</sc"+"ript>\n");
        imgwin.document.write("</head>\n");
        imgwin.document.write("<body bgcolor='#FFFFFF' style='margin:0'>\n");
        imgwin.document.write("<div align='center' valign='middle'><a href='javascript:self.close()' onfocus='this.blur()'><img border='0' src='"+escape(what)+"' xwidth='10' xheight='9' name='image' onload='resize();'></a></div>\n");
        imgwin.document.write("</body>\n");
        imgwin.document.write("</html>\n");
        imgwin.document.close();
}