//*****************************************************************
//        ·Ñ¿À¹ö
//*****************************************************************

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_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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.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_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}



//*****************************************************************
//         ÆË¾÷Ã¢
//*****************************************************************
function XaccWindow(pop,width,height)
{

	if( self.Xaccwin && !Xaccwin.closed ) {
		Xaccwin.focus();
		return;
//		Xaccwin.close();
//		Xaccwin = null;
	}

//	var url = pop + ".html";
	var url = pop;
	var wd = width;
	var he = height;

	if ( self.screen ) { //nn4, ie4¿¡¼­ »ç¿ë
		var dummyX = (screen.width - width) / 2;
		var dummyY = (screen.height - height) / 2;
			Xaccwin = window.open( url, "Xaccwin", 'width='+width+',height='+height+',left='+dummyX+',top='+dummyY+',screenX=5,screenY=10,menubar=0,resizable=no,scrollbars=no');
	}

}

function popwindow(pop,width,height)
{

	var url = pop + ".html";
	var wd = width;
	var he = height;


	window.open(url,"mywin","toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ";")
}


function popwindow2(pop,width,height)
{
	var url = pop + ".jsp";
	var wd = width;
	var he = height;

	window.open(url,"mywin","toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ";")
}

function popwindow3(pop,width,height)
{
	var url = pop + ".htm";
	var wd = width;
	var he = height;

	window.open(url,"mywin","toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ";")
}

function popwindow4(pop,width,height)
{
	var url = pop;
	var wd = width;
	var he = height;

	window.open(url,"mywin","toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ";")
}


//*****************************************************************
//        ·¹ÀÌ¾î
//*****************************************************************

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';
			if (Status == 'hide') LayerN.visibility = 'hidden';
		}
	}



var n = (document.layers) ? 1:0;
		var ie = (document.all) ? 1:0;

		function overTip(boxObj) {
			if (ie) {
		        	boxObj.style.visibility = "visible";

			}
		}
		function outTip(boxObj) {
			if (ie) {
				boxObj.style.visibility = "visible";
				boxObj.filters.item(0).transition = 12;
				boxObj.filters.item(0).apply();
				boxObj.style.visibility = "hidden";
				boxObj.filters.item(0).play();
			}
		}

function GetCookie1(name) {
  var namelen = name.length;
  var cLen = document.cookie.length;
  var i=0;
  while (i<cLen) {
    var j=i+namelen;
    if (document.cookie.substring(i,j) == name) {
      var cEnd = document.cookie.indexOf(";", j)
      if (cEnd == -1) {
        cEnd = document.cookie.length;
      }
      return document.cookie.substring(j+1, cEnd);
    }

    i++;
  }
  return null;
}

function GetCookie(name) {
    var namelen = name.length;
    var cLen = document.cookie.length;
    var i=0;
//alert(cLen);
//alert(document.cookie);
    while (i<cLen) {
        var j=i+namelen;
        if (document.cookie.substring(i,j) == name) {
            var cEnd = document.cookie.indexOf(";", j)
            if (cEnd == -1) {
                cEnd = document.cookie.length;
            }
            return document.cookie.substring(j+1, cEnd);
        }

        i++;
    }
    return null;
}

function SetCookie( name, value ) {
	document.cookie = name + "=" + escape( value ) + ";"
}

function SetCookie1(name, value){
   var path = '/';
   var domain = 'ssfutures.com';
   var secure = false;
   today = new Date();
	var cookval = name + "=" + value + ";";

//alert(cookval);
	document.cookie = cookval;
//   document.cookie = name + "=" + value +
//     "; expires=" + today.toGMTString() +
//     ((path == null) ? "" : ("; path=" + path));// +
}


var htmlURL = "http://www.ssfutures.com";
var sslURL = "https://www.ssfutures.com";


//*****************************************************************
//        inputCheck
//*****************************************************************

// ÁÖ¹Îµî·Ï ¹øÈ£ check
function clntid() {
	df = document.form1
					var sn = new Array(13);
					for (i=0; i<df.jumin1.value.length; i++) {
						sn[i] = df.jumin1.value.charAt(i);
					}
					for (i=6; i<df.jumin2.value.length+6; i++) {
						sn[i] = df.jumin2.value.charAt(i-6);
					}
					var intSum=0;
					for (i=0; i<12; i++) {
						intSum = intSum + ((i%8)+2) * parseInt(sn[i]);
					}
					intTemp = 11 * Math.floor(intSum / 11) + 11 - intSum;
					var lastDigit = intTemp - 10 * Math.floor(intTemp / 10);
					if (parseInt(lastDigit)!=parseInt(sn[12])){
						alert("À¯È¿ÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä!");
						df.jumin1.focus();
						return false;
					}
					return true;
}




// ID check
function chkid() {
	df = document.form1
						for (i=0; i<df.usid.value.length; i++) {
							if (	(df.usid.value.charAt(i) < 'A' || df.usid.value.charAt(i) > 'Z') &&
									(df.usid.value.charAt(i) < '0' || df.usid.value.charAt(i) > '9') &&
									(df.usid.value.charAt(i) < "a" || df.usid.value.charAt(i) > "z")		)
							{
								alert("È¸¿øID¿¡ Æ¯¼ö¹®ÀÚ´Â Çã¿ëÇÏÁö ¾Ê½À´Ï´Ù.");
								df.usid.select();
								return;
							}
						}

					if(!isNaN(df.usid.value)) {
						alert("ID´Â 1±ÛÀÚÀÌ»óÀÇ ¿µ¹®À» Æ÷ÇÔÇØ¾ßÇÕ´Ï´Ù.");
						df.usid.select();
						return;
					}
					else if (df.usid.value.length < 6 || df.usid.value.length > 8) {
						alert("È¸¿øID´Â ¿µ¹® ¶Ç´Â ¿µ¹®,¼ýÀÚÈ¥¿ë 6~8ÀÚ¸®·Î Á¤ÇØÁÖ½Ê½Ã¿À!");
						df.usid.select();
						return;
					}return true;
}


// ºñ¹Ð¹øÈ£ check
function password() {
	df = document.form1
						for (i=0; i<df.pass.value.length; i++) {
							if (	(df.pass.value.charAt(i) < 'A' || df.pass.value.charAt(i) > 'Z') &&
									(df.pass.value.charAt(i) < '0' || df.pass.value.charAt(i) > '9') &&
									(df.pass.value.charAt(i) < "a" || df.pass.value.charAt(i) > "z")		)
							{
								alert("ºñ¹Ð¹øÈ£¿¡ Æ¯¼ö¹®ÀÚ´Â Çã¿ëÇÏÁö ¾Ê½À´Ï´Ù.");
								top.focus();
								df.pass.select();
								return;
							}

						}


					if (df.pass.value.length < 6 || df.pass.value.length > 8) {
						alert("ºñ¹Ð¹øÈ£´Â 6~8ÀÚ¸®·Î Á¤ÇØÁÖ½Ê½Ã¿À!");
						top.focus();
						df.pass.select();
						return;
					}
}


// ¼ýÀÚ check
function chkNum(sObject) {
for (i=0; i<sObject.value.length; i++) {
		if (sObject.value.charAt(i) < '0' || sObject.value.charAt(i) > '9') {
			alert("¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
			top.focus();
			sObject.select();
			return;
		}
	}
}


// ¸ÞÀÏ check
	function chmail() {
		var k=0, str='';
   		var c,i=0;
 		str = document.form1.txEmail.value;
		for(i=0;i<str.length;i++){
			c=str.substring(i,(i+1));
			if( c=='@'){
			   k++;
			}else if( c=='.'){
	        		k++;
			}
		}
		if(!(k>=2)){
			alert('¸ÞÀÏÁÖ¼Ò¸¦ È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿À.');
			top.focus();
			document.form1.txEmail.select();
			return;
		}
	}	

