
function imagebox(file) { window.open('/util/viewer.asp?file='+file,'imagebox','width=500,height=400,resizable=no,scrollbars=yes'); }
function wbox(url) { window.open(url,'wbox','width=600,height=200,resizable=no,scrollbars=yes'); }
function event(file) { window.open('/gonggoo/event.asp','gonggoo_event','width=400,height=460,resizable=no,scrollbars=no'); }
function obox(url) { window.open(url,'wbox','width=100,height=100,resizable=no,scrollbars=no'); }
//
function ofix(sn, wn, w, h) { window.open(sn, wn,"WIDTH="+w+",HEIGHT="+h+",resizable=no,scrollbars=no"); }
function onofix(sn, wn, w, h) { window.open(sn, wn,"WIDTH="+w+",HEIGHT="+h+",resizable=yes,scrollbars=yes"); }
function ofix_loc(sn, wn, w, h, l, t) { window.open(sn, wn,"WIDTH="+w+",HEIGHT="+h+",LEFT="+l+",TOP="+t+",resizable=no,scrollbars=no"); }

function Layers() { 
   var i, visStr, args, theObj;
   args = Layers.arguments;
   for (i=0; i<(args.length-2); i+=3) {
      visStr   = args[i+2];
      if (navigator.appName == 'Netscape' && document.layers != null) {
         theObj = eval(args[i]);
         if (theObj) theObj.visibility = visStr;
      } else if (document.all != null) {
         if (visStr == 'show') visStr = 'visible';
         if (visStr == 'hide') visStr = 'hidden';
         theObj = eval(args[i+1]);
         if (theObj) theObj.style.visibility = visStr;
      }
   }
}


function OpenCertDetails() {
	thewindow = window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=KRAVAN1', 'anew', config='height=400,width=450,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
}

function memoLengthCheck(form,maxlen) {
	var t;
	var msglen;
	msglen = 0;

	l = form.memo.value.length;
	for(k=0;k<l;k++){
	    if (msglen > maxlen ) {
			form.memo.focus();
			alert("ÀÔ·Â °¡´ÉÇÑ ±ÛÀÚ¼ö¸¦ ÃÊ°úÇß½À´Ï´Ù.");
			return false;
	    }
	    t = form.memo.value.charAt(k);
	    if (escape(t).length > 4) msglen += 2;
	    else msglen++;
	}
}


// ¼ýÀÚ format
function unFormat(obj) {
    var temp = "";
    var n = String(obj.value);
    var len = n.length;
    var pos = 0;
    var ch = '';

    while (pos < len) {
        ch = n.charAt(pos);
        if ((ch >= '0') && (ch <= '9')) temp = temp + ch;
        pos = pos + 1;
    }
    obj.value = temp;
    return true;
}

