//STYLESHEET CHECK
		var mac = navigator.appVersion.indexOf("Mac")>-1
		var opera = navigator.userAgent.indexOf("Opera")>-1
		

//BROWSER DETECT	
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{	// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 	// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

document.cookie='BrowserOS=' + BrowserDetect.OS + ';domain=buy.com;path=/';
document.cookie='BrowserClient=' +BrowserDetect.browser + ';domain=buy.com;path=/';



//THIS IS FOR THE COMPRA.COM STUFF
function systranURL(url) { 
	return url; 
} 


//THIS IS FOR FLASH DETECTION.THIS MUST APPEAR BELOW THE CODE IN HEADER
// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		flashVer = -1;
	}
	return flashVer;
}
// If called with no parameters this function returns a floating point value
// which should be the version of the Flash Player or 0.0
// ex: Flash Player 7r14 returns 7.14
// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
 	//reqVer = parseFloat(reqMajorVer + "." + reqMinorVer + "." + reqRevision);
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version
	for (i=25;i>0;i--) {
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);
		}
		if (versionStr == -1 ) {
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];

			//versionString     = versionMajor + "." + versionMinor + "." + versionRevision;   // 7.0r24 == 7.0.24
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
						//alert("Lemme esplain ... \n 1. JavaScript starts by saying you have Flash " + versionStr + " \n 2. There are required Major (" + reqMajorVer + "), Minor (" + reqMinorVer + ") and Revision (" + versionRevision + ") of Flash \n\n You seem to have:\n - Major= " + versionMajor + "\n - Minor= " + versionMinor + "\n - Revision= " +  versionRevision + "\n\n This prompt, A2, the FP_DetectKit says: versionMajor (" + versionMajor + ") > reqMajorVer (" + reqMajorVer + ") && versionNum (" + versionNum + ") >= reqVer (" + reqVer + "), " + ((versionNum >= reqVer) ? "says it is." : "but says no."));
						return true;
				//	}
				//}
			} else {
						//alert("Lemme esplain ... \n 1. JavaScript starts by saying you have Flash " + versionStr + " \n 2. There are required Major (" + reqMajorVer + "), Minor (" + reqMinorVer + ") and Revision (" + reqRevision + ") of Flash \n\n You seem to have:\n - Major= " + versionMajor + "\n - Minor= " + versionMinor + "\n - Revision= " +  versionRevision + "\n\n This prompt, B2, my FP_DetectKit checked if: versionMajor (" + versionMajor + ") > reqMajorVer (" + reqMajorVer + ") && versionNum (" + versionNum + ") >= reqVer (" + reqVer + ")" + ((versionNum >= reqVer) ? "" : ", but it doesn't") + ", and now it checks if versionMajor (" + versionMajor + ") >= reqMajorVer (" + reqMajorVer + ") && versionMinor (" + versionMinor + ") >= reqMinorVer (" + reqMinorVer + "), " + ((versionMajor >= reqMajorVer && versionMinor >= reqMinorVer) ? " which is true, so we check versionMinor >= reqMinorVer || versionNum >= reqVer, " + ((versionMinor >= reqMinorVer || versionNum >= reqVer) ? " which is also true" : "which is false") : " which is false."));
				//return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );

				// Check Major version:
				if (versionMajor > reqMajorVer) { // If newer Major entirely, it passes.
					return true;
				} else if (versionMajor == reqMajorVer) { // If required Major version...
					// Check Minor version:
					if (versionMinor > reqMinorVer){ // If newer Minor entirely, it passes.
						return true;
					} else if (versionMinor == reqMinorVer){ // If required Major version...
						// Check revision:
						if (versionRevision >= reqRevision){ // If required or higher Revision version, it passes.
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
				} else {
					return false;
				}
			}
		}
	}
	return (reqVer ? false : 0.0);
}


//NETSAGE_ IT ISN"T USED BUT NOT ALL CODE HAS BEEN REMOVED SO IT IS SET TO FALSE
		//document.write (navigator.appName + '###' + navigator.userAgent)
		//document.write("The value of navigator.appCodeName is " + navigator.appName)
	var displaySage = false
	var mac = navigator.appVersion.indexOf("Mac")>-1
	var loc = window.location
	if (navigator.userAgent.indexOf("Netscape6/6.1") != -1)  {
    displaySage = false
	}

