// Begin Double Click Ad code
var axel = Math.random() + "";
var ord = axel * 1000000000000000000;
var NSLayers = ""
function writeIFad(id, width, height, tile, adSrc) {
	var adString='<nolayer>';
	adString +=	'<iframe id="adi_' + id + '" src="http://ad.doubleclick.net/adi/www.bet.com/' + adSrc +';sz=' + width + 'x' + height + ';tile=' + tile + ';ord=' + ord + '?" width="' + width + '" height="' + height + '" frameborder="0" border="0" marginwidth="0" marginheight="0" scrolling="no">';
	adString +=	'<a href="http://ad.doubleclick.net/jump/www.bet.com/' + adSrc + ';abr=!ie;target=_blank;sz=' + width + 'x' + height + ';tile=' + tile + ';ord=' + ord + '?"><img src="http://ad.doubleclick.net/ad/www.bet.com/' + adSrc + ';abr=!ie;sz=' + width + 'x' + height + ';tile=' + tile + ';ord=' + ord + '?" border=0 height="' + height + '" width="' + width + '" target="_blank"></a>';
	adString +=	'</iframe>';
	adString += '</nolayer>';
	adString += '<ilayer id="ad_' + id + '" visibility="hidden" width=' + width + ' height=' + height + '></ilayer>';
	NSLayers += '<LAYER SRC="http://ad.doubleclick.net/adl/www.bet.com/'+adSrc+' ;target=_blank;sz=' + width + 'x' + height + ';tile=' + tile + ';ord=' + ord + '?" width=' + width + ' height=60 visibility="hidden" onLoad="moveToAbsolute(ad_' + id + '.pageX,ad_' + id + '.pageY);clip.height=' + height + ';clip.width=' + width + '; visibility=\'show\';"></LAYER>';
	document.write(adString);
	//document.write(NSLayer);	
}
function writeAd(width, height, tile, adSrc) {
	jump= 'http://ad.doubleclick.net/jump/www.bet.com/' + adSrc + ';sz=' + width + 'x' + height + ';tile=' + tile + ';ord=' + ord;
	src= 'http://ad.doubleclick.net/ad/www.bet.com/' + adSrc + ';sz=' + width + 'x' + height + ';tile=' + tile + ';ord=' + ord;
	document.write('<a href="' + jump + '">');
	document.write('<img src="' + src + '" border=0' + ' height=' + height + ' width=' + width + ' ></a>');
}
// END Double Click Ad code

// for rollovers....
// drop any filenames to be cached in here
var imgsToCache = [
];

// then they get requested / cached from server
var cachedImages = [];
for(counter=0; counter<imgsToCache.length; counter++)
{
	cachedImages[counter] = new Image();
	cachedImages[counter].src = imgsToCache[counter].src;
}


// regexp : makes rollovers easy & fast
if(RegExp)
{
	var srcToX = new RegExp("(.*)_o\.gif$","i")	;
	var srcToO = new RegExp("(.*)_x\.gif$","i")	;
}

// for non-RegExp support in browsers, slower but it works fine
function switchState(str)
{
	if(str.substring(str.length-6)=="_x.gif") return (str.substring(0,str.length-6)+"_o.gif");
	else if(str.substring(str.length-6)=="_o.gif") return (str.substring(0,str.length-6)+"_x.gif");
	else return str;
}

function getXstate(imgName)
{
	if(RegExp)document.images[imgName].src = document.images[imgName].src.replace(srcToX,"$1_x.gif");
	else document.images[imgName].src = switchState(document.images[imgName].src);
}

function getOstate(imgName)
{
	if(RegExp)document.images[imgName].src = document.images[imgName].src.replace(srcToO,"$1_o.gif");
	else document.images[imgName].src = switchState(document.images[imgName].src);
}

// end rollover stuff

function submitForm(formName)
{
	document.forms[formName].submit();
}

// in case you wanna do it on the client instead of the server. called in masthead.
function todaysDate() 
{
   TDay = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
   TMonth = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
   TDate = new Date();
   CurYear = TDate.getYear();
   CurMonth = TDate.getMonth();
   CurDayOw = TDate.getDay();
   CurDay= TDate.getDate();
   returnStr = TDay[CurDayOw] + ', ';
   returnStr += TMonth[CurMonth] + ' ';
   returnStr += CurDay + ', ';
   returnStr += ((CurYear%1900)+1900);
   return returnStr;
}

//video popup
var winVideo;
function getVideo() {
	var jsMediaId = arguments[0];
	var jsVideoType = (arguments[1] == 'Music') ? arguments[1] : 'generic';
	var jsRank = (arguments[2] == null) ? '' : arguments[2];
	var sURL = "/video_player/0,," + jsMediaId + "-" + jsVideoType + "-" + jsRank +",00.html";
	
	if (winVideo == null || winVideo.closed) {
		winVideo = window.open(sURL, "winVideo", "width=484,height=356,scrollbars=no,toolbar=no,directories=no,menubar=no,resizable=no,top=0,left=0");
		//OpenWindows[OpenWindows.length]="winVideo";
		//winVideo.moveTo(0,0);
	} else {
		winVideo.location.href = sURL;
		winVideo.focus();
	}
}

function goTo() {
	location.hash = 'boardsAnchor';
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function stdWinOpen(wURL) {
	var winW = arguments[1] || 500;
	var winH = arguments[2] || 400;
	window.open(wURL, "stdWin","width="+winW+",height="+winH+",scrollbars,toolbar=no,directories=no,menubar=no,resizable");
}