//Browser version code
var bAgent = navigator.userAgent.toLowerCase()
var NS4 = document.layers;
var NS6 = (document.getElementById && !document.all);
var IE = (bAgent.indexOf("msie") != -1) && (bAgent.indexOf("opera") == -1) && (bAgent.indexOf("omniweb") == -1);
var IE4 = (bAgent.indexOf("msie 4")!=-1 && IE);
var IE5 = (bAgent.indexOf("msie 5")!=-1 && IE);
var IE55 = (bAgent.indexOf("msie 5.5")!=-1 && IE);
var IE6 = (bAgent.indexOf("msie 6")!=-1 && IE);
var IE4UP = (IE4 || IE5 || IE6);
var IE5UP = (IE5 || IE6);
var IE55UP = (IE55 || IE6);

var MAC = (bAgent.indexOf("mac")!=-1);
var MAC_IE4 = (IE4 && MAC);
var MAC_IE51 = MAC && (bAgent.indexOf("msie") != -1) && (bAgent.indexOf("5.1b")!=-1);

var DYNAMIC = false;
var DOM1 = false;

if (NS4 || IE4UP || NS6) {
	DYNAMIC = true;
	if(NS6 || IE5 || IE6) DOM1 = true;
}

// Begin Double Click Ad code
var DartTarget = ""; //In case it goes to validate and the DartTarget has not been defined yet.
var axel = Math.random() + "";
var ord = axel * 1000000000000000000;
var adTile = 1;
var NSLayers = "";
var jsDartVars = "";
var disableDart = (readCookie('disableDart') != null) ? true : false; //default to false
var position = 1;

function getOrd() {
	return ord;
}
function toServe(adSrc) {
	if (adSrc.indexOf("serve=false")!=-1){
		return true;
	}
	else {
		return false;
	}
}

function writeIFad(id, width, height, tile, adSrc) {
	if (jsDartVars != "") {
		adSrc = adSrc + jsDartVars;
	}
	
	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" align="left" scrolling="no" style="height: ' + height + '; width: ' + width + '>';
	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=' + height + '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>');
}


function removeDcopt(){
	if (DartTarget!=null){
		DartTarget = DartTarget.replace(";dcopt=ist", "");
		//Only the first ad on the page should have this key-value pair.
	}
}

function validateDartTarget(adSrc){
	var key;
	var value;
	var re = /^\w+(;\w+=\w+)*$/;	
	var newAdSrc = adSrc;
	if (!re.test(adSrc)){
	
		var key_value_pairs = adSrc.split(";");
		var num_of_pairs = key_value_pairs.length;
		var i = 0;
		newAdSrc = "";
		while(i<num_of_pairs){
			var pair = key_value_pairs[i].split("=");
			newAdSrc += pair[0];
			if(pair.length==2){
				if(pair[1]==""){
					pair[1]="null";
				}
				pair[1] = removeIllegalChars(pair[1]);
				newAdSrc += "=";
				newAdSrc += pair[1];
			}
			if(i<num_of_pairs-1){
				newAdSrc += ";";
			}
			i++;
		}
		DartTarget = newAdSrc;  
	}
	
	
	
	return newAdSrc;
}

function removeIllegalChars(str){
	if(!IE){
		for (i = 0; i < str.length; i++){
			if(isIllegal(str[i])){
				
				str = str.replace(str[i], "");
				
			}
		}
	}
	else {
		str = removeWhiteSpaces(str);
	}
	return str;
	
}
function removeWhiteSpaces(str){
	var doneChecking = false;
	while(!doneChecking){
		doneChecking=true;
		if (str!=null && str.indexOf(" ")!=-1){	
			doneChecking = false;
			str = str.replace(" ","");
		}
	}
	return str;
}
function isIllegal(c){
	var illegalchars = [" ", "#", ",", "*", ".", "(", ")", "=", "+", "<", ">", "[", "]"];
	var i = 0;
	var illegal=false;
	
	while ((i < illegalchars.length) && !illegal){
		if(c==illegalchars[i]){
			illegal=true;
		}
		i++;
	}	
	return illegal;
}


