//20071207
/**
* Query String parsers
*/
function getQueryVariable(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]; } } 
}
function getQV(variable,string) {
    var str = string.replace('?','&'); query = str.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]; } } 
}
/**
* KioskSwitch
*/
function switchKiosk(rootname) {
	var reg_asset = rootname + '_reg';
	var kiosk_asset = rootname + '_kiosk';
	if (isKiosk) {
		document.getElementById(reg_asset).style.display='none';
		document.getElementById(kiosk_asset).style.display='block';
	}
}

/* 
*	function getCookie()
*	takes name argument
*	returns cookie value
*	jm 2006/09/06
*/
function readCookie(name) {
	var cookieName = name + "=";
	var cookieArray = document.cookie.split(';');
	for(var i=0;i < cookieArray.length;i++) {
		var c = cookieArray[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(cookieName) == 0) return c.substring(cookieName.length,c.length);
	}
	return null;
}

/*
* takes function call 
* delays execution until full page load
* dwl 2006/09/28
*/

function addOnloadEvent(fnc){
  if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", fnc, false );
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        oldOnload( e );
        window[fnc]();
      };
    }
    else
      window.onload = fnc;
  }
}

/* 
* test for https:
* return true for secure
* false for standard http
* jm 2006/10/24
*/

function getProtocol(){
	var isSecure = (window.location.protocol == "https:") ? true: false;
	return isSecure;
}
/**
* GS and CS on Lists by EMB
* Updated on 20071120
*/
function docs(url) {
	var csDiv = document.createElement('div');
	csDiv.style.marginBottom = "5px"; 
	csDiv.innerHTML = "<a href=\"javascript: popUpRawURL('"+url+"','CommonSenseMedia','6','1')\" title=\"Trusted ratings and reviews on age-appropriate gaming.\" name=\"&lid=CommonSenseLogo\" title=\"C\">Family reviews</a>: Common Sense Media";
	parDivArr[currRow].appendChild(csDiv);
}
function doGameSpot001(url) {
	var gsDiv = document.createElement('div');
	gsDiv.style.marginTop = "5px"; 
	gsDiv.innerHTML = "<a href=\"javascript: popUpRawURL('"+url+"','GameSpotWindow','6','1');\" title=\"Click here to see screenshots, movie clips and more at GameSpot.com\" name=\"&lid=gamespot\">News, reviews &amp; more<\/a>: GameSpot";
	parDivArr[currRow].appendChild(gsDiv);
}

/**
* POWER PRICE by EMB 
* Updated on 20071207
*/
function getPosiLeft(This){
	var el = This;var pL = 0;
	while(el){pL+=el.offsetLeft;el=el.offsetParent;}
	return pL;
}

function getPosiTop(This){
	var el = This;var pT = 0;
	while(el){pT+=el.offsetTop;el=el.offsetParent;}
	return pT;
}

function ppoc(){
var el = document.getElementById('powerprice');
var gpl = getPosiLeft(this);
var lp = (-300 + gpl) > 0 ? (-300 + gpl) : (150 + gpl);
el.style.left = lp + "px";
el.style.top =  -100 + getPosiTop(this) + "px";
el.style.display = 'block';
}

function ppmov(){this.style.backgroundPosition = '0 -21px';}

function ppmou(){this.style.backgroundPosition = '0 0';}

function getSkuArr(s){
	var isSku = false;
	var skArr = new Array('8274672','8274379','8259449','8473662','8249683','8254417','8463076');
	for(i=0,len=skArr.length;i<len;i++){
		if(skArr[i]==s){
			isSku = true; break;
		}
	}
	return isSku;
}

