function d_setCookie(name, value) {
	var today = new Date();
	today.setDate( today.getDate() + 365 );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() +";";
}

function d_getCookie( name ) {
	var cookieName = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ) {
		var y = (x+cookieName.length);
		if ( document.cookie.substring( x, y ) == cookieName ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 ) break;
	}
	return "";
}

var shv_url = '';
var type = type;

shv_url=document.URL;

if(shv_url.charAt(shv_url.length)=='/') shv_url=shv_url.substring(0,shv_url.length-1);
if(shv_url.indexOf('://')) shv_url=shv_url.substring(shv_url.indexOf('://')+3,shv_url.length);
if(shv_url.indexOf('/')) shv_url=shv_url.substring(0,shv_url.indexOf('/'));

var time = new Date();
var year = time.getUTCFullYear();
var month = time.getUTCMonth()+1;
var day = time.getUTCDate();
var hour = time.getUTCHours();
var min = time.getUTCMinutes();
var name = "shv_time_"+escape(shv_url);
if(month < 10) month = "0"+ month;
if(day < 10) day = "0"+ day;
if(hour < 10) hour = "0"+ hour;
if(min < 10) min = "0"+ min;

var old_date = d_getCookie(name);
var wsize = window.screen.width+'x'+screen.height //ÇØ»óµµ
var shv_referrer  = document.referrer //ÀÌÀüÁ¤º¸

d_setCookie(name,year+""+month+""+day+""+hour+""+min);
d_setCookie("wsize",wsize);


if(type >0 && type <53) {
	shv_arg = "<img src=http://counter.shuvic.co.kr/shvcounterwrite.php?url="+escape(shv_url)+"&old_date="+old_date+"&type="+type+"&referrer="+escape(shv_referrer)+"&wsize="+wsize;
	shv_arg += " border=0>";
} else {
	shv_arg = "<div height='0' style='top:-1;position:absolute'><img src=http://counter.shuvic.co.kr/shvcounterwrite.php?url="+escape(shv_url)+"&old_date="+old_date+"&referrer="+escape(shv_referrer)+"&wsize="+wsize;
	shv_arg += " border=0 height=0 width=0></div>";
}

document.write("<a href=http://www.shuvic.co.kr target=_blank>"+shv_arg+"</a>");
