var host = document.location.host;
host.toLowerCase();
var temp_agent;
var wagent;

if(typeof parent.web_agent == 'undefined') {
	web_agent = "";
}

if(web_agent != "") {
	wagent = web_agent;
}
else {
	if(host.indexOf('localhost') != -1) {wagent = "TST";}
	else if(host.indexOf('daum') != -1) {wagent = "DUM";}
	else if(host.indexOf('nate') != -1) {wagent = "NAT";}
	else if(host.indexOf('patzzi') != -1) {wagent = "PAT";}
	else if(host.indexOf('winz') != -1) {wagent = "WNZ";}
	else if(host.indexOf('ciz') != -1) {wagent = "CIZ";}
	else if(host.indexOf('cyworld') != -1) {wagent = "CYW";}
	else if(host.indexOf('empas') != -1) {wagent = "EMP";}
	else if(host.indexOf('naver') != -1) {wagent = "NAV";}
	else if(host.indexOf('pregnancy') != -1) {wagent = "WEB";}
	else if(host.indexOf('birthbaby') != -1) {wagent = "BIR";}
	else if(host.indexOf('imsin4u') != -1) {wagent = "IMS";}
	else if(host.indexOf('woman1030') != -1) {wagent = "WMN";}
	else if(host.indexOf('roseday.net') != -1) {wagent = "WEB";}
	else{wagent = "OTH";}
}

if(typeof parent.page_code == 'undefined') 
{
	var page_code = "index";
}

var pos = page_code.indexOf("_");
var main_code = '';
if(pos > 0){
	main_code = page_code.substring(0,pos);
}

var c="<!-- Åë°è script ½ÃÀÛ -->";

if(wagent == "NAT"){ 

	var stat_code = '01';

	if(main_code=='event'){	// ÇÁ¸®Á¸¾È³»
		stat_code = '02';
	}else if(page_code=='my_calendar'){	// ·ÎÁîÄ¶¸°´õ
		stat_code = '09';
	}else if(page_code=='my_rose'){	// My·ÎÁîµ¥ÀÌ
		stat_code = '03';
	}else if(page_code=='happy_dic_main' || page_code=='happy_dic_view'){	// 1030±Ã±ÝÇØ
		stat_code = '05';
	}else if(main_code=='test'){	// Å×½ºÆ®Á¸
		stat_code = '04';
	}else if(page_code=='rose_mini'){	// ¸ð¹ÙÀÏÁ¸
		stat_code = '06';
	}else if(main_code=='happy'){	// ½ºÇÇµå»ó´ã½Ç
		stat_code = '07';
	}else if(main_code=='rose'){	// ·ÎÁî°í°´¼¾ÅÍ
		stat_code = '08';
	}else{
		stat_code = '01';
	}

//	c+="<img src='http://stat.nate.com/stat/stat.tiff?cp_url=[roseday.nate.com/"+stat_code+"]' width=0 height=0 border=0>";	
	c+="<img src='http://stat.nate.com/stat/stat.tiff?cp_url=[mis_ndr.nate.com/rose"+stat_code+"]' width=0 height=0 border=0>";	
} 

/*c+="<SCRIPT LANGUAGE='JavaScript'>";
c+="document.write('<img SRC=http://www.imsin4u.com/include/log/count.cgi?"+wagent+"=4=Cook_"+wagent+"=');";
c+="document.write(screen.width+'x'+screen.height);";
c+="document.write(escape(parent.document.referrer));";
c+="document.write(' width=1 height=1 border=0>');";
c+="</SCRIPT> ";
*/
/*c+="<img SRC=http://www.imsin4u.com/include/log/count.cgi?"+wagent+"=4=Cook_"+wagent+"=";
c+=screen.width+'x'+screen.height;
c+=escape(parent.document.referrer);
c+=" width=1 height=1 border=0>";
c+="<!-- Åë°è script ³¡ -->";
*/
document.write(c);

/*
//alert(wagent);

//if(wagent == "NAT" || wagent == "WMN" || wagent == "TST" || wagent == "OTH" || wagent == "WEB")
{ 

	// web_log test
	if(typeof parent.Get_Cookie == 'undefined')
	{
		function Get_Cookie(name) {
			var start = document.cookie.indexOf(name+"=");
			var len = start+name.length+1;
			if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
			if (start == -1) return null;
			var end = document.cookie.indexOf(";",len);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(len,end));
		}
	}
	if(typeof parent.Set_Cookie == 'undefined')
	{
		function Set_Cookie(name,value,expires,path,domain,secure) {
			document.cookie = name + "=" +escape(value) +
				( (expires) ? ";expires=" + expires.toGMTString() : "") +
				( (path) ? ";path=" + path : "") + 
				( (domain) ? ";domain=" + domain : "") +
				( (secure) ? ";secure" : "");
		}
	}

	var cook_id = Get_Cookie("roseday_cook_id");

	//alert(cook_id);

	if(cook_id == null)
	{

		var now = new Date();
		var today = new Date(now.getYear(),now.getMonth(),now.getDate());
		var expires = new Date(today.getTime() + 86400000);

		cook_id = String(now.getTime());

		Set_Cookie("roseday_cook_id",cook_id,expires);

		if(typeof parent.pt_code == 'undefined')
		{
			var query = location.search;
			var pos = query.indexOf('pt_code');
			if(pos >= 0)
			{
				var pos2 = query.indexOf('&',pos);
				if(pos2 != -1)
					pt_code = query.substring(pos+8,pos2);
				else
					pt_code = query.substring(pos+8);
			}
			else
				pt_code="";

		}

		if(typeof parent.a == 'undefined')
		{
			if(host.indexOf('localhost') != -1) {a = "TST";}
			else if(host.indexOf('daum') != -1) {a = "DUM";}
			else if(host.indexOf('nate') != -1) {a = "NAT";}
			else if(host.indexOf('patzzi') != -1) {a = "PAT";}
			else if(host.indexOf('winz') != -1) {a = "WNZ";}
			else if(host.indexOf('ciz') != -1) {a = "CIZ";}
			else if(host.indexOf('cyworld') != -1) {a = "CYW";}
			else if(host.indexOf('empas') != -1) {a = "EMP";}
			else if(host.indexOf('naver') != -1) {a = "NAV";}
			else if(host.indexOf('pregnancy') != -1) {a = "WEB";}
			else if(host.indexOf('birthbaby') != -1) {a = "BIR";}
			else if(host.indexOf('imsin4u') != -1) {a = "IMS";}
			else if(host.indexOf('woman1030') != -1) {a = "WMN";}
			else if(host.indexOf('roseday.net') != -1) {a = "WEB";}
			else{a = "OTH";}
		}
		if(a == "")
		{
			a = wagent;
		}

		if(typeof parent.phone == 'undefined')
		{
			phone="";
		}

		//alert(wagent+"/"+a);

		var stat_query="cook_id="+cook_id+"&wagent="+wagent+"&refer="+a+"&phone="+phone+"&pt_code="+pt_code;
		document.write("<IMG SRC='http://www.imsin4u.com/web_log/web_log.php?" + stat_query + "' BORDER=0 WIDTH=1 HEIGHT=1>");


	}


}
*/