
 function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}


function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}


function checkCookie2()
{
//username=getCookie('http://pasito.com/');
username=getCookie('PlayerInstall');
if (username!=null && username!="")
  {
  alert('pasito.com containts '+username+'!');
  }
else
  {
  username=prompt('Enter pasito.com PlayerInstall [yes/no] cookies:',"");
  if (username!=null && username!="")
    {
    setCookie('PlayerInstall',username,365);
    }
  }
}



function get_cookies_array() {

    var cookies = { };

    if (document.cookie && document.cookie != '') {
        var split = document.cookie.split(';');
        for (var i = 0; i < split.length; i++) {
            var name_value = split[i].split("=");
            name_value[0] = name_value[0].replace(/^ /, '');
            cookies[decodeURIComponent(name_value[0])] = decodeURIComponent(name_value[1]);
        }
    }

    return cookies;
   
}

//function CookiesManager() { 
//checkCookie2();
//var cookies = get_cookies_array();
//for(var name in cookies) {
//  document.write( name + " : " + cookies[name] + "<br />" );
//}

//}



function DoubleOpen(site1, site2) { 

window.open(site1); 
window.location = site2; 
} 

function checkCookiesnPlay(site1, site2) { 
( getCookie( 'PlayerInstall' ) ) ? window.location = site2: window.location = site1;
//alert(getCookie( 'PlayerInstall' ));
//( getCookie( 'PlayerInstall' ) ) ? alert(site2) : alert(site1);
 //window.location = site1;
//window.location = site2;
} 


function checkCookiesnPlay1(site2) { 
( getCookie( 'PlayerInstall' ) ) ? window.location = site2: window.location = 'play.aspx';
//alert(getCookie( 'PlayerInstall' ));
//( getCookie( 'PlayerInstall' ) ) ? alert(site2) : alert(site1);
 //window.location = site1;
//window.location = site2;
} 

