﻿var Toggle =1; 
function ADtop(obj,chk) {   
  Toggle = 0;   
  switch(chk) { 
        case 1: 
          obj.stop(); 
          break; 
        case 2: 
          obj.stop(); 
          break; 
  }     
} 

function ADstart(obj,chk)  {   
  Toggle = 1;   
  switch(chk) { 
        case 1: 
          obj.start(); 
          break; 
        case 2: 
          obj.start(); 
          break; 
  }     
} 

function ADmove(obj) {  
	var time;
	time = setTimeout("ADstart(obj,1)",3500);   
	//alert(time);
	
	//obj.stop();
} 


function confirm_userdel() {
	var stat = confirm('정말로 탈퇴하시겠습니까?\r\n탈퇴하시면 모든 포인트와 회원정보가 삭제되어 복구할 수 없습니다.');
	if (stat==true) {
		self.location='layout.php?main=user/adduser.php&mode_user=deluser';
	}
}

function input_next(thisObj,theLength,toObj){
	if(thisObj.value.length == theLength) toObj.focus();
}
function theDiv(name) {
	var obj;
	var ns4 = document.layers;
	var ie = document.all;
	var ns6 = document.getElementById && !document.all;
	if (ns4) obj = eval("document.layers."+name);
	else if (ns6) obj = eval("document.getElementById('"+name+"')");
	else  obj = eval("document.all."+name);
	return obj;
}
function collapse(sortcode){
	//node=eval("node_"+sortcode+".style");
	node=theDiv("node_"+sortcode+".style");
	if (node) {
		if (node.display=="block") {
			node.display="none";
		} else {
			node.display="block";
		}
	}
}
function collapse_img(sortcode,nodetype){/////수정1
	node=eval("node_"+sortcode+".style");
	nodeimg=eval("nodeimg_"+sortcode);
	//alert(nodeimg.src);
	if (node && nodeimg) {
		if (node.display=="block") {
			if (nodetype==0) {/////수정1
				nodeimg.src="img/xp/minus.gif";
			} else {/////수정1
				nodeimg.src="img/xp/minus_l.gif";/////수정1
			}/////수정1
		} else {
			if (nodetype==0) {/////수정1
				nodeimg.src="img/xp/plus.gif";
			}else {/////수정1
				nodeimg.src="img/xp/plus_l.gif";/////수정1
			}/////수정1
		}
	}
}
function collapse_imgx(sortcode,xup,xdown){
	node=eval("node_"+sortcode+".style");
	nodeimg=eval("nodeimg_"+sortcode);
	if (node && nodeimg) { 
		if (node.display=="block") {
			nodeimg.src=xup;
		} else {
			nodeimg.src=xdown;
		}
	}
}

function nomore() {
   if ( document.form1.popup.checked ) {
   	//alert("이 창을 더이상 열지 않습니다.");
	setCookie( "nomore", "checked" ,1 );
	}
}
function popup(popup_filename){
	if (getCookie("nomore")=="checked"){
	}else{
		window.open(popup_filename,'event', 'width=10,height=10, marginwidth=0,marginheight=0, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
}

function getCookie(strName)
{

	var strArg = new String(strName + "=");	
	var nArgLen, nCookieLen, nEnd;
	var i = 0, j;
	
	nArgLen    = strArg.length;
	nCookieLen = document.cookie.length;
	
	if(nCookieLen > 0) {	
		while(i < nCookieLen) {		
			j = i + nArgLen;			
			if(document.cookie.substring(i, j) == strArg) {			
				nEnd = document.cookie.indexOf (";", j);
				if(nEnd == -1) nEnd = document.cookie.length;				
				return unescape(document.cookie.substring(j, nEnd));
			}			
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
	}
	
	return("");
}

function setCookie(strName, strValue, dateExpires)
{
   
	var strCookie, strPath, strDomain, isSecure;
	strPath = "/";
	
	var nowdate = new Date();
	nowdate.setDate( nowdate.getDate() + dateExpires );
	
	if(strName == "") return ;
		   
	strCookie = strName + "=" + escape(strValue) + 
		    ((dateExpires) ? "; expires=" + nowdate.toGMTString() : "")  + 
				((strPath)     ? "; path="    + strPath : "") + 
	      ((strDomain)   ? "; domain="  + strDomain : "") +  
		    ((isSecure)    ? "; secure" : "");
	
	document.cookie = strCookie; 

}
/**
function setCookie( name, value, expiredays ) {

	var nowdate = new Date();

	nowdate.setDate( nowdate.getDate() + expiredays );

	document.cookie = name + "=" + escape( value ) + "; domain=sjenter.co.kr; path=/; expires=" + nowdate.toGMTString() + ";";

	//document.cookie = name + "=" + escape( value ) + "; domain=<? echo $HTTP_HOST;?>; path=/; expires=" + nowdate.toGMTString() + ";";

}


function setCookie(strName, strValue, dateExpires, strPath, strDomain, isSecure)
{
   
	var strCookie;
	
	if(strName == "") return ;
		   
	strCookie = strName + "=" + escape(strValue) + 
		    ((dateExpires) ? "; expires=" + dateExpires.toGMTString() : "")  + 
	      	    ((strPath)     ? "; path="    + strPath : "") + 
	      	    ((strDomain)   ? "; domain="  + strDomain : "") + 
		    ((isSecure)    ? "; secure" : "");
	
	document.cookie = strCookie; 

}
**/


function delCookie( name )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate()-1 );
	document.cookie = name+"=; expires="+todayDate.toGMTString()+";";
	//document.cookie = name+"=; domain=<? echo $HTTP_HOST;?>; path=/; expires="+todayDate.toGMTString()+";";
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.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; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  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_swapImgRestore() { //v3.0
  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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  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];}
}

function MM_showHideLayers() { //v6.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; }
}