//NS RESIZE BUG FIX
	 if(!window.saveInnerWidth) {
       window.onresize = resizeIt;
       window.saveInnerWidth = window.innerWidth;
       window.saveInnerHeight = window.innerHeight;
     }

     function resizeIt() {
         if (saveInnerWidth < window.innerWidth || 
             saveInnerWidth > window.innerWidth || 
             saveInnerHeight > window.innerHeight || 
             saveInnerHeight < window.innerHeight ) 
         {
             window.history.go(0);
         }
     }

    function getCookieVal (offset) {
    	var endstr = document.cookie.indexOf (";", offset);
    	if (endstr == -1)
    		endstr = document.cookie.length;
    		return unescape(document.cookie.substring(offset, endstr));
	}

    function GetCookie (name) {
    	var arg = name + "=";
    	var alen = arg.length;
    	var clen = document.cookie.length;
    	var i = 0;
    	while (i < clen) {
    		var j = i + alen;
    	    if (document.cookie.substring(i, j) == arg)
    	    	return getCookieVal (j);
    	    	i = document.cookie.indexOf(" ", i) + 1;
    		    if (i == 0) break; 
    		}
    		if (name == "basket") {
    	  		return "Basket Empty";
    		} else {
    			return "null";
    		}
    }

       function setCookie() {
    		}

			


//IE5+ REQUIRES, NETSCAPE, MACS AND OPERA NOT SUPPORTED
if(mac){
	musicLink = false;
		document.cookie = "macuser=mac;";
	}
else if (navigator.appName == "Netscape" || (navigator.userAgent.indexOf('Opera',0) != -1)) {
	musicLink = false;
	document.cookie = "browser=netscape;";
} else {
	musicLink = true;
}


//RANDOM IMAGES FOR HOMEPAGE AND TOP RIGHT
 
 rnd.today=new Date();
 rnd.seed=rnd.today.getTime();
 function rnd() {
         rnd.seed = (rnd.seed*9301+49297) % 233280;
         return rnd.seed/(233280.0);
 };
 function rand(number) {
         return Math.ceil(rnd()*number);
 };
 

//LENMAR CONFIGURATOR

var childWnd;
function openBC(varSettings)
{
childWnd = open('http://www.lenmar.com/bc/configurator.asp?settings=' +
varSettings,'childWindow','toolbar=no,scrollbars=yes,resizable=no,width=570,height=600,top=120,left=150')
if (childWnd.opener == null) childWnd.opener = self;
}

// variable set to get the affiliate cookie
var AffTrack = GetCookie("AdTrack");


//get the querystring into a global var
var url = new String(window.location);
var qs = "";
if(url.indexOf("?") != -1)
	qs = url.substring(url.indexOf("?")+1);
	
function getQueryStringValue(name)
{
	var indexOfName = qs.indexOf(name + "=");
	if(indexOfName != -1)
	{
		var endPos = qs.indexOf("&",indexOfName);
		if(endPos != -1)
			return qs.substring(indexOfName + name.length + 1, endPos);
		else
			return qs.substring(indexOfName + name.length + 1, qs.length);
	}
	else
	{
		return null;
	}
}


function show(object) {
  if (document.getElementById) {
    document.getElementById(object).style.visibility = 'visible';
  }
  else if (document.layers && document.layers[object]) {
    document.layers[object].visibility = 'visible';
  }
  else if (document.all) {
    document.all[object].style.visibility = 'visible';
  }
}

function hide(object) {
  if (document.getElementById) {
    document.getElementById(object).style.visibility = 'hidden';
  }
  else if (document.layers && document.layers[object]) {
    document.layers[object].visibility = 'hidden';
  }
  else if (document.all) {
    document.all[object].style.visibility = 'hidden';
  }
}

