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));
}

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" : "");
}

function Delete_Cookie(name,path,domain) {
    if (Get_Cookie(name)) document.cookie = name + "=" +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

var cookieval = Get_Cookie('test') ;

if (cookieval)
{
	cookieval++ ;
	Set_Cookie('test',cookieval) ;

	cookieval = Get_Cookie('test') ;
	if (cookieval == 3  || cookieval == 5 || cookieval == 7 || cookieval == 9) 
	{
		document.write('<!-- AdSpace size=1x1 affiliate=allmovieportal channel=filmtv subchannel=alsoplaying Network=affiliates rating=pg13 --><scr'+'ipt language="javascript1.1" src="http://mediamgr.ugo.com:80/js.ng/size=1x1&affiliate=allmovieportal&channel=filmtv&subchannel=alsoplaying&Network=affiliates&rating=pg13"></scr'+'ipt><!-- /AdSpace -->') ;		
	}

} else {
	cookieval = 1 ;
	Set_Cookie('test',cookieval) ;
}