function getADJad(id, width, height, tile, adSrc) {
	var output = '';
	if (toServe(adSrc)){
		return output;
	}
	
	adSrc=validateDartTarget(adSrc);
	
	if (jsDartVars != "") {
		adSrc = adSrc + jsDartVars;
	}
	var adS = 'www.bet.com/' + adSrc +';sz=' + width + 'x' + height + ';loc=' + position + ';tile=' + tile + ';ord=' + ord + '?';
	output += '<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/' + adS +'" ><\/SCRIPT>';
	if ((!document.images && navigator.userAgent.indexOf("Mozilla/2.") >= 0)  || navigator.userAgent.indexOf("WebTV")>= 0) {
		output += '<A HREF="http://ad.doubleclick.net/jump/' + adS +'" TARGET="_blank">';
		output += '<IMG SRC="http://ad.doubleclick.net/ad/' + adS +'" WIDTH="' + width +'" HEIGHT="' + height +'" BORDER="0" ALT=""></A>';
	}
	//output += '<NOSCRIPT><A HREF="http://ad.doubleclick.net/jump/' + adS +'" TARGET="_blank">';
	//output += '<IMG SRC="http://ad.doubleclick.net/ad/www.bet.com/' + adS +'" WIDTH="' + width +'" HEIGHT="' + height +'" BORDER="0" ALT=""></A></NOSCRIPT>'
	position++;
	if (position == 2){
		removeDcopt();//Only the first ad on the page should have dcopt=ist in the DartTarget
	}
	return (disableDart) ? "" : output;
}
function getAdUrl(width, height, tile, adSrc) {
	// final output --> "http://ad.doubleclick.net/adi/www.bet.com/bethome;sub=home;n=fatalbertvideo;sz=468x60;tile=1;ord=980974781099196500?";
	var adUrl = 'http://ad.doubleclick.net/adi/www.bet.com/' + adSrc + ';sz=' + width + 'x' + height + ';tile=' + tile + ';ord=' + ord;
	return adUrl;
}
// END Double Click Ad code

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 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,statusbar=no,resizable=yes");	
}

function simplePopup(url, width, height) {
	if(width && height){
		window.open(wURL, "stdWin","width="+width+",height="+height);
	}else{
		window.open(wURL, "stdWin");
	}
}

function getcookievalue(name){
	var temp=document.cookie+";";
	var Pos=temp.indexOf("=",temp.indexOf(name+"="));
	if (temp.indexOf(name+"=")==-1) return "";
	return temp.substring(Pos+1,temp.indexOf(";",Pos));
}

var _flashIndex = -1;		// used to make flash divs unique

// this function to replace the "getTagFlash" function
// in order to work around changes to IE due to Eolas patent
// Dependancy : getTagFlash
// update 4/29/2007 (klai) wrote an optional argument for loop. Before it was set to false always.
function writeFlash(w, h, file, version, id, wmode, vars) {
	var loop = arguments[7] || 'false'; //added klai
	//var fID = 'fdiv' + new Date().getMilliseconds();
	_flashIndex++;		// globally scoped variable
	var fID = "fdiv_" + _flashIndex;
	document.write('<div id="' + fID + '"></div>');
	var n = document.getElementById(fID); 
	n.innerHTML = getTagFlash(w,h,file,version,id,wmode,vars,loop) ;
}

function getTagFlash(w, h, file, version, id, wmode, vars, loop) {
	// may need to update version setting to handle version 7
	var fString = '';
	if (file != "") {	
	// if the filename has a querystring use & to add to it
	var qs = (file.indexOf("?")>-1) ? "&" : "?";
	var d = new Date();
	file = file + qs; 
	switch (version) {
		case 7:
			minorVersion = 19;
			break;
		case 6:
			minorVersion = 79;
			break;
		case 5:
			minorVersion = 30;
			break;
		default:
			minorVersion = 0;
	}
	fString += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ version +',0,'+ minorVersion +',0"';
	fString += 'WIDTH="'+w+'" HEIGHT="'+h+'" id="'+id+'" ALIGN="">';
	fString += '<PARAM NAME=movie VALUE="'+file+'"> <PARAM NAME=loop VALUE="'+loop+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE='+wmode+'>';
	fString += '<PARAM NAME=FlashVars VALUE="'+vars+'">';
	fString += '<EMBED src="'+file+'" loop="'+loop+'" quality="high" wmode="'+wmode+'" WIDTH="'+w+'" HEIGHT="'+h+'" NAME="'+id+'" FlashVars="'+vars+'" ALIGN=""';
	fString += 'TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
	}
	return fString;
}
//cookie functions
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function killCookie(name) {
	createCookie(name,"",-1);
}
//check to see if cookie successfully set on a page.
function cookieCheck() {
	cookieSuccess = false;
	
	cookieName="BET_Test_Cookie";
	cookieValue="A Test";
	cookieValueRet="?"

	createCookie(cookieName,cookieValue);
	cookieValueRet=readCookie(cookieName);

	cookieSuccess = (cookieValueRet!=null);
	
	killCookie(cookieName);

	return cookieSuccess;
}

