//¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
//			
//			KOASSET.NET ÀÚ¹Ù ½ºÅ©¸³Æ® ÀÎÄí·çµå ¸ðµâ (2003-12-22)
//			
//         ¸ðµç ÆäÀÌÁö¿¡ °øÅëÀ¸·Î µé¾î°¨.
//
//
//¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
		
		
	// Cookie  ÀúÀå ÇÔ¼ö
	function setCookie(name,value){
		document.cookie = name + "=" + value; 
	}

	// Cookie °Ë»ö ÇÔ¼ö
	function getCookie( name ){			
		var aCookie = document.cookie.split("; ");				
		for (var i=0; i < aCookie.length; i++)
		{			
			var aCrumb = aCookie[i].split("=");
			if (name == aCrumb[0]) 
				return aCrumb[1];
		}
		return -1; 
	}

	// Cookie »èÁ¦ ÇÔ¼ö
	function delCookie( name ){
		var today = new Date(); 
		today.setTime(today.getTime() - 1); 
		
		var value = getCookie(name); 
		if(value != "") 
			document.cookie = name + "=" + value + "; expires=" + today.toGMTString(); 
	}
	
	
	// Á¶°Ç¿¡ ÀÇÇÑ Ã¢ ¿­±â 
	function OpenWindow(Url, Width, Height, Scroll,Title){
		var feature = "width="+ Width +",height="+Height+",scrollbars="+ Scroll +",toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,top=100,left=100";
		window.open (Url,Title, feature);
		return;
	}

//È¸»çºê·Î½´¾î¿­±â
 function companyOpen()
 {
  window.open('/com/company.swf','naver','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=660,height= 950');

 }

 
	// »õ·Î¿îÃ¢ ¿­±â 
	function NewWindow(Url){
		window.open (Url);
		return;
	}

	// °øÁö»çÇ× »õÃ¢
	var remote = null;     	
	function fnOpenWindow( _url, _name, _top, _left, _width, _height, scroll ){		
		var feature; 

		feature = "width="+_width+", height=" +_height+",resizable=0,menubar=0,status=0,scrollbars=" + scroll; 
		remote = window.open('',_name, feature);
				
		remote.moveTo(_top,_left);						
		
		if (remote != null) {
			if (remote.opener == null) {
				remote.opener = self;
			}
			remote.location.href = _url;
		}
		remote.focus();
	} 

	//·Ñ¿À¹ö ÀÌ¹ÌÁö Ã³¸® 
	function MM_swapImgRestore() {
  		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() {
  		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) {
  		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); return x;
	}

	function MM_swapImage() {
  		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];}
   	}	


	//¸Þ½ÃÁö ¹Ú½º + URL ·Î±×ÀÎÆû È£Ãâ
	function LoginProcess(Url, Msg)
	{
		if ( confirm("\n" + Msg + "       \n\n·Î±×ÀÎ ÈÄ °è¼ÓÇÏ½Ã°Ú½À´Ï±î ?") ) location.href = Url;
	}	


	/* °ø¹é Áö¿ì±â ÇÔ¼ö */
	function eraseBlank(s)
	{
		var c, rs; 
		rs="";
	
		intLength = s.length;
		if(0==intLength) 
			return rs;
		else {
			for(var i=0; i<intLength; i++) {
				c = s.charAt(i);
				if(" " != c) rs += c;
			}
			return rs;
		}
	}
	
	function chkNull (s) 
	{
		if ( "" == eraseBlank(s) )
			return true; 
		else 
			return false;
	}

	/////////////////////// ¸ÞÀÎÆäÀÌÁö Àü¿ë ////////////////////////////



	//±×³É ¼­ºê¹Ô
	function fnGo(f){
		f.submit();		
	}

	
	function ReadCookie(name)
	{
		var label = name + "=" ;
		var labelLen = label.length ;
		var cLen = document.cookie.length
		var i = 0
		while (i < cLen){
			var j = i + labelLen
			if (document.cookie.substring(i,j) == label) {
				var cEnd = document.cookie.indexOf(";",j)
				if (cEnd == -1){
					cEnd = document.cookie.length
						}
				return unescape(document.cookie.substring(j,cEnd))
				}
			i++
		}
		return ""
	}


	//¸Þ´º½ÇÇà
	function runURL(goURL){
		self.location.href = goURL;
	}
	
	//·Î±×ÀÎÃ³¸® ÈÄ ÀÌµ¿ ÇÁ·Î¼¼½º
	function AlertUser(Mval){  
		var valCookLog = getCookie("cookLogIn");
		var valCookUserID = getCookie("cookUserID");
		var valMno = getCookie("cookMemberNO");

		if (eraseBlank(valCookLog) == "N" || eraseBlank(valCookLog) ==''){
			var aaa = confirm ("·Î±×ÀÎ Á¤º¸°¡ ¼Õ½ÇµÇ¾ú°Å³ª ·Î±×ÀÎ »óÅÂ°¡ ¾Æ´Õ´Ï´Ù.\n·Î±×ÀÎ ÈÄ °è¼ÓÇÏ½Ã°Ú½À´Ï±î?") ;
			if (aaa != true) {
				//alert ("Ãë¼ÒÇß½À´Ï´Ù") ; 
			}
			else{		    
				if(Mval == 4){runURL('/Login/Login.asp?mi=1&s_mi=0&reqPageName=È¸¿øÁ¤º¸¼öÁ¤');}		//È¸¿øÁ¤º¸¼öÁ¤
				else if(Mval == 5){runURL('/Login/Login.asp?mi=1&s_mi=0&reqPageName=È¸¿øÅ»Åð');}	 	//È¸¿øÅ»Åð
				else if(Mval == 6){runURL('/Login/Login.asp?mi=1&s_mi=0&reqPageName=°ø¸Å¹°°Ç');}	 	//°ø¸Å¹°°Çµî·Ï
				else if(Mval == 7){runURL('/Login/Login.asp?mi=1&s_mi=0&reqPageName=ÇöÀå¼Ò½Ä');}	 	//ÇöÀå¼Ò½Ä
			}
		}
		else{			
			if(Mval == 5){runURL('/member/JoinSecede.asp?mi=4&s_mi=0');}													//È¸¿øÅ»Åð			
			else if(Mval == 4){runURL('/member/member_join.asp?mi=3&s_mi=0');}											//È¸¿øÁ¤º¸¼öÁ¤		
			else if(Mval == 6){runURL('/object_info/ShortSell/ShortSell_Insert.asp?Category=35&mi=4&s_mi=0');}  //°ø¸Å¹°°Çµî·Ï	
			else if(Mval == 7){runURL('/QA/QA_write.asp?Cat=2&mi=2&s_mi=0');}  //ÇöÀå¼Ò½Ä	
		}
	}


