
function divHide(id)
{
        var obj = document.getElementById(id);
        obj.style.visibility ='';
        obj.style.display = 'none';
}

function divShow(id)
{
        var obj = document.getElementById(id);
        obj.style.visibility = 'visible';
        obj.style.display = 'block';
}

//ActiveX °ü·Ã IEÆÐÄ¡ ¼öÁ¤
function showActiveX(objhtml)
{
	document.write(objhtml);
}


// È¸¿ø·Î±×ÀÎ °ü·Ã »ó´Ü¿¡ ½ºÅ©¸³Æ® ³Ö½À´Ï´Ù. by jurisdoc 
function login_check(form) {

	if(form.log_id) {
		if (form.log_id.value == "") {
			alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
			form.log_id.focus();
			return false;
		}
	}
	if(form.log_passwd) {
		if (form.log_passwd.value == "") {
			alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
			form.log_passwd.focus();
			return false;
		}
	}

	//setCookie("login_input_id",form.log_id.value);
	return true;
}
// id,pw ÀÔ·ÂÆû ¹è°æ ±ÛÀÚ ¾ø¿¡±â Ãß°¡: 2008-07-15
function loginform_clearbg(type) {
	if (type == 1) {
		document.login_top.log_id.style.backgroundImage = '';
	} else if (type == 2) {
		document.login_top.log_passwd.style.backgroundImage = '';
	} 
}

//----------------------------------------------
// ÄíÅ°°ü·Ã ÇÔ¼ö 
//----------------------------------------------
function getCookieVal (offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1) endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}

function getCookie (name) {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) { //while open
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
         return getCookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break; 
   } //while close
   return null;
}

function setCookie(name, value) {
   var argv = setCookie.arguments;
   var argc = setCookie.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;
   document.cookie = name + "=" + escape (value) +
      ((expires == null) ? "" : 
         ("; expires=" + expires.toGMTString())) +
      ((path == null) ? "" : ("; path=" + path)) +
      ((domain == null) ? "" : ("; domain=" + domain)) +
      ((secure == true) ? "; secure" : "");
}

function setDivPopup() {
	if(getCookie("noPopup") != "yes") {
		$('divPopup').show();
	}else {
		$('divPopup').hide();
	}
}

function closePopup(type){

	switch(type) {
		case "today":
			var expiredays = 1;
			var expires = new Date(); 
			expires.setDate( expires.getDate() +  expiredays);
			expires.setHours(0,0,0,0);
			break;
		case "forever":
			var expiredays = 365;
			var expires = new Date(); 
			expires.setDate( expires.getDate() +  expiredays);
			expires.setHours(0,0,0,0);
			break;
	}
	setCookie("noPopup","yes",expires);

	$('divPopup').hide();
}


var favoriteurl="http://www.ganzimain.co.kr";
var favoritetitle="°£Áö¸ÞÀÎ";
function addfavorites(){
if (document.all) window.external.AddFavorite(favoriteurl,favoritetitle);
}


/**
* showStat ver 0.5
*@author jurisdoc
*@param string code »óÇ°ÄÚµå
*@param string type ( day : ÀÏº°, week : ÁÖº°, total :ÀüÃ¼ ) 
*@return »óÇ°ÄÚµå_stat ·Î µÈ div ¾ÈÀÇ ³»¿ëÀ» Ã¤¿ó´Ï´Ù. 
*/
function showStat(code,type) 
{
	var isDebug = true; // µð¹ö±ë ¿©ºÎ 
	var strHR = "";
	var arrVal = new Array();
	var HR = "";
	var objId = code+"_stat"; 
	var obj = document.getElementById(objId);
	var tag = "";
	var arrSite = new Array("°£Áö³ª¶ó","²Éº¸´Ù³²ÀÚ","ÄÚµð¼¼ÀÏ");
	var arrDomain = new Array("ganzinala.com","ff.co.kr","codysale.co.kr");
	var arrSitePrefix = new Array("gz","ff","cs");

	obj.innerHTML = "<table width='100%'><tr><td align='center' valign='middle'>°ªÀ» ¹Þ¾Æ¿À´Â ÁßÀÔ´Ï´Ù.</td></tr></table>";

	// ¸Þ´º º¼µå ¼³Á¤
	document.getElementById(code+'_menu_total').style.fontWeight="";
	document.getElementById(code+'_menu_week').style.fontWeight="";
	document.getElementById(code+'_menu_day').style.fontWeight="";
	document.getElementById(code+'_menu_'+type).style.fontWeight="bold";

	// °ª¹Þ¾Æ¿À±â
	if(isDebug) {
		var strParamDebug = "&d=yes";
	}

	// °ª»Ñ·ÁÁÖ±â 
	obj.innerHTML = "";
	tag +="<table width='200' cellspacing='0' cellpadding='2' style='font-size:9pt' >";
	tag +="<tr>";
	tag +="<td width='*'>Name</td>";
	tag +="<td width='20' align='center'>H</td>";
	tag +="<td width='20' align='center'>B</td>";
	tag +="<td width='20' align='center'>C</td>";
	tag +="<td width='20' align='center'>R</td>";
	tag +="</tr>";

	var totHit = 0;
	var totCart = 0; 
	var totOrder = 0; 
	var totReturn = 0; 

	for (i=0;i<arrSite.length ;i++ ){

		HR = getHttprequest("../inc/juris_get_stat.php?site="+arrDomain[i]+"&code="+code+"&type="+type+strParamDebug);

		arrVal = HR.split('|');
		totHit += parseInt(arrVal[0]);
		totCart += parseInt(arrVal[1]);
		totOrder += parseInt(arrVal[2]);
		totReturn += parseInt(arrVal[3]);

		tag +="<tr onMouseOver=\"this.style.background='#B4B4E9'\" onMouseOut=\"this.style.background='#FFFFFF'\">";
		tag +="<td width='*'>"+arrSite[i]+"</td>";
		tag +="<td width='20' align='center'>"+arrVal[0]+"</td>";
		tag +="<td width='20' align='center'>"+arrVal[2]+"</td>";
		tag +="<td width='20' align='center'>"+arrVal[1]+"</td>";
		tag +="<td width='20' align='center'>"+arrVal[3]+"</td>";
		tag +="</tr>";
	}
	tag +="<tr bgcolor='#FF9900'>";
	tag +="<td width='*'>ÃÑ°è</td>";
	tag +="<td width='20' align='center'>"+totHit+"</td>";
	tag +="<td width='20' align='center'>"+totOrder+"</td>";
	tag +="<td width='20' align='center'>"+totCart+"</td>";
	tag +="<td width='20' align='center'>"+totReturn+"</td>";
	tag +="</tr>";

	tag +="</table>";

	obj.innerHTML = tag;
	if(isDebug) {
		obj.innerHTML =tag + strHR+"<br>";
	}

}