function showDynamicContent(element){
	var showDynContent = 1;
	var dynContentCookie = GetCookie(element);
	if(dynContentCookie != "null")
	{
		if(dynContentCookie == "1")
		{
			showDynContent = 1;
		}else{
			showDynContent = 0;
		}
	}
	return showDynContent;
}

var prodZoomCookie = showDynamicContent("ShowProdZoom");

function setProdZoomCookie(show){
	var exdate=new Date();
	exdate.setTime(exdate.getTime() + (1000 * 60 * 60 * 24 * 30 ));
	var showProdZoomEl = document.getElementById("showProdZoom");
	if(show != 2)
	{
		if(show == 0){
			document.cookie= "ShowProdZoom=0;expires="+exdate.toGMTString() + ";path=/";
			if(showProdZoomEl)
				showProdZoomEl.innerHTML = '<a href=\"javascript:void(0);\" onclick=\"setProdZoomCookie(1);\"><img src=\"http://ak.buy.com/buy_assets/buttons/2006/btn_zoom_off.gif\" border=\"0\" alt=\"click to turn product zoom on\" title=\"click to turn product zoom on\"></a>';
		}else if(show == 1){
			document.cookie= "ShowProdZoom=1;expires="+exdate.toGMTString() + ";path=/";
			if(showProdZoomEl)
				showProdZoomEl.innerHTML = '<a href=\"javascript:void(0);\" onclick=\"setProdZoomCookie(0);\"><img src=\"http://ak.buy.com/buy_assets/buttons/2006/btn_zoom_on.gif\" border=\"0\" alt=\"click to turn product zoom off\" title=\"click to turn product zoom off\"></a>';
		}
	}else{
		document.cookie= "ShowProdZoom=1;expires="+exdate.toGMTString() + ";path=/";
	}

	prodZoomCookie = show;
}

function setProdInfoRolloverCookie(show){
	var exdate=new Date();
	exdate.setTime(exdate.getTime() + (1000 * 60 * 60 * 24 * 30 ));
	var showProdInfoRolloverEl = document.getElementById("showProdInfoRollover");
	if(show != 2)
	{
		if(show == 0){
			document.cookie= "ShowProdInfoRollover=0;expires="+exdate.toGMTString() + ";path=/";
			if(showProdInfoRolloverEl)
				showProdInfoRolloverEl.innerHTML = '<span style=\"font-size:10px;\">Product Rollover: <a href=\"javascript:void(0);\" onclick=\"setProdInfoRolloverCookie(1);\">off</a></span>';
		}else if(show == 1){
			document.cookie= "ShowProdInfoRollover=1;expires="+exdate.toGMTString() + ";path=/";
			if(showProdInfoRolloverEl)
				showProdInfoRolloverEl.innerHTML = '<span style=\"font-size:10px;\">Product Rollover: <a href=\"javascript:void(0);\" onclick=\"setProdInfoRolloverCookie(0);\">on</a></span>';
		}
		window.location.href=window.location.href;
	}else{
		document.cookie= "ShowProdInfoRollover=1;expires="+exdate.toGMTString() + ";path=/";
	}
}

function getProductData(sku,grpID,insert,count) {
	
	if(prodZoomCookie == "1")
	{
		hideProductDataDiv('',grpID,count);
		if(document.getElementById('pdHover_'+grpID+'_'+insert).value == sku && document.getElementById('pdInsert_'+grpID+'_'+insert).innerHTML.length > 0){		
			document.getElementById('pdInsert_'+grpID+'_'+insert).style.visibility = "visible";	
		}else{		
			document.getElementById('pdHover_'+grpID+'_'+insert).value = sku;
			var url = '/retail/product_ajax_postFile.asp?sku='+sku+'&grpID='+grpID+'&itemID='+insert+'&count='+count
			
			if(window.XMLHttpRequest) {
    			try {
					req = new XMLHttpRequest();
				} catch(e) {
					req = false;
				}
			// branch for IE/Windows ActiveX version
			} else if(window.ActiveXObject) {
       			try {
        			req = new ActiveXObject("Msxml2.XMLHTTP");
      			} catch(e) {
        			try {
          				req = new ActiveXObject("Microsoft.XMLHTTP");
        			} catch(e) {
          				req = false;
        			}
				}
			}
			
			if(req) {
				//req.onreadystatechange = processRequest;
				req.onreadystatechange = function() {
					if (req.readyState == 4) {
						if (req.status == 200) {		
							document.getElementById('pdInsert_'+grpID+'_'+insert).style.visibility = "visible";
							document.getElementById('pdInsert_'+grpID+'_'+insert).innerHTML = req.responseText; 
							//setGrouperPlayerStyle('pdInsert_'+grpID+'_'+insert);
						} else {
						}
					}
				};
				req.open("GET", url, true);
				req.send(null);
			}
			
		}
	}   
}

