/*Random Background Image */

function randombg(){

var randombgs=["images/backgrounds/1.jpg", "images/backgrounds/3.jpg", "images/backgrounds/4.jpg", "images/backgrounds/default.gif"]
$random_bg = randombgs[Math.floor(Math.random()*randombgs.length)];
document.body.background =$random_bg;
  setCookie('rumblebg',$random_bg,365);}


function changeBgImg(newBgImg) {
  setCookie('rumblebg',newBgImg,365);
  document.body.background = newBgImg;

}

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 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 checkBackgroundCookie()
{
random_bg=getCookie('rumblebg');
if (random_bg!=null && random_bg!="")
  {document.body.background = getCookie('rumblebg');}
else 
{document.body.background = "images/backgrounds/default.gif";}
}




function urlOpen (url, name)
{ 
    if ( ! name || name == "_self" || name == "_parent" )
	self.location = url;
    else
	window.open (url, name);
}

function openPlayerWin ()
{
    var win = window.open('player.php', 'player', "width=420,height=170,menubar=0,titlebar=0,toolbar=0,location=0,scrollbars=0,resizable=0,status=no");
    win.focus();
}

function preregister ()
{
    var win = window.open('signup/signup.php', 'player', "width=270,height=90,menubar=0,titlebar=0,toolbar=0,location=0,scrollbars=0,resizable=0,status=no");
    win.focus();
}

function MM_openBrWindowId(theURL,winName,features) {
  window.open(theURL+"",winName,features);
}