function doSearch(searchVal,searchName) {
	if (searchVal != '') {
		window.location.href = "Search.aspx?"+ searchName + "=" + searchVal;
	}
}

function DetectFlash() {
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ? 
    	navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0); 
	if ((navigator.appName == "Microsoft Internet Explorer" &&
   		navigator.appVersion.indexOf("Mac") == -1 && navigator.appVersion.indexOf("3.1") == -1) || 
   		(plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4)) {
		// if Flash v4 (or greater) is present...
		var flashplug = 1;
	} else {
		// if Flash v4 (or greater) is NOT present...
		var flashplug = 0;
	};
	
	return flashplug;
};

if (DetectFlash()) {
	introff = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="282" height="168"><param name=movie value="/images/flash/yh_feature.swf"><param name=quality value=high>';
	introff += '<embed src="/images/flash/yh_feature.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="282" height="168"></embed></object>';			

	upff = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="77" height="40"><param name=movie value="/images/flash/tn_musicupload.swf"><param name=quality value=high>';
	upff += '<embed src="/images/flash/tn_musicupload.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="77" height="40"></embed></object>';			

} else {
	intro_linkstring = '/images/layout/hp_flash_area2.gif'
	up_linkstring = '/images/layout/g_chart.gif'
	
	re = new RegExp("%27", "g")
	repstrng = "\'"
	intro_linkstring = intro_linkstring.replace(re, repstrng)
	up_linkstring = up_linkstring.replace(re, repstrng)
	
	introhpff = '<a href="' + intro_linkstring + '"><img src="" width="282" height="168" alt="" border="0" align="top"></a>';
	uphpff = '<a href="' + up_linkstring + '"><img src="" width="77" height="40" alt="" border="0" align="top"></a>';
}

//additions..
var dbKeyword = 'music/yaheard';
//end additions..

// Begin Double Click Ad code
var axel = Math.random() + "";
var ord = axel * 1000000000000000000;
var NSLayers = ""
var adTile = 0
var jsDartVars = "";
function writeIFad(id, width, height, tile, adSrc, NSx, NSy) {
	NSx = (NSx == "undefined" || NSx == "") ? 'ad_' + id + '.pageX' : NSx
	NSy = (NSy == "undefined" || NSy == "") ? 'ad_' + id + '.pageY' : NSy
	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;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="_new"></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/;sz=' + width + 'x' + height + ';tile=' + tile + ';ord=' + ord + '?" width=' + width + ' height=60 visibility="hidden" onLoad="moveToAbsolute(' + NSx+ ',' + NSy + ');clip.height=' + height + ';clip.width=' + width + '; visibility=\'show\';"></LAYER>';
	document.write(adString);
	//document.write(NSLayers);	
}
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 getADJad(id, width, height, tile, adSrc) {
	var output = '';
	if (jsDartVars != "") {
		adSrc = adSrc + jsDartVars;
	}
	var adS = 'www.bet.com/' + adSrc +';sz=' + width + 'x' + height + ';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>'
	return output;
}
// END Double Click Ad code

//misc code
function getQueryString(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 false;
}
function readCookie(name, NS_outputElement, IE_outputElement) {
  if(document.cookie != '') {
    var actualValue, outputElement, firstChar, lastChar;
    var theBigCookie = document.cookie;
    firstChar = theBigCookie.indexOf(name);
    if(firstChar != -1) {
      firstChar += name.length + 1;
      lastChar = theBigCookie.indexOf(';', firstChar);
      if(lastChar == -1) lastChar = theBigCookie.length;
      actualValue = theBigCookie.substring(firstChar, lastChar);
    } else {
      actualValue = false;
    }
  } else {
 	actualValue = "";
  }
  return actualValue;
}