var dom1=(document.getElementById)?1:0;
var ie4plus=(document.all)?1:0;
var ns4=(document.layers)?1:0;
var safari=(navigator.appVersion.indexOf("Safari") != -1)?1:0;
var mac=(navigator.appVersion.indexOf("Macintosh") != -1)?1:0;

function statusMessage(txt){
	window.status=txt;
}

function generalOpenWin(href,winName,winFeatures){
	if (winFeatures=='default'){winFeatures='width=520,height=415,status'};
	if (winFeatures=='defaultScroll'){winFeatures='width=630,height=490,status=1,scrollbars=1,resizable=1'};
	if (winFeatures=='defaultScrollWide'){winFeatures='width=760,height=490,status=1,scrollbars=1,resizable=1'};
	if (winFeatures=='offSite' || winFeatures=='fullFeatured'){winFeatures='width=720,height=560,location=1,status=1,scrollbars=1,resizable=1,toolbar=1,menubar=1'}
	if (winFeatures=='general'){winFeatures=(mac)?'width=382,height=375,scrollbars=1':'width=401,height=375,scrollbars=1'};
	if (winFeatures=='siteWin'){winFeatures='width=640,height=480,scrollbars=1,resizable=1,status=1'};
	if (winFeatures=='hddvd'){winFeatures='width=900,height=600,location=0,scrollbars=0,toolbar=0,menubar=0,status=0,resizable=1'};
	if (winFeatures=='fullFeaturedWide'){winFeatures='width=890,height=600,status=1,scrollbars=1,resizable=1'};
	if (document.all||document.getElementById||document.layers){
		var swidth=screen.width
		var sheight=screen.height
		if(swidth<=800){
			winFeatures+=",top=0,left=0";
		}else{
			//assuming width=760,height=550
			var tleft=(swidth/2)-380;
			var ttop=(sheight/2)-275;
			if(tleft<0)tleft=0;
			if(ttop<0)ttop=0;
			var tstr=",top="+ttop+",left="+tleft;
			winFeatures+=tstr;
		}
	}	
	var winName=window.open(href,winName,winFeatures)
	if (window.focus)winName.focus();
}

if (document.images){
	var pbuttover=new Image();pbuttover.src="img/butt_promomore_over.gif";
	var pbuttoff=new Image();pbuttoff.src="img/butt_promomore_off.gif";
	var hbfover=new Image();hbfover.src="img/home_findadealerbutton-over.gif";
	var hbfoff=new Image();hbfoff.src="img/home_findadealerbutton.gif";
	//var hbcover=new Image();hbcover.src="img/home_contactbutton-over.gif";
	//var hbcoff=new Image();hbcoff.src="img/home_contactbutton.gif";
	//var hbjover=new Image();hbjover.src="img/home_jointeambutton-over.gif";
	//var hbjoff=new Image();hbjoff.src="img/home_jointeambutton.gif";
	
	var greenover=new Image();greenover.src="img/home_greenbutton-over.gif";
	var greenoff=new Image();greenoff.src="img/home_greenbutton.gif";
	
	var hbrover=new Image();hbrover.src="img/home_resellersbutton-over.gif";
	var hbroff=new Image();hbroff.src="img/home_resellersbutton.gif";
	var ciover=new Image();ciover.src="img/home_custominstallerbutton-over.gif";
	var cioff=new Image();cioff.src="img/home_custominstallerbutton.gif";
	var hscover=new Image();hscover.src="img/home_servicebutton-over.gif";
	var hscoff=new Image();hscoff.src="img/home_servicebutton.gif";
	var missionbuttover=new Image();missionbuttover.src="img/home_about_butt1-over.gif";
	var missionbuttoff=new Image();missionbuttoff.src="img/home_about_butt1.gif";
	var hhistoryover=new Image();hhistoryover.src="img/home_about_butt2-over.gif";
	var hhistoryoff=new Image();hhistoryoff.src="img/home_about_butt2.gif";
	var haboutover=new Image();haboutover.src="img/home_abouttoshibabutton-over.gif";
	var haboutoff=new Image();haboutoff.src="img/home_abouttoshibabutton.gif";	
}
function act(imgN){	if (document.images) document[imgN].src=eval(imgN+'over.src');}
function inact(imgN){if (document.images) document[imgN].src=eval(imgN+'off.src');}
function pact(imgN){if (document.images) document[imgN].src=pbuttover.src;}
function pinact(imgN){if (document.images) document[imgN].src=pbuttoff.src;}

function getElementRef(id){
	if (dom1) return document.getElementById(id);
	else if (ie4plus) return document.all[id];
	else if (ns4) return document.layers[id];
	else return null;
}
function findDealers(dealerURL){
	//generalOpenWin('http://stage.tacp.toshiba.com/dealerlocator/SearchForPhysicalDealer.aspx','wheretobuywin','defaultScrollWide')
	generalOpenWin( dealerURL,'wheretobuywin','defaultScrollWide')	
}
function findEtailers(){
	//generalOpenWin('http://webmail.tacp.com/sales/contactsw.nsf/Etailer?openform','wheretobuywin','defaultScroll')
	generalOpenWin('onlineetailers.html','wheretobuywin','toolbar=1,width=630,height=490,status=1,scrollbars=1,resizable=1')
}
function placeWhere2Buy(){
	oLink=document["hbf"];
	oBuy=getElementRef("where2buyoptions");
	if( oLink.offsetParent ) {
		for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) {
			posX += oLink.offsetLeft; posY += oLink.offsetTop;
		}
	} else {
			posX= oLink.x; 	posY=oLink.y;
	}
	if(oBuy.style){
		oBuy.style.left=(posX+40) + "px"
		oBuy.style.top=(posY-89) + "px"
	}
}

var regzaWin;
var regzaUrl='/regza/regzasite.aspx';
function openRegzaSite(){
	var w;
	var h;
	var scrollbars;
	if(screen.width && screen.height){
		w=screen.width;
		h=screen.height;
		scrollbars=(screen.width < 940 || screen.height<768)?1:0;
	}else{
		w=1024;
		h=768;
		scrollbars=1;
	}
	var windowFeatures="top=1,left=1,width="+w+",height="+h+",toolbar=0,menubar=0,location=0,statusbar=0,resizable=1,fullscreen=1,scrollbars="+scrollbars//+auto;;
	regzaWin=window.open(regzaUrl,'',windowFeatures);
	if(window.focus)regzaWin.focus();
}