var
	_cenz		= 0,
	_popunder	= 0;

	if (window!= top) top.location.href=location.href;
	document.cookie = "screen_width=" + screen.width;
	
	
function click() {
	var nc = parseInt(getCookie('num_click'));
	if ((_popunder)&&(nc==1)) clickunder('http://www.dofiga.net/?popunder='+_cenz);
	nc++;setCookie('num_click',nc);
}

function clickunder(url){
	var
		param = 'menubar=yes,toolbar=yes,location=yes,directories=yes,status=yes,resizable=yes,scrollbars=yes';
	window.open(url,'',param);
}

function getCookie(name) {
	var matches = document.cookie.match(new RegExp("(?:^|; )" +
		name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"))
	return matches ? decodeURIComponent(matches[1]) : undefined
}

function setCookie(c_name,value,exdays) {
    var exdate=new Date();
    exdate.setDate(exdate.getDate() + exdays);
    var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
    document.cookie=c_name + "=" + c_value;
}

function deleteCookie(name) {
	document.cookie=name+"='';expires=-1;";
}

function add_smile(smile) {
	var fm = top.document.forms['comments'];
	fm.comment.value = fm.comment.value+smile+' ';
}

