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();
}
	// ¼ýÀÚ ¿©ºÎ Ã¼Å© (return => True or False)
function IsNum(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.value ="";
			obj.focus();
			return true;
		}     
	}
	return false;
}

function IsValidEmail(mail){
	var t = mail
	var ValidFlag = false
	var atCount = 0
	var SpecialFlag
	var atLoop
	var atChr
	var BadFlag
	var tAry1
	var UserName
	var DomainName

	if ( t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0 ) {
		atCount = 0
		SpecialFlag = false

		for( atLoop=1; atLoop<=t.length; atLoop++ ) {
			atChr = t.substring( atLoop, atLoop+1 )
			if ( atChr == "@" ) atCount = atCount + 1

			if ( (atChr >= 32) && (atChr <= 44) ) SpecialFlag = true 
			if ( (atChr == 47) || (atChr == 96) || (atChr >= 123) ) SpecialFlag = true 
			if ( (atChr >= 58) && (atChr <= 63) ) SpecialFlag = true 
			if ( (atChr >= 91) && (atChr <= 94) ) SpecialFlag = true 
		}

		if ( ( atCount == 1 ) && (SpecialFlag == false ) ) {
			BadFlag = false
			tAry1 = t.split("@")
			UserName = tAry1[0]
			DomainName = tAry1[1]
			if ( (UserName.length <= 0 ) || (DomainName.length <= 0 ) ) BadFlag = true
			if ( DomainName.substring( 0, 1 ) == "." ) BadFlag = true
			if ( DomainName.substring( DomainName.length-1, DomainName.length) == "." ) BadFlag = true
			ValidFlag = true
		}
	}
	if ( BadFlag == true ) ValidFlag = false
	return ValidFlag
}
//ÀÌ¹ÌÁöÆË¾÷Ã¢Á¶Àý
function imageView(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();
}

//ÀÎÁõ¾Á ÆË¾÷
function popSeal() {
	sealWin=window.open('https://digitalid.verisign.com/as2/8792aaafcd6d5d1d0374dbc0d0ad3be7',"win",'left=50, top=50, toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=650,height=450');
	self.name = "mainWin"; 
}

function popSeal2() {
	sealWin=window.open('https://seal.verisign.com/splash?form_file=fdf/splash.fdf&dn=ONLINE.YONGPYONG.CO.KR&lang=ko',"win",'left=50, top=50, toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=550,height=400');
	self.name = "mainWin"; 
}


//############################################################################
//		ÇÃ·¡½Ã »ðÀÔ ÇÔ¼ö
//############################################################################
//showRoom Ç®½ºÅ©¸°
function FNfullscreen(Turl) {
	var X_max = screen.availWidth -10;
	var Y_max = screen.availHeight -40;

	var full_screen ="top=0, left=0, width=" + X_max + ", height=" + Y_max + ", resizable=no, menubar=no, scrollbars=no, status=no, toolbar=no";
	window.open(Turl,'win',full_screen);
	self.opener = self;	
}




function FNflash_insert(Tobj,flashvars){
	var tot_url =document.URL;	
	var flashPath;
	
	if(tot_url.substr(0,5)=="http:") flashPath="/images/swf/visual/";//==========>**ÇÃ·¡½Ã °æ·Î¼³Á¤(ÇÃ·¡½Ã °æ·Î È®ÀÎ)**
	else flashPath="./";
	
	var Fswf="";			var Fwidth="";		var Fheight="";					
	var Fid="";			var Fwmode="";	var Falign="";
	var Fbgcolor="";	var Fquality="";		var FallowScriptAccess="";
	var FallowFullScreen="";

	var seperate1=",";	var seperate2="=";
	var ARobj=Tobj.split(seperate1);

	for(var i=0; i<=ARobj.length-1; i++){
		var prop=this["Ftag"+i]=ARobj[i].split(seperate2);
		if(prop[0].search("swf") !=-1) Fswf=prop[1];
		if(prop[0].search("width") !=-1) Fwidth=prop[1];
		if(prop[0].search("height") !=-1) Fheight=prop[1];
		if(prop[0].search("id") !=-1) Fid=prop[1];
		if(prop[0].search("wmode") !=-1) Fwmode=prop[1];
		if(prop[0].search("align") !=-1) Falign=prop[1];
		if(prop[0].search("bgcolor") !=-1) Fbgcolor=prop[1];
		if(prop[0].search("quality") !=-1) Fquality=prop[1];
		if(prop[0].search("allowScriptAccess") !=-1) FallowScriptAccess=prop[1];
		if(prop[0].search("allowFullScreen") !=-1) FallowFullScreen=prop[1];
	}  

	if(Fswf=="") alert("Flash_insert Err: ÆÄÀÏ¸í");
	else Fswf=flashPath+Fswf;
	if(Fwidth=="") Fwidth="100%";
	if(Fheight=="") Fheight="100%";
	if(Fid==""){var Tid=Fswf.split("."); Fid=Tid[0];}
	if(Fwmode=="") Fwmode="";
	if(Falign=="") Falign="LT";
	if(Fbgcolor=="") Fbgcolor="#FFFFFF";
	if(Fquality=="") Fquality="best";
	if(FallowScriptAccess=="") FallowScriptAccess="always";
	if(FallowFullScreen=="") FallowFullScreen="false";

	if(flashvars == null) var Tvars="Rpath="+flashPath+"&";
	else var Tvars=flashvars+"&Rpath="+flashPath+"&";

	var str=new String();
//	if (navigator.appName.indexOf("Microsoft") != -1){
		str+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		str+='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
		str+='width="'+Fwidth+'" height="'+Fheight+'"id="'+Fid+'">';
		str+='<param name="movie" value="'+Fswf+'"/>';
		str+='<param name="flashvars" value="'+Tvars+'">';
		str+='<param name="quality" value="'+Fquality+'"/>';
		str+='<param name="bgcolor" value="'+Fbgcolor+'"/>';
		str+='<param name="wmode" value="'+Fwmode+'"/>';
		str+='<param name="allowScriptAccess" value="'+FallowScriptAccess+'"/>';
		str+='<param name="allowFullScreen" value="'+FallowFullScreen+'"/>';
//		str+= '</object>';
//	}else{
		str+='<embed src="'+Fswf+'" ';
		str+='quality="'+Fquality+'" ';
		str+='bgcolor="'+Fbgcolor+'" ';
		str+='width="'+Fwidth+'" ';
		str+='height="'+Fheight+'" ';
		str+='name="'+Fid+'" ';
		str+='wmode="'+Fwmode+'" ';
		str+='allowScriptAccess="'+FallowScriptAccess+'" ';
		str+='allowFullScreen="'+FallowFullScreen+'" ';
		str+='flashvars="'+Tvars+'"';
		str+='type="application/x-shockwave-flash" ';
		str+='pluginspage="http://www.macromedia.com/go/getflashplayer">';
		str+='</embed>';
		str+= '</object>';		
//	}
	document.write(str);
}
