var expDays = 1;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function bannerCookie(bannerID) {
	SetCookie ("bannerID",bannerID,exp);
	document.location.href=document.location.href;
}

function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}

function showphoto(id){
	url="/page/photoviewer/"+id;
	window.open(url, "blank_photo","toolbar=no,width=200,height=200");
}

function stream(id,quality){
	url="/page/audiovideo/"+id+"/"+quality;
	window.open(url, "blank_stream","toolbar=no,width=400,height=352");
}
function sneakPeekHTML(txt) {
    txt = unescape(txt);
    if (document.all) { txt = '<marquee scrollAmount="4">' + txt + '</marquee>' }
    else { txt = txt.slice(0,25) + '...' }
    document.getElementById('sneakPeekTxt').innerHTML= txt;
}

function get_random()
{
    var ranNum= Math.round(Math.random()*name.length);
    return ranNum;
}
function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}