function buildPowerPrice(){
	var pplink = document.createElement('a');
	pplink.className = "PowerPrice";
	pplink.style.width = '110px';
	pplink.style.height = '20px';
	pplink.style.marginTop = '5px';
	pplink.style.backgroundPosition = '0 0';
	pplink.style.backgroundRepeat = 'no-repeat';
	pplink.style.backgroundImage = "url(http://images.bestbuy.com/BestBuy_US/en_US/images/global/misc/priceblock_ppn.gif)";
	pplink.style.display = 'block';
	pplink.onclick = ppoc;
	pplink.onmouseover = ppmov;
	pplink.onmouseout = ppmou;
	return pplink;
}

function showPowerPrice(pb,s,p){
	var pnode = pb.parentNode;
	var pbdiv = pb.cloneNode(false);
	var pblink = pbdiv.appendChild(document.createElement('a'));
	pblink.href = "javascript:popUp('olspage.jsp?id=pcat17053&type=page&skuId=" + s+ "&productId=" + p+ "','MiniCart','4','0');"
	pblink.innerHTML = "See price in cart";
	pbdiv.style.margin = "0px 0px 5px";
	pb.parentNode.replaceChild(pbdiv,pb);
	pnode.insertBefore(buildPowerPrice(),pnode.firstChild);
}