function getProductDataBuyTV(sku,grpID,insert,count) {
	
	if(document.getElementById('pdHover_'+grpID+'_'+insert).value == sku && document.getElementById('pdInsert_'+grpID+'_'+insert).innerHTML.length > 0){		
		document.getElementById('pdInsert_'+grpID+'_'+insert).style.visibility = "visible";	
	}else{		
		document.getElementById('pdHover_'+grpID+'_'+insert).value = sku;
		var url = '/buytv/buytv_ajax_productdata.asp?sku='+sku+'&grpID='+grpID+'&itemID='+insert+'&count='+count
		
		if(window.XMLHttpRequest) {
    		try {
				req = new XMLHttpRequest();
			} catch(e) {
				req = false;
			}
		// branch for IE/Windows ActiveX version
		} else if(window.ActiveXObject) {
       		try {
        		req = new ActiveXObject("Msxml2.XMLHTTP");
      		} catch(e) {
        		try {
          			req = new ActiveXObject("Microsoft.XMLHTTP");
        		} catch(e) {
          			req = false;
        		}
			}
		}
		
		if(req) {
			//req.onreadystatechange = processRequest;
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					if (req.status == 200) {		
						document.getElementById('pdInsert_'+grpID+'_'+insert).style.visibility = "visible";
						document.getElementById('pdInsert_'+grpID+'_'+insert).innerHTML = req.responseText; 
						//setGrouperPlayerStyle('pdInsert_'+grpID+'_'+insert);
					} else {
					}
				}
			};
			req.open("GET", url, true);
			req.send(null);
		}
		
	}
}

function doNotClose(e,element,grpid,count)
{
	//make sure event was not fired from child element
	var toElement = e.relatedTarget || e.toElement;
	while(toElement && toElement != element && toElement.nodeName != 'BODY')
	toElement = toElement.parentNode;
	if(toElement == element)
	return;
	//otherwise
	var elementToClose = element;
	if(count == 0)
	{
		elementToClose = element.parentNode.id;
	}	
	hideProductDataDiv(elementToClose,grpid,count);
}

function hideProductDataDiv(element,grpid,count){
	//alert(element);
	if(document.getElementById(element) != null){
		document.getElementById(element).style.visibility = "hidden";
		document.getElementById(element).innerHTML = "";
	}
	if(count > 0){
		for (var x = 0; x <= count; x++){
			if(document.getElementById('pdInsert_'+grpid+'_'+x) != null){
				document.getElementById('pdInsert_'+grpid+'_'+x).style.visibility = "hidden";
				document.getElementById('pdInsert_'+grpid+'_'+x).innerHTML = "";
			}
		}
	}
}

