
function FreeViral(userid) {
	setMemberPop();
	window.onerror=null;
	browserName = navigator.appName;
	browserVer = parseInt(navigator.appVersion);
	if(browserName=="Microsoft Internet Explorer") {
		var winwidth = (screen.width - 0);
		var winheight = (screen.height - 25);
		open("http://www.freeviral.com/?r="+userid,"FreeViral","width=" + winwidth + ",height=" + winheight + ",toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,top=0,left=0");
		window.focus();
	} 
	else {
		var winwidth = (screen.width - 10);
		var winheight = (screen.height - 200);
		// open("http://www.freeviral.com/?r="+userid,"FreeViral","width=" + winwidth + ",height=" + winheight + ",toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,top=0,left=0");
		open("http://www.freeviral.com/?r="+userid,"FreeViral","width=" + winwidth + ",height=" + winheight + ",toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,top=0,left=0");
		window.focus();
	}   
}

function zzFreeViral(userid) {
	open("http://www.freeviral.com/?r="+userid,"","width=" + screen.width + ",height=" + screen.height + ",toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,top=0,left=0");
	window.focus();
}

function zFreeViral(userid) {
// var userid = "6393" ; 
open("http://www.freeviral.com/?r="+userid,"","width=" + screen.width + ",height=" + screen.height + ",toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,top=0,left=0,marginwidth=0,marginheight=0");
window.focus();
}

function setMemberPop() { 
	var cvalue="memberpop";
	var expDays = 364; 
	var exp = new Date(); 
	exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
	// alert("setting cookie: memberpop");
	SetCookie("memberpop",cvalue,exp);
	// SetCookie("memberpop",cvalue,null);
}

function unsetMemberPop() {
	// alert("nuking cookie: memberpop");
	SetCookie("memberpop",null,null);
}

function SetCookie(name, value, expire) {
	// var expire=""; 
	// alert("expires = " + expire.toGMTString() );
	// alert("i am innn here");
	document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) 
}

function GetCookie (name) { 
	var arg = name + "="; 
	var alen = arg.length; 
	var clen = document.cookie.length; 
	var i = 0; 
	while (i < clen) { 
		var j = i + alen; 
		if (document.cookie.substring(i, j) == arg) return GetCookieVal (j); 
		i = document.cookie.indexOf(" ", i) + 1; 
		if (i == 0) break; 
	} 
	return null;
}

function GetCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
