
// REMOVED TO ALLOW TB SUPPORT OLD DRIVERS PAGE Folder Tree window.onload TO WORK
// window.onload = function() { add_status(); }
/////////////////////////////////////////////////////////////////
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
};
/////////////////////////////////////////////////////////////////
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
};
/////////////////////////////////////////////////////////////////
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
	newWindow=window.open(URLtoOpen, windowName, windowFeatures); 
};

/////////////////////////////////////////////////////////////////
function show(id) {
	document.getElementById(id).style.visibility = "visible";
}
/////////////////////////////////////////////////////////////////
function hide(id) {
	document.getElementById(id).style.visibility = "hidden";
}
/////////////////////////////////////////////////////////////////
function showBlock(id) {
	document.getElementById(id).style.display = "block";
}
/////////////////////////////////////////////////////////////////

//RETURNS THE LEFT NUMBER OF CHARACTERS REQUESTED FROM A STRING
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n) + '...';
};
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
};

// NEW VERSION OF BLUE DOT IMAGE TOGGLER TO USE PROTOTYPE, MAKE MORE EASILY REPURPOSEABLE
function blueDotClick(elt, image, caption, width, height){
	//SELECT CONTAINER
	
	//var container = elt.up('.productSwapperBox'); //Doesn't work in IE
	var container = (Element.up(elt,'.productSwapperBox')||Element.up(elt,'.productSwapperBox160'));

	//SET ALL DOTS TO GREY
	var dots = container.select('.widgetCircle');
	dots.each(function(elt){elt.src='/business/toughbook/img/dot_off.gif';});
	
	//SET CLICKED DOT TO BLUE
	elt.down('img').src='/business/toughbook/img/dot_on.gif';
	
	//SWAP IMAGE
	container.down('.swapperImage').src = image;
	container.down('.swapperImage').title = container.down('.swapperImage').alt = caption;
	//container.down('.swapperImage').setAttribute('alt','hello');
	//container.down('.swapperImage').setAttribute('title','hello');
	
	//SWAP CAPTION
	if (container.down('.imgCaption, .imgCaption160')) container.down('.imgCaption, .imgCaption160').innerHTML = caption;	
}

// DEPRECATED; DO NOT USE vidload
function vidload(who, what, width, height) {
	str = '';
	str += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+ width +'" height="'+ height +'" id="FLVPlayer" style="margin: 0 0px 0px 0px;">';
  	str += '<param name="movie" value="FLVPlayer_Progressive.swf" >';
  	str += '<param name="salign" value="lt" >';
  	str += '<param name="quality" value="high" >';
  	str += '<param name="wmode" value="transparent" />';
  	str += '<param name="scale" value="noscale" >';
  	str += '<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_2&streamName='+ what +'&autoPlay=true&autoRewind=false" >';
  	str += '<embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_2&streamName='+ what +'&autoPlay=true&autoRewind=false" quality="high" scale="noscale" width="'+ width +'" height="'+ height +'" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" style="margin: 0 0 0px 0;" wmode="transparent">';
	str += '</object>';

	document.getElementById(who).innerHTML = str;
	return false;
}

function genuineWindows(){
	 params  = 'width='+screen.width;
	 params += ', height='+screen.height;
	 params += ', top=0, left=0'
	 params += ', fullscreen=no';
	
	 newwin=window.open('http://www.panasonic.com/business/toughbook/genuine_windows.asp','genuine', params);
	 if (window.focus) {newwin.focus()}
	 return void(0);
}