function StartFakeBTVMovie(element,strBuyTVFLV)
{
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		if(document.getElementById(element) != null) {
			document.getElementById(element).innerHTML = '<embed name="buytvmovie" src="/buytv/clips/buyTVClips_nv.swf" loop="false" menu="false" wmode="transparent" quality="high" bgcolor="#268CD3"'
				+ 'width="350" height="237" name="buytvmovie" align="left" '
				+ 'play="true" '
				+ 'loop="false" '
				+ 'quality="high" '
				+ 'allowScriptAccess="always" '
				+ 'type="application/x-shockwave-flash" '
				+ 'swLiveConnect="true" '
				+ 'FlashVars="firstClip='+strBuyTVFLV+'" '
				+ ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
				+ '<\/embed>';
		
		}   // embed the flash movie
		
	} else {  // flash is too old or we can't detect the plugin
		if(document.getElementById('prodImgTab_2') != null){
			document.getElementById('prodImgTab_2').style.display = "none";
		// insert non-flash content
			if(document.getElementById('prodImgSec_2') != null){
				document.getElementById('prodImgSec_2').style.display = "none";
			// insert non-flash content
			}
			showTabContent('prodImgTab',1,'prodImgSec',1);
		}
	}
}
function StartBTVMovie(element, strBuyTVFLV)
{
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		if(document.getElementById(element) != null) {
			document.getElementById(element).innerHTML = '<embed name="buytvmovie" src="/buytv/clips/buyTVClips.swf" loop="false" menu="false" wmode="transparent" quality="high" bgcolor="#268CD3"'
				+ 'width="350" height="237" name="buytvmovie" align="left" '
				+ 'play="true" '
				+ 'loop="false" '
				+ 'quality="high" '
				+ 'allowScriptAccess="always" '
				+ 'type="application/x-shockwave-flash" '
				+ 'swLiveConnect="true" '
				+ 'FlashVars="firstClip='+strBuyTVFLV+'" '
				+ ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
				+ '<\/embed>';
			if(document.getElementById("buyTVEmbedLink") != null) {	
				document.getElementById("buyTVEmbedLink").innerHTML = "&nbsp;";
			}
				
		}   // embed the flash movie
	} else {  // flash is too old or we can't detect the plugin
		document.getElementById(element).innerHtml = '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"><img src="http://ak.buy.com/buy_assets/buytv/flash7needed_product.jpg" alt="Requires Flash 7 or Higher" border="0" /></a>';
		// insert non-flash content
	}
}
function StopBTVMovie(element,sBuyTVFLV)
{
	if (document.getElementById(element) != null) {
		document.getElementById(element).innerHTML = '<img src="http://ak.buy.com/buy_assets/v6/img/clear.gif" width="1" height="1" border="0" onload="StartBTVMovie(\''+element+'\',\''+sBuyTVFLV+'\');">';
	}
}

function StartFakeSpotlight(element,strBuyTVFLV)
{
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		if(document.getElementById(element) != null) {
			document.getElementById(element).innerHTML = '<embed name="spotlight" src="/retail/flash/spotlight_nv.swf" loop="false" menu="false" wmode="transparent" quality="high" bgcolor="#268CD3"'
				+ 'width="350" height="230" name="spotlight" align="left" '
				+ 'play="true" '
				+ 'loop="false" '
				+ 'quality="high" '
				+ 'allowScriptAccess="always" '
				+ 'type="application/x-shockwave-flash" '
				+ 'swLiveConnect="true" '
				+ 'FlashVars="clips='+strBuyTVFLV+'" '
				+ ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
				+ '<\/embed>';
		
		}   // embed the flash movie
		
	} else {  // flash is too old or we can't detect the plugin
		if(document.getElementById('prodImgTab_2') != null){
			document.getElementById('prodImgTab_2').style.display = "none";
		// insert non-flash content
			if(document.getElementById('prodImgSec_2') != null){
				document.getElementById('prodImgSec_2').style.display = "none";
			// insert non-flash content
			}
			showTabContent('prodImgTab',1,'prodImgSec',1);
		}
	}
}