// return query value or return nothing
function getQueryVar(variable) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
		  return pair[1];
		}
	}
	return "";
}
function getTagReal (w, h, file, id) {
	emfile = (file.indexOf("?") > -1) ? file+"&embed" : file+"?embed";
	var output = '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+w+'" height="'+h+'" id="'+id+'">';
	output += '<param name="SRC" value="'+file+'">';
	output += '<param name="CONTROLS" value="ImageWindow"><param name="CONSOLE" value="one"><param name="AUTOSTART" value="true">';
	output += '<embed type="audio/x-pn-realaudio-plugin" src="'+emfile+'" width="'+w+'" height="'+h+'" autostart="true" NOJAVA="true" controls="ImageWindow" CONSOLE="one"></embed></object><br>';
	output += '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+w+'" height="25" id="'+id+'C">';
	output += '<param name="CONTROLS" value="ControlPanel">';
	output += '<param name="CONSOLE" value="one">';
	output += '<embed type="audio/x-pn-realaudio-plugin" src="'+emfile+'" width="'+w+'" height="25" NOJAVA="true" CONTROLS="ControlPanel" CONSOLE="one"></embed></object>';
	return output;
}
function getTagQuicktime (w, h, file, id) {
	h += 16; // 16 pixels are added for the controls
	var output = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" width="'+w+'" height="'+h+'" id="'+id+'">';
	output += '<param name="controller" value="TRUE">';
	output += '<param name="type" value="video/quicktime">';
	output += '<param name="autoplay" value="true">';
	output += '<param name="scale" value="aspect">';
	output += '<param name="target" value="myself">';
	output += '<param name="src" value="/media/video/quicktime/dummy.mov">';
	output += '<param name="qtsrc" value="'+file+'">';
	output += '<param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html">';
	output += '<embed qtsrc="'+file+'" src="/media/video/quicktime/dummy.mov" width="'+w+'" height="'+h+'" name="'+id+'" scale="aspect" autostart="true" controller="TRUE" target="myself" bgcolor="#000000" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html"></embed></object>';
	return output;
}
// SLK: Added optional 5th argument to override full ui mode
// also made height dependant on uimode
// Made embed tag optional, 6th argument, use boolean
function getTagWins (w, h, file, id) {
	var uimode = (arguments.length > 4) ? arguments[4] : 'full';
	if (uimode == 'full' || uimode == 'mini') h += 44; // 44 pixels are added for the controls
	var embedTag = (arguments.length > 5) ? arguments[5] : true;
	var output = '<OBJECT id="'+id+'" width="'+w+'" height="'+h+'" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=9,0,0,3075" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">';
	output += '<PARAM name="URL" value="'+file+'"/><PARAM name="animationatStart" value="true"/>';
    output += '<PARAM name="transparentatStart" value="true"/><param name="ShowDisplay" value="False"><param name="AutoRewind" value="True">';
    output += '<PARAM name="autoStart" value="true">';
	output += '<PARAM name="uiMode" value="'+uimode+'"/>';
	if(embedTag) {
		output += '<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" width="'+w+'" height="'+h+'" name="'+id+'" src="'+file+'" ';
		output += 'autostart="True" showcontrols="1" showstatusbar="False" showdisplay="False" autorewind="True"></embed>';
	}
	output += '</OBJECT>';
	return output;
}
function getTagWinsUI (w, h, file, id, uimode) {
	h += 44; // 44 pixels are added for the controls
	var output = '<OBJECT id="'+id+'" width="'+w+'" height="'+h+'" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=9,0,0,3075" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">';
	output += '<PARAM name="URL" value="'+file+'"/><PARAM name="animationatStart" value="true"/>';
	output += '<PARAM name="transparentatStart" value="true"/><param name="ShowDisplay" value="False"><param name="AutoRewind" value="True">';
	output += '<PARAM name="autoStart" value="true">';
	if (uimode != "")
		output += '<PARAM name="uiMode" value="'+uimode+'"/>';
	output += '<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" width="'+w+'" height="'+h+'" name="'+id+'" src="'+file+'" ';
	output += 'autostart="True" showcontrols="True" showstatusbar="False" showdisplay="False" autorewind="True"></embed>';
	output += '</OBJECT>';
	return output;
}	
function getTagWinsOld (w, h, file, id) {
	h += 44; // 44 pixels are added for the controls
	var output = '<object width="'+w+'" height="'+h+'" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="'+id+'" type="application/x-oleobject">';
	output += '<param name="Filename" value="'+file+'"><param name="AutoStart" value="True">';
	output += '<param name="ShowControls" value="True"><param name="ShowStatusBar" value="False">';
	output += '<param name="ShowDisplay" value="False"><param name="AutoRewind" value="True">';
	output += '<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" ';
	output += 'width="'+w+'" height="'+h+'" name="'+id+'" src="'+file+'" ';
	output += 'autostart="True" showcontrols="True" showstatusbar="False" showdisplay="False" autorewind="True"></embed></object>';
	return output;
}