function numFormat(obj)
{
    unFormat(obj);
    var str = Number(obj.value) + "";
    if( str=='NaN' ){
        alert("¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
        obj.focus();
        return;
    }
    var leng = str.length;
    var size = 3;
    var cnt = Math.floor(leng / size);
    var pos = leng % size;
    var result = "";

    for( var i = cnt ; i > 0 ; i-- ){
        result = "," + str.substr(pos+(i-1)*size, size) + result ;
    }

    if( pos == 0) {
        obj.value = result.substring(1);
    }else{
        obj.value = str.substr(0,pos) + result;
    }
    return;
}


function unFormatUSD(obj) {
//	alert("unformat obj:["+obj+"]");
	var temp = "";
	var n = String(obj.value);
	var len = n.length;
	var pos = 0;
  	var ch = '';
  	
	while (pos < len) {
		ch = n.charAt(pos);
		if ((ch >= '0') && (ch <= '9')) temp = temp + ch;
		if(pos == len-3) temp = temp + ".";
		pos = pos + 1;
	}
	obj.value = temp;
	return true;
}

function numFormatUSD(obj)
{	
	//ÀÔ·ÂÇÊµå¿¡ 3ÀÚ¸® ±¸ºÐÀÚ(,)°¡ ÀÖÀ¸¸é ¾ø¾Ø´Ù.
	var temp = "";
	var nn = String(obj.value);
	var llen = nn.length;
	var ppos = 0;
  	var cch = '';
  	
	while (ppos < llen) {
		cch = nn.charAt(ppos);
		if ( (cch >= '0') && (cch <= '9') ) { temp=temp+cch; }
		if ( ( ppos == llen-3) && (cch == '.' )) { temp = temp + cch; }
		
		ppos = ppos + 1;
	}
	
	obj.value = temp;
	/////////////
	
	if(obj.value == "")
		obj.value = "0";
	
	var usdvar = parseFloat(obj.value);
	obj.value = usdvar*100;

	var fullstr = Number(obj.value) + "";
	if( fullstr=='NaN' ){
		alert("¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		obj.value ="0"
		return;
	}
	
	var fullleng = fullstr.length;
	var str = fullstr.substr(0, fullleng-2);
	
	var leng = str.length; 
	var size = 3;
	var cnt = Math.floor(leng / size);
	var pos = leng % size;
	var result = "";
	
	for( var i = cnt ; i > 0 ; i-- ){
		result = "," + str.substr(pos+(i-1)*size, size) + result ;
	}

	if( pos == 0) {
		if(leng == 0)
		{
			obj.value = fullstr.substr(fullleng-2, 2);
		} else
		{		
			obj.value = result.substring(1) + "."+fullstr.substr(fullleng-2, 2);
		}	
	}else{
		obj.value = str.substr(0,pos) + result + "."+ fullstr.substr(fullleng-2, 2);
	}
	return;
}

// ·¹ÀÌ¾î¸¦ Ã¢ Áß°£À¸·Î ¸ÂÃß±â
function CenterPoint(mypoint, myvalue) {
	var widthX, widthY, mywidthX, myheightY;

	if ( mypoint == 'X' ) {
		mywidthX = parseInt ( myvalue / 2 );
		widthX = parseInt ( document.body.clientWidth / 2 - mywidthX );
		return ( widthX );
	} else if ( mypoint == 'Y' ) {
		mywidthY = parseInt ( myvalue / 2 );
		widthY = document.body.scrollTop + ( document.body.clientHeight / 2 ) - mywidthY;  
		return ( widthY );
	}
}

function clickLayer(url,width,height) {
	var Xpoint, Ypoint;
	//document.domain = "wassada.com";
	xpoint = parseInt ( document.body.clientWidth / 2 - width / 2 ) ;
	Ypoint = document.body.scrollTop + ( document.body.clientHeight / 2 ) - height/2 ;

	PopupLayer.style.visibility = 'hidden';
	PopupLayer.style.left   = CenterPoint('X', width);
	PopupLayer.style.top    = CenterPoint('Y', height);
	PopupFrame.location=url;
	PopupFrame.resizeTo(width,height);
	PopupLayer.style.visibility = 'visible';
}

//document.getElementById('menu_bar').style.visibility = "hidden";
function moveSubMenu( mainMenu, subMenu ) 
{
    // ¼­ºê ¸Þ´º¸¦ º¸ÀÌÁö ¾Êµµ·Ï ÇÔ
    subMenu.style.top = -400; 
    subMenu.style.visibility = "hidden"; 

    //highlightMenu( mainMenu );
    if(subMenu.id != "9") {
    	
    	if(subMenu.id == "sub1") {
    		subMenu.style.top = 135;
    		subMenu.style.left = (document.body.clientWidth-1000)/2+245;
    	} else {
    		subMenu.style.top = 135 + 'px';;
    		subMenu.style.left = (document.body.clientWidth-1000)/2+680 + 'px';;  
   		}
  		subMenu.style.visibility = "visible";  	
   	}
}
function moveSubMenuOut( mainMenu, subMenu ) 
{
    // ¼­ºê ¸Þ´º¸¦ º¸ÀÌÁö ¾Êµµ·Ï ÇÔ
    //subMenu.style.top = -400; 
    subMenu.style.visibility = "hidden";  		  		
}

function highlightMenu( menuItem )
{
    menuItem.style.backgroundColor = "#cbcbcb";
    menuItem.style.color = "white";
}

function normalMenu( menuItem )
{
    menuItem.style.backgroundColor = "";
    menuItem.style.color = "";
}

function menuAction( menuId, menuflag ) 
{
		if(menuflag == 0) {
    	document.getElementById(menuId).style.visibility = "hidden";  	
    } else if(menuflag == 1) {
    	document.getElementById(menuId).style.left = (document.body.clientWidth-1000)/2+125;
    	document.getElementById(menuId).style.visibility = "visible";  
    } else {
    	document.getElementById(menuId).style.visibility = "hidden";
    }	 		
}

function outline_box(obj,val) {
	if (document.all||document.getElementById) {
		if(val == 1) {
			obj.style.border = 1;
			obj.style.borderColor = '#FF0000';
		} else if(val == 0){
			obj.style.border = 0;
			obj.style.borderColor = '#cbcbcb';
		}
	}
}

function clickwishLayer(url,width,height) {
	var Xpoint, Ypoint;

	Xpoint = parseInt ( document.body.clientWidth / 2 - width / 2 );
	Ypoint = 145;

	wishLayer.style.visibility = 'hidden';
	wishLayer.style.left   = Xpoint;
	wishLayer.style.top    = Ypoint;
	wishFrame.location=url;
	wishFrame.resizeTo(width,height);
	wishLayer.style.visibility = 'visible';
}

function goCat(num) {
	if(num == 803) {
		document.location.href = 'http://www.wassada.com/shopping/pa/default.asp' ;
	} else {
		document.location.href = 'http://www.wassada.com/shopping/default.asp?code=' + num ;
	}
}
function goPage(part, btype, code, mode, num) {
	//$part,$BTYPE,$code,'s_recommend',$num
	//code=$code&mode=s_recommend&num=$num&part=$part&BTYPE=$BTYPE
	document.location.href = '/iboard_memo.asp?code=' + code + '&mode=' + mode + '&num=' + num + '&part=' + part + '&BTYPE=' + btype ;
}

/*
// htmledit
_editor_url = "/util/htmledit/";
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>');}

function Toggle(e) {
	var itemobj = document.getElementById('_editor_toolbar');
	if(typeof itemobj!="undefined") {
		var mystat = itemobj.style.display;
		if(e == 'h') {
			if(mystat=="none") {
				itemobj.style.display="";
				//document.all['content'].style.display = 'none';
			}
		} else {
			if(mystat!="none")  {
				itemobj.style.display="none";
				//document.all['content'].style.display = '';
			}
		}
	}
}
*/

function ChangeTab(tabid, tabobj)
{
  var tabseq = 1;
  var obj;
  while (obj = document.getElementById(tabobj + tabseq)) {
    if (tabseq == tabid) {
      obj.style.display = 'block';
    } else {
      obj.style.display = 'none';
    }
    tabseq++;
  }
}	

function OnInit() {
	//document.getElementById('post_text').style.fontWeight = 400;
	//document.getElementById('post_text').style.color = '#233A9B';
	//document.getElementById('post_text').value = 'ÀÚµ¿Â÷ Àü½Ã¿ëÇ° ¿ÕÃ¢¶³ÀÌ~~';
	//¿Ã Ãß¼®¢½¼±¹°Àº ¿Í½Î´Ù´åÄÄ¿¡¼­~
}

function OnChek(t) {
	if (event.keyCode == 13){
		searchform.submit;
		return true;
	} else{
		document.getElementById('post_text').style.fontWeight = 400;
		document.getElementById('post_text').style.color = '#000000';
		document.getElementById('post_text').value = '';
		return false;
	}
}

// ±â¾÷ÀºÇà¾È½ÉÀÌÃ¼ ÀÎÁõ¸¶Å© Àû¿ë ½ÃÀÛ
function onPopAuthMark(key)
{
   window.open('','AUTHMARK_POPUP','height=615, width=630, status=yes, toolbar=no, menubar=no, location=no');
   document.AUTHMARK_FORM.authmarkinfo.value = key;
   document.AUTHMARK_FORM.action='http://mybank.ibk.co.kr/ibs/jsp/guest/esc/esc1030/esc103020/CESC302020_i.jsp';
   document.AUTHMARK_FORM.target='AUTHMARK_POPUP';
   document.AUTHMARK_FORM.submit();
}