function PlayOrStopMovieElements(element, flvName, swfName, height, width, startMovie, volume)
{
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	var strFlashVar = "";
	if(swfName == 'expotvProduct'){
		strFlashVar = "clips=reviews/";
	}else{
		strFlashVar = "clips=";
	}
	if(hasRightVersion) {  // if we've detected an acceptable version
		if(startMovie == 1){	
			//alert(element+','+flvName+','+swfName+','+height+','+width+','+startMovie+','+volume);
			if(document.getElementById(element) != null) {
				document.getElementById(element).innerHTML = '<embed name="'+swfName+'" src="/retail/flash/players/'+swfName+'.swf" loop="false" menu="false" wmode="transparent" quality="high" bgcolor="#268CD3"'
					+ 'width="'+width+'" height="'+height+'" align="left" '
					+ 'play="true" '
					+ 'loop="false" '
					+ 'quality="high" '
					+ 'allowScriptAccess="always" '
					+ 'type="application/x-shockwave-flash" '
					+ 'swLiveConnect="true" '
					+ 'FlashVars="'+strFlashVar+flvName+'&clipVolume='+volume+'" '
					+ ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
					+ '<\/embed>';
				if(document.getElementById("buyTVEmbedLink") != null && volume == "50") {	
					document.getElementById("buyTVEmbedLink").innerHTML = "&nbsp;";
				}
					
			}
		}else{ //startMovie == 0, so stop the movie
			if (document.getElementById(element) != null) {
				if(swfName == 'grouper'){
					document.getElementById(element).innerHTML = flvName; //flvName is the full embed for grouper.
				}else{
					document.getElementById(element).innerHTML = '<img src="http://ak.buy.com/buy_assets/v6/img/clear.gif" width="1" height="1" border="0" onload="PlayOrStopMovieElements(\''+element+'\',\''+flvName+'\',\''+swfName+'\',\''+height+'\',\''+width+'\',1,\''+volume+'\');">';
				}
			}
		}
	} else {  // flash is too old or we can't detect the plugin
		if(volume == "0"){ //get rid of the no volume starup movie
			if(document.getElementById('prodImgTab_2') != null){
				document.getElementById('prodImgTab_2').style.display = "none";
				if(document.getElementById('prodImgSec_2') != null){
					document.getElementById('prodImgSec_2').style.display = "none";
				}
				showTabContent('prodImgTab',1,'prodImgSec',1);
			}
		}else{
			document.getElementById(element).innerHtml = '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"><img src="http://ak.buy.com/buy_assets/buytv/flash7needed_product.jpg" alt="Requires Flash 7 or Higher" border="0" /></a>';
		}
	}
}







function StartBTVSpotlight(element, strBuyTVFLV)
{
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		if(document.getElementById(element) != null) {
			document.getElementById(element).innerHTML = '<embed name="spotlight" src="/retail/flash/spotlight.swf" loop="false" menu="false" wmode="transparent" quality="high" bgcolor="#268CD3"'
				+ 'width="350" height="230" name="spotlight" align="left" '
				+ 'play="true" '
				+ 'loop="false" '
				+ 'quality="high" '
				+ 'allowScriptAccess="always" '
				+ 'type="application/x-shockwave-flash" '
				+ 'swLiveConnect="true" '
				+ 'FlashVars="clips='+strBuyTVFLV+'" '
				+ ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
				+ '<\/embed>';
			if(document.getElementById("buyTVEmbedLink") != null) {	
				document.getElementById("buyTVEmbedLink").innerHTML = "&nbsp;";
			}
				
		}   // embed the flash movie
	} else {  // flash is too old or we can't detect the plugin
		document.getElementById(element).innerHtml = '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"><img src="http://ak.buy.com/buy_assets/buytv/flash7needed_product.jpg" alt="Requires Flash 7 or Higher" border="0" /></a>';
		// insert non-flash content
	}
}
function StopBTVSpotlight(element,sBuyTVFLV)
{
	if (document.getElementById(element) != null) {
		document.getElementById(element).innerHTML = '<img src="http://ak.buy.com/buy_assets/v6/img/clear.gif" width="1" height="1" border="0" onload="StartBTVSpotlight(\''+element+'\',\''+sBuyTVFLV+'\');">';
	}
}