// Overlay Ads Code --- dependancies: gettagflash
function killOverlay() {
	overlayDiv.style.display = "none";
}

var betOverlays = new Array();


function displayOverlay(swf, w, h, t, l) {
	var tempObj = {swf:swf, w:w, h:h, t:t, l:l};
	betOverlays.push(tempObj);	
}
		
function createOverlays() {
	if (IE55UP && !MAC && betOverlays.length > 0) {
		for (i in betOverlays) {	
			o = betOverlays[i];			
			docBod = window.top.document.getElementsByTagName("body")[0];
			newDomObj = window.top.document.createElement("div");
			newDomObj.setAttribute("id","overlayDiv");
			newDomObj.style.position = "absolute";
			newDomObj.style.width = parseInt(o.w);
			newDomObj.style.height = parseInt(o.h);
			newDomObj.style.top = parseInt(o.t);
			newDomObj.style.left = parseInt(o.l);	
			var swfString = getTagFlash(o.w, o.h, o.swf, 6, 'flashOverlay', 'transparent', '');
			newDomObj.insertAdjacentHTML('beforeEnd', swfString);
			docBod.appendChild(newDomObj);
		}
	}
}

addLoadEvent(createOverlays);
//end overlay ad code

function toggleVis(name) {
	var theElement = document.getElementById(name);
	var status = theElement.style.display;
	theElement.style.display = (status == "none" || typeof(status) == "undefined") ? "block" : "none";
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
function stripHTML(s) {
	// need to remove &nbsp as well
	var re= /<\S[^>]*>/g; 
	s = s.replace(re,"");
	return s.replace(/&nbsp;/gi," ");
}
// simple search function via HTTP/GET.
function doSearch(searchParam, rbSearchType) {
	var searchTxt = searchParam;
	var searchType = "web"; // default to web
	for(var i=0;i<rbSearchType.length;++i) {
		if (rbSearchType[i].checked) { 
			searchType = (rbSearchType[i].value);
			break;
		} 
	}
	window.location.href = "http://www1.bet.com/WebApplications/betRoot/Search.aspx?searchQuery="+searchTxt+"&searchType="+searchType;
}

// simple search function via HTTP/GET without the radio buttons.
function doSearchNonRadio(searchParam, searchTypeArg) {
	var searchTxt = searchParam;
	var searchType = (searchTypeArg != "") ? searchTypeArg : "bet";
	window.location.href = "http://www1.bet.com/WebApplications/betRoot/Search.aspx?searchQuery="+searchTxt+"&searchType="+searchType;
}
//Global Variable for Flash variables
var flashvars = '';

//Home Page  - START TriStandardSmallBarker functions
function processCheckboxClick(checkBoxSelected, barkerImageId, barkerTextId, barkerTextJs ) {
	var stateChecked = eval('document.ChannelLayout.' + checkBoxSelected + '.checked');
	if ((null != document.getElementById(barkerImageId)) | ("undefined" != typeof(document.getElementById(barkerImageId))))
	{
		if (stateChecked)
			{document.getElementById(barkerImageId).style.display = "none"; 
			 document.getElementById(barkerTextId).innerText = truncate(barkerTextJs, 197);} 
		else 
			{document.getElementById(barkerImageId).style.display = "block";
			 document.getElementById(barkerTextId).innerText = truncate(barkerTextJs, 130);}			  
	}
}
function truncate(myBarkerTextJs, maxLength)
{	//assign the value to a variable
	var newString  = eval(myBarkerTextJs);
	newString = unescape(newString);
	
	if ( newString != null ) {
		if (newString.length > maxLength) {
				newString  = newString.substring(0, maxLength);
				newString =  newString + "...";
		}
	}
	return newString;
}
//Home Page  - END TriStandardSmallBarker functions

//START  - Code for rotating IFRAME ad
//Initialize the tile value to a value of '1'
var myTileValue = 1;

//Dynamically set an IFRAME's HREF from DART.  
function DynamicallySetDartAdInIFrameHeader(IFrameName, CSSPath, adWidth, adHeight) {
  
	var dartNValue = arguments[4] || ""; 
	var semiColinIndex = "";

	//If we have an n value then tweak the DART tag
	if (dartNValue != "")
	{
		var nIndex = DartTarget.indexOf("n=") + 2;	
		for(i=nIndex; i < DartTarget.length; i++)
		{

			var semicolin = DartTarget.substring(i, i+1);

			//Check each character in the DartTarget string.  If we get a semicolon we can update the DartTarget and exit.
			//If we get to the end of the DartTarget string and do not find a semicolon then we can assume there is none and
			//update the DartTarget.  For example catch either 'betawards;sub=microsite;n=default' or
			//'betawards;sub=microsite;n=default;c=r'

			if ((semicolin == ";") | (DartTarget.length == i))
			{
				DartTarget = DartTarget.substring(0,nIndex) + dartNValue + DartTarget.substring(i);
				break;
			}	
		}
	}
  
	//Get a new ord value so that DART targets the request as unique and the target works properly  
    	axel = Math.random() + "";
	ord = axel * 1000000000000000000;
 	
    	//Get a complete URL for the IFRAME.  Set the IFRAME's background color to the same as it's parent
	DartCompleteURL = '/WebApplications/betRoot/AdPopup.aspx?id=' + IFrameName + '&width=' + adWidth + '&height=' + adHeight + '&adPage='+DartTarget+'&includecss=' + CSSPath;
	
	//netscape?
	var isNetscape = (bAgent.match(/netscape/) == 'netscape');
	
	//Set the IFRAME's URL -- if netscape, use legacy frame referencing, otherwise, reference by getting the document's element object.
	if(isNetscape)
		frames[IFrameName].location.href = DartCompleteURL;
	else
		document.getElementById(IFrameName).src = DartCompleteURL;

}
//END  - Code for rotating IFRAME ad

//START  - BK 7-3-07  Should be implemented in Admin Definitions in the near future
adHackJulyThird07();

function adHackJulyThird07()
{
	if (
		(this.location == 'http://www1.bet.com/BETShows/HGM_AboutTheShow.htm') |
		(this.location == 'http://www1.bet.com/BETShows/sobabouttheshow.htm?') |
		(this.location == 'http://www1.bet.com/BETShows/sobabouttheshow.htm') |	
		(this.location == 'http://www1.bet.com/BETShows/sobabouttheshow.htm?wbc_purpose=Basic&WBCMODE=PresentationUnpublished') |
		(this.location == 'http://www1.bet.com/julyjumpoff.htm?wbc_purpose=Basic&WBCMODE=PresentationUnpublished&Referrer=%7B7B0DBA9C-903A-4BD3-AF56-3DD799DAEB41%7D') |
		(this.location == 'http://www1.bet.com/julyjumpoff.htm?') |
		(this.location == 'http://www1.bet.com/julyjumpoff.htm') 
	    )
	{
		disableDart = true;
	}
}
//END  - BK 7-3-07  Should be implemented in Admin Definitions in the near future

var cookieName = "userVideoData";
if (readCookie(cookieName) == null) {
   createCookie(cookieName, true);
}
var isPlaying = readCookie(cookieName);



//START - Fix to add close button option to interstitial ads
function closeFlashInterstitialDiv()
{
    if(jQuery('#FlashInterstitialDiv.closebuttonreq') == null)
    {
        setTimeout("closeFlashInterstitialDiv()", 2000);
        return;
    }

    jQuery('#FlashInterstitialDiv.closebuttonreq').css("top", "20px");

    jQuery('#FlashInterstitialDiv.closebuttonreq').children().each(function(){
        if(jQuery(this).is('object'))
        {
            var closer = '<div style="color: white;margin-left: 433px; position: relative; top: 14px; z-index: 10100; cursor: pointer;" onclick="this.parentNode.innerHTML=\'\';">[X]</div>';

            jQuery(this).before(closer);
        }
    });


}

setTimeout("closeFlashInterstitialDiv()", 2000);
//END - Fix to add close button option to interstitial ads