function doPowerPrice(){
	var prArr = new Array();var pbArr = new Array(); var isPromoB = false;
	var tdTags = document.getElementsByTagName('td');  //SEARCH MULTI AND PROMO B
	var trTags = document.getElementsByTagName('tr');  //LIST PAGES
	var divArr = document.getElementsByTagName('div'); //ALL
	for(var i=0,tdLen = tdTags.length;i<tdLen;i++){ if(tdTags[i].className == 'skucontent'){ prArr[prArr.length++] = tdTags[i]; } }
	for(var i=0,trLen = trTags.length;i<trLen;i++){ if(trTags[i].className == 'prodlisting'){ prArr[prArr.length++] = trTags[i]; } } 
	for(var i=0,divLen = divArr.length;i<divLen;i++){ 
		if(divArr[i].className == "priceblock2"){ pbArr[pbArr.length++] = divArr[i]; }
		else if(divArr[i].className == "priceblock"){ 
			pbArr[pbArr.length++] = divArr[i]; prArr[prArr.length++] = divArr[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;  isPromoB = true;
		}
	}
	for(var j=0,prLen = prArr.length;j<prLen;j++){
		if(isPromoB!=false){
			var alink = prArr[j].getElementsByTagName('a')[0]; 
			var s = getQV('skuId',alink.href); var p = getQV('id',alink.href);
			if(getSkuArr(s)!=false){
				showPowerPrice(pbArr[j],s,p);
			}
		}
		else{
			var hrefArr = prArr[j].getElementsByTagName('a');
			for(var k=0,hLen = hrefArr.length;k<hLen;k++){ 
				var s = getQV('skuId',hrefArr[k].href); var p = getQV('id',hrefArr[k].href);
				if(hrefArr[k].className == 'prodlink' && getSkuArr(s)!=false){
					showPowerPrice(pbArr[j],s,p);
				}
			}
		}
	}
}



/**
* ISPU ATC Buttons
* EMB updated 20071107 for cache
*/
function fnSwapBtn(inode,s,p,pdp){
    var alink = document.createElement('a');
	alink.href="/site/olspage.jsp?id=pcmcat106800050005&type=category&ref=54&loc=01&qvsids=" + s + "&qvpids=" + p;
	var ispuBtn = alink.appendChild(document.createElement('img'));
	if(pdp!=true){ pnode = inode.parentNode; ipath = "btn_addtocart_20040803.gif"; }
	else{ pnode = inode.parentNode; ipath = "btn_addtocart_pdp.gif"; ispuBtn.style.marginBottom = "10px"; }
	ispuBtn.src = imgServer + "en_US/images/global/buttons/" + ipath;
	ispuBtn.border = "0";
	ispuBtn.alt = "Add to Cart";
	pnode.replaceChild(alink,inode);
}	

function fnGetHref(availMsg){ var aTags = availMsg.getElementsByTagName('a'); return aTags[0].href;}

function fnSoldOutISPU(){
	if (document.domain.indexOf('bestbuy') != -1) {
		try	{
			var msgArray = new Array();		//used to find soldout/ispu items on all pages and href on pdp/promo B pages
			var prArray = new Array();		//used to find  atc image and href on list pages
			var btnArray = new Array(); 	//used to find atc image for pdp/promo B pages
			var pdpATCinode = new Object(); //used to set pdp inode
			var pdp = false; 				//used for pdp logic
			var trTags = document.getElementsByTagName('tr');
			for(var i=0;i<trTags.length;i++){ if(trTags[i].className == 'prodlisting'){ prArray[prArray.length++] = trTags[i]; } } 
			var divTags = document.getElementsByTagName('div');
			for (var i=0;i<divTags.length;i++) {
				switch(divTags[i].className) {
					case 'addtocart' : btnArray[btnArray.length++] = divTags[i]; break; 
					case 'm19avail' : msgArray[msgArray.length++] = divTags[i]; break;  //promo B
					case 'pdpavail' : msgArray[msgArray.length++] = divTags[i]; break; 	//pdp
					case 'avail' : msgArray[msgArray.length++] = divTags[i]; break; 	//lists
				}
			}
			if(prArray.length==0 && btnArray.length==0 && msgArray.length>0 ){ pdpATCinode = document.getElementById('soldout'); }
			else if( (prArray.length==0 || btnArray.length==0) && msgArray.length==0 ){ return; }
			//find products with soldout/ispu availability messages
			for(j=0;j<msgArray.length;j++) {
				if ((msgArray[j].innerHTML.indexOf('Available at most stores') != -1 || msgArray[j].innerHTML.indexOf('Limited Availability') != -1) && msgArray[j].innerHTML.indexOf('Sold Out') != -1) {
					if(prArray.length>0) {
						var imgArray = prArray[j].getElementsByTagName('img');
						for(i=0;i<imgArray.length;i++){ if(imgArray[i].src.indexOf('btn_soldout')){ inode = imgArray[i]; } }
						productId = "id"; hrefArray = prArray[j].getElementsByTagName('a');
						for(i=0;i<hrefArray.length;i++) { if(hrefArray[i].className == 'prodlink'){ href = hrefArray[i].href; } }
					}
					else if(pdpATCinode!=null) {
						inode = pdpATCinode;
						href = fnGetHref(msgArray[j]);
						productId = "productId"; 
						pdp = true;
					}
					else {
						var imgArray = btnArray[j].getElementsByTagName('img');
						for(i=0;i<imgArray.length;i++) { if(imgArray[i].src.indexOf('btn_soldout')){ inode = imgArray[i]; } }
						href = fnGetHref(msgArray[j]);
						productId = "productId";
					}
					fnSwapBtn(inode,getQV("skuId",href),getQV(productId,href),pdp);
				}
			}
		} catch(e){}
	}
}

/***********************
* ABN javascript
* carousel js and dependencies
**************************/
/**
* global function ala prototype lib
*/
function $(name){
	return document.getElementById(name);
}

Function.prototype.bind = function(obj) {
	var method = this,
		temp = function() {
			return method.apply(obj, arguments);
		};
	return temp;
}

/**
* instanciate global BBY js object
*/
BBY = {};
/**
* set util namespace
*/
BBY.util = {};
/**
* generic utility functions
*/
BBY.util.prototype = {
	setDisplay:function(obj, state){
		obj.style.display = state;
	},
	
	setStyleAtts:function(domnode, styleatt, value){
		domnode.style[styleatt] = value + 'px';
	},
	
	getStyleAtts:function(domnode, styleatt){
		return domnode.style[styleatt];
	},
	
	changeOpacity:function(theobj, opac){
		var obj = theobj.style;
		obj.opacity = (opac / 100);
		obj.MozOpacity = (opac / 100);
		obj.KhtmlOpacity = (opac / 100);
		obj.filter = "alpha(opacity=" + opac + ")"
	},
	findPosition:function(theobject){
		var curleft = curtop = 0;
		if (theobject.offsetParent) {
			curleft = theobject.offsetLeft;
			curtop = theobject.offsetTop;
			while (theobject = theobject.offsetParent) {
				curleft += theobject.offsetLeft
				curtop += theobject.offsetTop
			}
		}
		return [curleft,curtop];
	},
	
	findHeightWidth:function(theobject){
		var theheight = theobject.offsetHeight;
		var thewidth = theobject.offsetWidth;
		return[theheight, thewidth];
	}
}

/**
* event handling object and methods
* usage: BBY.util.Event.addListener(document, "mouseover", this); 
*/
BBY.util.Event = {};
BBY.util.Event.prototype = {
	addListener:function(obj, eventName, listener){
		if (obj.attachEvent){
			obj.attachEvent("on"+eventName, listener);
		}else if(obj.addEventListener){
			obj.addEventListener(eventName, listener, false);
		}else{
			return false;
		}
		return true;
	},
	
	removeListener:function(obj, eventName, listener){
		if(obj.detachEvent){
			obj.detachEvent("on"+eventName, listener);
		}else if(obj.removeEventListener){
			obj.removeEventListener(eventName, listener, false);
		}else{
			return false;
		}
		return true;
	}
}

/**
* set dhtml namespace
*/
BBY.dhtml = {};
/**
* BBY tween lib
*/
BBY.dhtml.Tween = {};

BBY.dhtml.Tween.prototype = {
	
	easing:function(start, end, numsteps, currentstep, pvalue) {
		var delta = end - start; 
		var step = start + (Math.pow(((1 / numsteps) * currentstep), pvalue) * delta); 
		return Math.ceil(step); 
	},
	
	bounce:function(start, end, numsteps, currentstep){
		var delta = end - start;
		if ((currentstep/=numsteps) < (1/2.75)) {
			return delta*(7.5625*currentstep*currentstep) + start;
		} else if (currentstep < (2/2.75)) {
			return delta*(7.5625*(currentstep-=(1.5/2.75))*currentstep + .75) + start;
		} else if (currentstep < (2.5/2.75)) {
			return delta*(7.5625*(currentstep-=(2.25/2.75))*currentstep + .9375) + start;
		} else {
			return delta*(7.5625*(currentstep-=(2.625/2.75))*currentstep + .984375) + start;
		}
	},
	
	back:function(start, end, numsteps, currentstep, over){
		var delta = end - start;
		if (typeof over == 'undefined') over = 1.70158;
		return delta*((currentstep=currentstep/numsteps-1)*currentstep*((over+1)*currentstep + over) + 1) + start;
	}
}


/**
* Generic animation object
* used by various dhtml objects
* dependency: Tween library
*/
BBY.dhtml.Animation = function(args){
	this.init(args);
}

BBY.dhtml.Animation.prototype = {
	init:function(args){
		this.now = new Date().getTime();
		this.framerate = args.framerate;
		this.seconds = args.seconds;
		this.end = this.now + this.seconds;
		this.domelement = args.domelement;
		this.duration = Math.round(this.end - this.now);
		this.totalframes = Math.round(this.duration / this.framerate);
		this.startpoint = args.from;
		this.endpoint = args.to;
		this.method = args.method;
		this.animation;
		this.currentframe = 0;
	},
	
	animate:function(action){
		this.action = action;
		this.animation = setInterval(this[this.action].bind(this), this.framerate);
	},
	
	play:function(){
		/**
		* increment current frame and animate to the endpoint
		*/
		this.currentframe++;
		this.towidth = BBY.dhtml.Tween.prototype[this.method](this.startpoint, this.endpoint, this.totalframes, this.currentframe, 3);
		
		BBY.util.prototype.setStyleAtts(this.domelement, "height", this.towidth);
		
		if(this.currentframe >= this.totalframes){
			this.stop();
		}
	},
	
	rewind:function(){
		/**
		* increment current frame and rewind to starting point
		*/
		this.currentframe++;
		this.fromwidth = BBY.dhtml.Tween.prototype[this.method](this.endpoint, this.startpoint, this.totalframes, this.currentframe, 1);
		BBY.util.prototype.setStyleAtts(this.domelement, "height", this.fromwidth);
		if(this.currentframe >= this.totalframes){
			this.stop();
		}
	},
	stop:function(){
		clearInterval(this.animation);
		this.currentframe = 0;
	}
}

/**
* PDPSlider object for PDP redesign
* usage: BBY.dhtml.PDPSlider({triggerelement:"prodshow",animated:"featurebullets",content:"featurebulletsinner",method:"easing"});
*/

BBY.dhtml.PDPSlider = function(args){
	this.trigger = $(""+args.triggerelement+"");
	this.animated = $(""+args.animated+"");
	this.contentheight = parseInt($(""+args.content+"").offsetHeight);
	this.method = args.method;
	this.isOpen = false;
	
	this.openslider = new BBY.dhtml.Animation({domelement:this.animated, framerate:50, seconds:300, to:this.contentheight, from:1, method:this.method});
	this.closeslider = new BBY.dhtml.Animation({domelement:this.animated, framerate:50, seconds:300, to:this.contentheight, from:1, method:this.method});
	
	BBY.util.Event.prototype.addListener(this.trigger, "click", this.animate.bind(this));
}

BBY.dhtml.PDPSlider.prototype = {
	animate:function(){
		if(this.isOpen){
			this.closeslider.animate("rewind");
			this.isOpen = false;
			return false;
		}else{
			this.openslider.animate("play");
			this.isOpen = true;
			return false;
		}
	}
}
/**
* Carousel javascript for ABN
* usage: BBY.dhtml.Carousel({visible:3,increment:3,contentframe:"contentframeid",content:"contentid",backbutton:"backbuttonid",forwardbutton:"forwardbuttonid"}); 
*/
BBY.dhtml.Carousel = function(args){
	this.visibleElements = args.visible;
	this.incrementNum = args.increment;
	this.contentFrame = $(""+args.contentframe+"");
	this.prevButton = $(""+args.backbutton+"");
	this.nextButton = $(""+args.forwardbutton+"");
	this.carouselContent = args.content;
	this.isRunning = false;
	this.init();
}

BBY.dhtml.Carousel.prototype = {
	init:function(){
		//set inital index to 0
		this.currentIndex = 0;
		//set initial scroll increment width to 0
		this.scrollIncrement = 0;
		//set the current increment value to 0
		this.incrementValue = 0;
		// total number of cols
		this.cols = $(""+this.carouselContent+"").getElementsByTagName("li");
		this.checkDisable();
		
		BBY.util.Event.prototype.addListener(this.prevButton, "click", this.getPrev.bind(this));
		BBY.util.Event.prototype.addListener(this.nextButton, "click", this.getNext.bind(this));
	},
	
	getPrev:function(){
		//width of the cols
		this.width = this.cols[0].offsetWidth;
		
		if((this.currentIndex - this.incrementNum) <= 0){
			this.currentIndex = 0;
		}else{
			//decrement the index
			this.currentIndex = parseInt(this.currentIndex - (this.currentIndex - this.incrementNum));
		}
		
		this.scrollIncrement = parseInt(this.currentIndex * this.width);
		
		//set interval for scrollNext function
		if(this.isRunning == true)return;
		
		this.inter = setInterval(this.scrollPrev.bind(this), 10);
		this.isRunning = true;
	},
	
	getNext:function(){
		
		//width of the cols
		this.width = this.cols[0].offsetWidth;
		
		//increment the index by the increment number
		this.currentIndex = parseInt((this.currentIndex + this.incrementNum));
		
		if((this.currentIndex + this.visibleElements) >= this.cols.length){
			this.currentIndex = this.currentIndex - ((this.currentIndex + this.visibleElements) - this.cols.length);
		}		
		
		this.scrollIncrement = parseInt(this.currentIndex * this.width);
		
		//set interval for scrollNext function
		if(this.isRunning == true)return;
		
		this.inter = setInterval(this.scrollNext.bind(this), 10);
		this.isRunning = true;
	},
	
	scrollNext:function(){
		if(this.incrementValue > -(this.scrollIncrement)){
			this.incrementValue = this.incrementValue - 15;
			this.contentFrame.style.left = this.incrementValue + 'px';
		}else{
			clearInterval(this.inter);
			this.checkDisable();
			this.isRunning = false;
			
		}
	},
	
	scrollPrev:function(){
		if(this.incrementValue < -(this.scrollIncrement)){
			this.incrementValue = this.incrementValue + 15;
			this.contentFrame.style.left = this.incrementValue + 'px';
		}else{
			clearInterval(this.inter);
			this.checkDisable();
			this.isRunning = false;
			
		}
	},
	
	checkDisable:function(){
		var back = ((this.currentIndex == 0)) ? BBY.util.prototype.changeOpacity(this.prevButton, 40) : BBY.util.prototype.changeOpacity(this.prevButton, 100);
		var fwd = ((this.currentIndex + this.visibleElements) >= this.cols.length) ? BBY.util.prototype.changeOpacity(this.nextButton, 40) : BBY.util.prototype.changeOpacity(this.nextButton, 100);
	}
}

/* 
*	function abnchangeTab()
*	takes tabnum and numberoftabs argument
*	changes style of active and inactive tabs and displays content of active tab
*	md 2007/11/26
*/

function abnchangeTab(tabnum, numberoftabs) {
	var i = 1;
	var hidetab = "";
	var hidecontent = "";
	for (var i = 1; i <= numberoftabs; i++) {
		hidetab = "abntab" + i;
		hidecontent = "abntabcontent" + i;
		document.getElementById(hidetab).className="";
		document.getElementById(hidecontent).style.display="none";
	}
	var activetab = "abntab"+tabnum;
	document.getElementById(activetab).className="active";
	var activetabcontent = "abntabcontent"+tabnum;
	document.getElementById(activetabcontent).style.display="block";
}

/********************************
* legacy broadgroup rollover js *
********************************/
var currentObj;
var popOverStyle;

function initTooltipRollovers(){
	for(var i = 0; i<arguments.length; i++){
		document.getElementById(""+arguments[i]+"").description = document.getElementById(""+arguments[i]+"_text");
		document.getElementById(""+arguments[i]+"").onmouseover = displayData; 
	}
}
function setTooltipStyle(poStyleName){
	this.popOverStyle = poStyleName;
}
function displayData(e){
	if(currentObj == null){
		setOffset(e, this, this.description);
		setDisplay(this.description, "block");
		currentObj = this.description;
		this.description.onmouseout = hideDisplay;
		this.onmouseout = hidePopOver;
	}else{
		setDisplay(currentObj, "none");
		setOffset(e, this, this.description);
		setDisplay(this.description, "block");
		currentObj = this.description;
		this.description.onmouseout = hideDisplay;
		this.onmouseout = hidePopOver;
	}
}
function setOffset(e, imgObj, descr){
	var pos = BBY.util.prototype.findPosition(imgObj);
	var size = BBY.util.prototype.findHeightWidth(imgObj);
	
	descr.style.left = ((pos[0]) + (size[1]*.50)) + 'px';
	descr.style.top = ((pos[1]) + (size[0]*.50)) + 'px';
	descr.className = popOverStyle;	
}
function hideDisplay(e){
	if (!e) var e = window.event;
	var tg = (window.event) ? e.srcElement : e.target;
	var classname = (window.event) ? "className" : "class";
	if (tg.getAttribute(classname) != 'broadgroupcontentbox') return;
	
	var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	
	while (reltg.getAttribute(classname) != tg.getAttribute(classname) && reltg.nodeName != 'BODY')
		reltg = reltg.parentNode;
	
	if (reltg == tg) return;
	
	this.style.display = "none";
}
function hidePopOver(e){
	if (!e) var e = window.event;
	var goingto = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	var comingfrom = (e.relatedTarget) ? e.relatedTarget : e.fromElement;
	
	if((goingto.nodeName == 'TD')||(goingto.nodeName == 'IMG')){
		this.description.style.display = "none";
	}
		
}
function setDisplay(obj, state){
	obj.style.display = state;
}

/**************************************************
* tmp fix for abn pages without olspopupmaster.js *
**************************************************/

function vehicleFitGuidePopup(catID, parentUrl)
{
    fitGuideURL = 'olspage.jsp?id='+trim(catID)+'&type=page&parentURL='+escape(parentUrl);
    popUp(fitGuideURL,'FitGuide','4','0');
}
/*****************************************************
* propreitary JS for game/ game guide download boxen *
*****************************************************/
function dlbox(){
	if (typeof dlURL != "undefined"){
		var repositiondiv = document.getElementById("downloadwidget");
		var content = document.getElementById("downloadcontent");
		var dlhref = dltitle;
		dlhref = dlhref + "<br/><a href=\"javascript:popUpRawURL('"+ dlURL +"','','6','1');\" name=\"&lid=digitaldownload\">";
		dlhref = dlhref + '<img src="'+imgServer+'/en_US/images/global/buttons/btn_download_pdp.gif" width="113" height="27" alt="download this software" class="dlbutton" border="0"/>';
		dlhref = dlhref + '<\/a>'
		content.innerHTML = dlhref;
		repositiondiv.style.display = "block";
	}
	
	if (typeof ggURL != "undefined"){
		var ggdiv = document.getElementById("gameguidewidget");
		var ggcontent = document.getElementById("ggdownloadcontent");
		var gghref = ggTitle;
		gghref = gghref + "<br/><a href=\"#\" onclick=\"javascript:window.open('"+ ggURL +"','','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=915,height=675,left=50,top=200');\" name=\"&lid=digitaldownload\">";
		gghref = gghref + '<img src="'+imgServer+'/en_US/images/global/buttons/btn_download_pdp.gif" width="113" height="27" alt="download this software" class="dlbutton" border="0"/>';
		gghref = gghref + '<\/a>'
		ggcontent.innerHTML = gghref;
		ggdiv.style.display = "block";
	}
}
/*****************************************************
* Footer nav *
*****************************************************/
function doQuickNav(url) {
	var bbfb = "http://www.bestbuybusiness.com/bbfb/en/US/adirect/bestbuy?cmd=LogoutDisplay&AMP;ckimode=true&amp;storeid=";
	if (url != "") {
		if (isKiosk) {
			if(isKiosk && url == "http://www.bestbuybusiness.com/"){
				var cookieStoreId = readCookie("storeNumber");
				popUpRawURL(bbfb+cookieStoreId,'morebbysites','6','1');
			}else{
				popUpRawURL(url,'morebbysites','6','1');
			}
		}else {
			//Close survey window for cross vertical shopper leaving site. - 03/27/2006
			closeTrackerWin();
			location.href=url;
		}
	}
}
/*********************************************
* CLICK TO CALL*
/*********************************************/
if (getProtocol()){
	document.write('<script type="text\/javascript" src="https://as00.estara.com/as/InitiateCall2.php?accountid=200106285781&amp;Template=107051"><\/script>');
}else{
	document.write('<script type="text\/javascript" src="http://as00.estara.com/as/InitiateCall2.php?accountid=200106285781&amp;Template=107051"><\/script>');
}