function StopGrouperMovie(element,embed)
{
	if (document.getElementById(element) != null) {
		document.getElementById(element).innerHTML = embed;
	}
}
function StartExpoTvMovie(element,strExpoTVFlv)
{
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		if(document.getElementById(element) != null) {
			document.getElementById(element).innerHTML = '<embed name="expotvmovie" src="/retail/flash/video_product_ll.swf" loop="false" menu="false" wmode="transparent" quality="high" bgcolor="#268CD3"'
				+ 'width="330" height="280" name="expotvmovie" align="left" '
				+ 'play="true" '
				+ 'loop="false" '
				+ 'quality="high" '
				+ 'allowScriptAccess="always" '
				+ 'type="application/x-shockwave-flash" '
				+ 'swLiveConnect="true" '
				+ 'FlashVars="clips=reviews/'+strExpoTVFlv+'" '
				+ ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
				+ '<\/embed>';
				
		}   // embed the flash movie
	} else {  // flash is too old or we can't detect the plugin
		document.getElementById(element).innerHtml = '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"><img src="http://ak.buy.com/buy_assets/buytv/flash7needed_product.jpg" alt="Requires Flash 7 or Higher" border="0" /></a>';
		// insert non-flash content
	}
}
function ChangeExpoTvMovie(element,flvPath)
{
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		if(document.getElementById(element) != null) {
			document.getElementById(element).innerHTML = '<embed name="expotvmovie" src="/retail/flash/video_product_ll.swf" loop="false" menu="false" wmode="transparent" quality="high" bgcolor="#268CD3"'
				+ 'width="328" height="280" name="expotvmovie" align="left" '
				+ 'play="true" '
				+ 'loop="false" '
				+ 'quality="high" '
				+ 'allowScriptAccess="always" '
				+ 'type="application/x-shockwave-flash" '
				+ 'swLiveConnect="true" '
				+ 'FlashVars="clips=reviews/'+flvPath+'" '
				+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
				+ '<\/embed>';
				
		}   // embed the flash movie
	} else {  // flash is too old or we can't detect the plugin
		document.getElementById(element).innerHtml = '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"><img src="http://ak.buy.com/buy_assets/buytv/flash7needed_product.jpg" alt="Requires Flash 7 or Higher" border="0" /></a>';
		// insert non-flash content
	}
}
function StopExpoTvMovie(element,sExpoTVFlv)
{
	if (document.getElementById(element) != null) {
		document.getElementById(element).innerHTML = '<img src="http://ak.buy.com/buy_assets/v6/img/clear.gif" width="1" height="1" border="0" onload="StartExpoTvMovie(\''+element+'\',\''+sExpoTVFlv+'\');">';
	}
}

//CJ
if (getQueryStringValue("adid") == "17662") {
	document.cookie='Affiliate=noAd;domain=buy.com;path=/';
	document.cookie='GCheck=noGoogle;domain=buy.com;path=/';
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
}

//Google AdWords
if (getQueryStringValue("dcaid") == "16009") {
	document.cookie='GCheck=noGoogle;domain=buy.com;path=/';
	//document.cookie='Affiliate=noAd;domain=buy.com;path=/';
}

//Google Automator
if (getQueryStringValue("dcaid") == "17260") {
	document.cookie='GCheck=noGoogle;domain=buy.com;path=/';
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
	//document.cookie='Affiliate=noAd;domain=buy.com;path=/';
}

//Become
//if (getQueryStringValue("dcaid") == "17716") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//Cnet
//if (getQueryStringValue("dcaid") == "15889") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//Dealtime/Shopping
//if (getQueryStringValue("dcaid") == "15891") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//Froogle/Googlebase
//if (getQueryStringValue("dcaid") == "17379") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//Nexttag
//if (getQueryStringValue("dcaid") == "15894") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//PriceFish
//if (getQueryStringValue("dcaid") == "17550") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//PriceGrabber
//if (getQueryStringValue("dcaid") == "15890") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//PriceGrabber Channel Engine
//if (getQueryStringValue("dcaid") == "17747") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//PriceRunner
//if (getQueryStringValue("dcaid") == "17712") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//Smarter
//if (getQueryStringValue("dcaid") == "17551") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//Inktomi PI
//if (getQueryStringValue("dcaid") == "17282") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//MSN Search
//if (getQueryStringValue("dcaid") == "17684") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//Yahoo Search
//if (getQueryStringValue("dcaid") == "17792") {
	//document.cookie='PECheck=noPE;domain=buy.com;path=/';
//}

//if (getQueryStringValue("gad") == "1") {
	//document.cookie='Google=noAd';
//}

//if (location.host == "edit.web6.buy.com") {
	//document.cookie='Affiliate=noAd';
//}

//if (location.host == "stage.buy.com") {
	//document.cookie='Affiliate=noAd';
//}
