//---------------------------------------------------------------
//04/08/03  Randy     S4782 - ENH - WTB Split for LCD
//02/12/03  Debi      S4648 - ENH - WTB Split for LPG
//11/11/02  MDeodhar  e7681 - ENH - FastTrack Not Working
//7/22/02   banerjed  e5162 - removed the popup box for browser detect for NS6 and above.
//7/11/02   NChughtai e5193 - popUp survey
//				modified exitInterview for the new popup
//6/18/02   NChughtai e5093 - ENH - ATOMZ and navscript.js file
//				added the full path to window.open in display_popup
//6/5/02    CChang    e4652 - BUG - FastTrack and LPG Landing	
//5/22/02   MDeodhar  e3967 - ENH - WTB Split for Copiers and Faxes
//5/02/02   CChang    LPGLandingpage- ENH(project) - Change link for Multimedia Projectors
//		      -Business,Multimedia Projectors- Mobile,ProVideo
//4/9/02    MDeodhar  e3721 - Browser Detect Popup
//1/18/02   MDeodhar  e2667 - ENH - Change link for Home Theatre
//1/21/02   NChughtai e2694 - Added function addtomailinglist
//---------------------------------------------------------------

//BROWSER DETECTION
var vnum = navigator.appVersion.substring(0,1)
//any version < 4
if (parseInt(vnum) < 4) { 
} 

//Netscape versions > 4
else if ((navigator.appName == "Netscape") && (parseInt(vnum) > 4)) {
	e4=true;
	n4=false
} 

//Any other browsers
else if ((navigator.appName != "Netscape") && (navigator.appName != "Microsoft Internet Explorer")) {
	
}

isfive=navigator.appVersion.indexOf('5.0')
var platform = navigator.appVersion.indexOf('W')
var plat=false
if (platform == -1) { 
	if (isfive > 1) { plat='mac5' }
	else { plat='mac'}
}
if (parseInt(vnum) >= 4) { 
	if (document.layers) { 
    	n4=true
		e4=false
		end="</layer>";
		hi=20
	}
	else if (document.all) { 
    	e4=true
		n4=false
		end="</div>";
		hi=16
	}
	else if (document.getElementById) {
	if(platform == -1) {
		n4=false;
		e4=false;
		end="";
	} else {
		n4=false;
		e4=true;
		end="";
	}
	}
	else {
	n4=false;
	e4=false;
	end="";	
	}
}

function SetCookie (name,value,expires,path,domain,secure)
{
        document.cookie = name + "=" + escape (value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

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)
{
	//alert(document.cookie)
        var arg = name + "=";
        var alen = arg.length;
        var clen = document.cookie.length;
        if( (document.cookie == null) 
        	|| (document.cookie.length == null))
        {
                return null;
        }
        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;
        }
        return null;
}

//e3721 - New function to display popup
function display_popup() {
	var cookieVal;
	var cookieName;

	//alert("inside display_popup")
	cookieName = "browserpopupdisplayed"
	cookieVal = navigator.appName + navigator.appVersion
	//alert(cookieVal)
	//var temp=GetCookie (cookieName)
	//alert(temp)
	if (GetCookie (cookieName) != cookieVal) {
		//alert("here2")
		//set cookie
		SetCookie(cookieName, cookieVal,"","/");
		//display popup
		var bd = window.open("http://www.sharpusa.com/BrowserDetectMessage/0,2048,,00.html", "browserdetectmessage", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=400,height=300,top=10,left=10")
		window.bd.focus()
	}
}

//this function is called from the model landing pages for Zaurus to popup a mailing list window
function addtomailinglist(ref) {
 mailwin = window.open(ref, "mailinglist", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=495,height=390,top=0,left=0");
 window.mailwin.focus();
}

//popup survey related code
var exit = true;
var showSurvey = true;
function exitInterview()
 {
	var expdate = new Date ();
	var surveyCookieName = "e5193Survey";
	var surveyURL = "http://www.insightexpress.com/ix/showInvitation.asp?id=44237&accessCode=8141162714";
	//CHANGE THIS PARAMETER TO CONTROL SAMPLING RATE
	var percentOfferedSurvey = 50;  
	//show the survey in the same window.
	// 30 days from now
	expdate.setTime(expdate.getTime() + (30 * 24 * 60 * 60 * 1000)); 
      var stored_value = GetCookie(surveyCookieName);
	var dd=new Date();
	cn= Math.round(dd.getTime() / 100) % 100;
	//alert (cn + " - " + stored_value);
	if ((cn <= percentOfferedSurvey) && (stored_value == null))
	{
		if (showSurvey) {
			SetCookie(surveyCookieName, "alreadyOffered", expdate, "/");
			window.open(surveyURL, 'new_window', 'width=710,height=500,resizbale=no,scrollbars=yes');
		}
	}
 }

function SetCookie (name,value,expires,path,domain,secure)
{
        document.cookie = name + "=" + escape (value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

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;
        if( (document.cookie == null) 
        	|| (document.cookie.length == null))
        {
                return null;
        }
        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;
        }
        return null;
}
// end popup surve
//MAKE DIFFERENT LAYERS FOR NS AND IE	
function startlayer(sid, sclass, sleft, stop, swidth, sheight, szindex, inside, vis, other) {
	if (e4) {
        document.write('<div id="'+sid+'" class="'+sclass+'" style="left:'+sleft+'; top:'+stop+'; width:'+swidth+'; height:'+sheight+'; z-index:'+szindex+'; visibility:'+vis+'" '+ other +' onSelectStart="return false">'+inside+'');
	}
	if (n4) {
	if (vis=="visible") { vis="show" } 
	if (vis=="hidden") { vis="hide" } 
        document.write('<layer id="'+sid+'" class="'+sclass+'" left='+sleft+' top='+stop+' width='+swidth+' height='+sheight+' z-index='+szindex+' visibility='+vis + " " + other +'>'+inside+'');
	}		
}

//onload function
function init() {

window.status='';  //this is to remove the menu loading message from the status bar.

if ((self != top) && (!isframed)) top.location.href = window.location.href;
	lifttimer = null
	timer = null
if (n4) {
origWidth = innerWidth;
origHeight = innerHeight;
document.captureEvents(Event.MOUSEMOVE | Event.RESIZE);
onresize=redo
}
if (e4) {
}
document.onmousemove=getmousemove
window.onerror=stoperror

}

function stoperror() {
	return true
}

function redo() { 
if (innerWidth != origWidth || innerHeight != origHeight) 
location.reload();
}

var xcurr=0
var ycurr=0

//captures the mousemove
function getmousemove (evt) {
if (e4) {
	xcurr=event.x
	ycurr=event.y
}
if (n4) {
	xcurr=evt.pageX
	ycurr=evt.pageY
}
}

//returns a layer reference
function rwhichlayer(layname) {
if (e4) {
whichlayer = eval("document.all."+layname+".style")
}
if (n4) {
if ((layname!="main") && (layname!="content") && (layname!="block") && (layname!="fastlay") && (layname.search('lay') == -1)) {
whichlayer = eval("document.fastlay.document.main.document.layers['"+layname+"']");
}
else {
whichlayer = eval("document.layers['"+layname+"']");
}
}
return whichlayer
}

//shows a hidden layer
function showlay(layname,which) {
whichlayer=rwhichlayer(layname)
if (e4) {
whichlayer.visibility="visible";
}
if (n4) {
whichlayer.visibility="show";
}
}

//hides a shown layer
function hidelay(layname) {
whichlayer=rwhichlayer(layname)
if (e4) {
whichlayer.visibility="hidden";
}
if (n4) {
whichlayer.visibility="hide";
}
}


function addtowish(ref) {
 wishwin = window.open(ref, "wishlist", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=440,height=425,top=0,left=0")        
 window.wishwin.focus();
}


//--------------SRIGHT NAV ROLLOVERS----------------------->

var arrow_on = new Image();
var arrow_off = new Image();
var act_on = new Image();
var act_off = new Image();

arrow_on.src = "/images/but_redarrows_on.gif";
arrow_off.src = "/images/but_redarrows.gif";
act_on.src = "/images/but_activate_on.gif";
act_off.src = "/images/but_activate.gif";

function Roll(what,newImg){
if (e4) {
document.images[what].src = newImg.src;
}
if (n4) {
document.layers[what].document.images[what].src = newImg.src;
}
} 


//--------------START SOURCE CONTROL----------------------->

fon=false

function fasttrack() {
if (!fon) {
	if (e4 && plat=="mac") {
	loadSourceFinish()
	}
	else {
	loadSource('/products/Fasttrack/0,1502,,00.html')
	}
}
}

function loadSource(where) {	
if (n4) {
	document.fastlay.src = where
}	
if (e4) {
	fastframe.document.location = where	
}
}

function loadSourceFinish() {
	if (e4 && !plat) { 
		document.all.fastlay.innerHTML=fastframe.document.body.innerHTML
		fastframe.document.body.innerHTML=""
		prodarray=fastframe.prodarray
		actarray=fastframe.actarray
		prodIDarray=fastframe.prodIDarray
		actIDarray=fastframe.actIDarray
		plen=fastframe.plen
		alen=fastframe.alen
		fturlstart=fastframe.fturlstart
		fturlend=fastframe.fturlend
	}
	if (e4 && plat) { 
		parent.document.all.fastlay.innerHTML=fastframe.document.body.innerHTML
		parent.prodarray=prodarray
		parent.actarray=actarray
		parent.prodIDarray=prodIDarray
		parent.actIDarray=actIDarray
		parent.plen=plen
		parent.alen=alen
		parent.fturlstart=fturlstart
		parent.fturlend=fturlend
	}
		parent.fastinit()
}
//--------------END SOURCE CONTROL----------------------->



//-------------------------------START FASTTRACK SPECIFIC FUNCTIONS-------------------->
																					  //
function fastinit() { 
	scrollTo(0,0)
	actlayarray= new Array()
	oactarray=actarray
	for (var i=0; i<alen; i++) {     
		thisname="act" + i
		if (e4) {
		actlayarray[i]=document.all[thisname].style
		}
		if (n4) {
		actlayarray[i]=document.fastlay.document.main.document.layers[thisname];
		}
	}
prodlayarray=new Array()
	for (var i=0; i<plen; i++) {  
		thisname="prod" + i
		if (e4) {
		prodlayarray[i]=document.all[thisname].style
		prodlayarray[i].oTop=prodlayarray[i].posTop
		prodlayarray[i].oLeft=prodlayarray[i].posLeft
		}
		if (n4) {
		prodlayarray[i]=document.fastlay.document.main.document.layers[thisname];
		prodlayarray[i].oTop=prodlayarray[i].pageY
		prodlayarray[i].oLeft=prodlayarray[i].pageX
					//--------------in mac netscape you can't drag with the mousedown, so you need 
					//--to inform the user to click, drag, and click to let go, hence no mouseup event
				prodlayarray[i].captureEvents(Event.MOUSEDOWN);
				prodlayarray[i].onmousedown=new Function("grab("+i+")");
			if (plat=="mac") { }
			else {
					//--------------in netscape you can't use a mousedown or up in a layer tag, 
					//--so you need set them up here.
				prodlayarray[i].captureEvents(Event.MOUSEUP);
				prodlayarray[i].onmouseup=new Function("leggo("+i+")");
			}
		}
	}
if (e4 && plat=="mac") { startfast() }
else { startfast() }
}


//FASTTRACK GLOBAL VARIABLES---------->

grabbed=false
offset=0
offsetr=0
var isatext=false
var made=false
var madi
var madz
var lastshower="none"
startx=120
starty=100
owidth=0
oheight=0


//-----------LAUNCH THE FASTTRACK---------------->
//
function startfast() {
if (isform || isform) { 
	if ((formtype=="a" || formtype=="b") || e4) {
		if (formtype=="a") { t=174 }
		else if (formtype=="b" || formtype=="Reg") { t=0 }
		if (e4) { mainm.style.clip = "rect(0,"+t+",auto,0)"; }
		if (n4) { 
			owidth=document.mainm.clip.width
			oheight=document.mainm.clip.height
			document.mainm.clip.top = 0
			document.mainm.clip.right = t		
			document.mainm.clip.bottom = document.mainm.clip.height
			document.mainm.clip.left = 0
		}
	}
	else  { document.prodreg.visibility="hide"; }
}
if (n4) {
	document.fastlay.zIndex=999;
}
if (e4) {
	fastlay.style.zIndex=999;
}
}

grabbedmac="non"

//-----------GRAB THE OBJECT SEND TO CARRY---------------->
//
function grab(i) {
scrollTo(0,0);
if (grabbed) {
leggo(i)
}
else {
if (grabbedmac!="non") {
leggo(grabbedmac)
}
clearTimeout(lifttimer)
prodlayarray[i].color="333333";
prodlayarray[i].fontWeight="bold";
prodlayarray[i].zIndex+=1
	//offset to keep mouse point on object where you clicked it----> 
	offset=xcurr-startx-prodlayarray[i].oLeft
if (n4) {
ptext = prodarray[i]
prodlayarray[i].document.write("<table width=300><tr><td><font class='highw'>"+ptext+"</font></td></tr></table>");
prodlayarray[i].document.close();
prodarray[i].indexOf('array');
suparray="opt" + prodIDarray[i]
suparray=eval(suparray)
writeactions(suparray)
offset=offset+120
}
if (e4) {
prodlayarray[i].posWidth=200;
suparray="opt" + prodIDarray[i]
suparray=eval("fastframe."+suparray)
writeactions(suparray)
offset=offset-20
}
if (!plat) {
grabbed=true
carry(i)
}
else { grabbedmac=i }
}
}


//------------------CHANGE THE ACTIONS BASED ON PRODUCT CHOSEN
function writeactions(suparray) {
alen=actlayarray.length
slen=suparray.length
actarray=suparray
for (var i=0; i<alen; i++) {
	if (i<slen) {
	}
	else { suparray[i]=""; }
}
if (e4) {
	for (var i=0; i<alen; i++) {
		thisname="act" + i
		if (i<slen) {
		if (plat) { document.all[thisname].innerHTML="<a href='#' class='supr' onclick='macsend("+i+")'>"+suparray[i]+"</a>"; }
		else { document.all[thisname].innerHTML=suparray[i]; }
		}
		else { document.all[thisname].innerHTML=""; }
	}
}
if (n4) {
	for (var i=0; i<alen; i++) {
		thisname="act" + i
		if (i<slen) {
		if (plat) { actlayarray[i].document.write("<table cellpadding=0 cellspacing=0 width=140 border=0><tr><td height=19 align=center valign=bottom><a class='supr' href='#' onclick='macsend("+i+")'>"+suparray[i]+"</a></td></tr></table>"); }
		else { actlayarray[i].document.write("<table cellpadding=4 cellspacing=0 width=140 border=0 height=12><tr><td align=center><font class='supr'>"+suparray[i]+"</font></td></tr></table>") };
		}
		else { actlayarray[i].document.write(''); }
		actlayarray[i].document.close();
	}
}
}


//-----------LOOP FOR CARRYING THE OBJECT---------------->
//
function carry(i) {
if (grabbed) {
ding=false
if (e4) {
		//---startx/y for ie adds position of the top layer to the position of the nested layers---->
prodlayarray[i].posTop=ycurr-18-starty
prodlayarray[i].posLeft=xcurr-18-startx-offset
ding=thisinthat(i)
shower=ding
if (shower) {
makesentence(i,shower)
}
else {
if (made) {
unmakesentence(madi,madz)
} 
}
}
if (n4) {
prodlayarray[i].pageY=ycurr-12
prodlayarray[i].pageX=xcurr-offset
if (!plat) {
if (isatext) {
			//---font tags and tables needed for netscape to make up for lack of stylesheets after the document.write---->
prodlayarray[i].document.write("<table width=300 border=0><tr><td><font class='highw'>"+prodarray[i]+"</font>&nbsp;<font class='highy'>"+isatext+"</font></td></tr></table>");
prodlayarray[i].document.close();
}
else {
prodlayarray[i].document.write("<font class='highw'>"+prodarray[i]+"</font>");
prodlayarray[i].document.close();
}
}
ding=thisinthat(i)
shower=ding
if (shower) {
	if (shower!=lastshower) {
	makesentence(i,shower)
	lastshower=shower	
	}
}
else {
	if (made) {
	unmakesentence(madi,madz)
	} 
}
}
lifttimer = setTimeout("carry("+i+")",1)
}
}


//-----------LET GO OF THE OBJECT---------------->
//
function leggo(i) {
clearTimeout(timer)
prodlayarray[i].color="cccccc";
prodlayarray[i].fontWeight="normal";
prodlayarray[i].grabbed=false
prodlayarray[i].zIndex-=1
grabbed=false
		ding=false
if (e4) {
ding=thisinthat(i)
if (ding) {
confirmit(madi,madz)
}
else {
prodlayarray[i].posTop=prodlayarray[i].oTop
prodlayarray[i].posLeft=prodlayarray[i].oLeft
}
}

if (n4) {
ding=thisinthat(i)
	if (ding) {
	confirmit(madi,madz)
	}
	else {
	prodlayarray[i].document.write('<table width=180><tr><td><font class="prods">'+prodarray[i]+'</font></td></tr></table>')
	prodlayarray[i].document.close();
	prodlayarray[i].pageY=prodlayarray[i].oTop
	prodlayarray[i].pageX=prodlayarray[i].oLeft
}
}
}

//-----------CALCULATE IF THE DRAGGED OBJECT IS ON AN ACTION ITEM---------------->
//
function thisinthat(i) {
if (e4) {
		starttop=prodlayarray[i].posTop
		midtop=prodlayarray[i].posTop + 10

		startleft=prodlayarray[i].posLeft
		endleft=prodlayarray[i].posLeft + prodlayarray[i].posWidth
		midleft=prodlayarray[i].posLeft + 60

			//----There must be an easier way to do this --  measures one objects position against another--->
	for (var z=0; z<alen; z++) {  
			if (actarray[z]!="") {
			whichleft=midleft; whichtop=midtop
				if (whichtop>=actlayarray[z].posTop &&  whichtop<=actlayarray[z].posTop + actlayarray[z].posHeight && whichleft>=actlayarray[z].posLeft &&  whichleft<=actlayarray[z].posLeft + actlayarray[z].posWidth) {
				ding=z
				}
			whichleft=startleft; whichtop=starttop
				if (whichtop>=actlayarray[z].posTop &&  whichtop<=actlayarray[z].posTop + actlayarray[z].posHeight && whichleft>=actlayarray[z].posLeft &&  whichleft<=actlayarray[z].posLeft + actlayarray[z].posWidth) {
				ding=z
				}
			}
	}	
}
if (n4) {
		starttop=prodlayarray[i].pageY
		endtop=prodlayarray[i].pageY + prodlayarray[i].clip.height
		midtop=prodlayarray[i].pageY + 10

		startleft=prodlayarray[i].pageX
		endleft=prodlayarray[i].pageX + prodlayarray[i].clip.width
		midleft=prodlayarray[i].pageX + 60

	for (var z=0; z<alen; z++) {  
			if (actarray[z]!="") {
				whichleft=midleft; whichtop=midtop
				if (whichtop>=actlayarray[z].pageY &&  whichtop<=actlayarray[z].pageY + actlayarray[z].clip.height && whichleft>=actlayarray[z].pageX &&  whichleft<=actlayarray[z].pageX + actlayarray[z].clip.width) {
				ding=z
				}
				else { 
				whichleft=startleft; whichtop=starttop;
				if (whichtop>=actlayarray[z].pageY &&  whichtop<=actlayarray[z].pageY + actlayarray[z].clip.height && whichleft>=actlayarray[z].pageX &&  whichleft<=actlayarray[z].pageX + actlayarray[z].clip.width) {
				ding=z
				}
			}
			}
	}	
}
return ding
}




//-----------MAKE A SENTENCE WHEN DRAGGED OBJECT IS ON ACTION ITEM---------------->
//
function makesentence(i,z) {
if (made) {
unmakesentence(madi,madz) 
}
made=true
madi=i
madz=z
ptext = prodarray[i]
atext = actarray[z]
if (e4) {
actlayarray[z].visibility="hidden";
aname=eval("prod" + i);
aname.innerHTML="<font class='highw'>"+ptext+"</font>&nbsp;<font class='highy'>"+atext+"</font>";
aname.style.posWidth=240;
}
if (n4) {
isatext=atext
prodlayarray[i].document.write("<table width=300><tr><td><font class='highw'>"+ptext+"</font>&nbsp;<font class='highy'>"+atext+"</font></td></tr></table>");
prodlayarray[i].document.close();
actlayarray[z].visibility="hide"
actlayarray[z].document.close();
prodlayarray[i].clip.width=240
}
}


//-----------ELIMINATE THE SENTENCE AND RESTORE THE PRODUCT AND ACTION WORDS---------------->
//
function unmakesentence(i,z) {
if (e4) {
actlayarray[z].visibility="visible";
atext = actarray[z]
aname=eval("prod" + i);
aname.innerHTML=""+ptext+"";
aname.style.posWidth=220;
actlayarray[z].color="cc6600";
}
if (n4) {
atext = actarray[z]
ptext= prodarray[i]
if (!made) {
prodlayarray[i].document.write("<font class='prods'>"+ptext+"</font>");
prodlayarray[i].document.close();
prodlayarray[i].clip.width=120;
}
actlayarray[z].visibility="show"
isatext=false
}
made=false
}


function macsend(z) {
confirmit(grabbedmac,z)
}


//-----------DISPLAY THE CONFIMATION AND SEND---------------->
//
function confirmit(i,z) {
//alert(z+","+i)
if (!plat) {
	unmakesentence(madi,madz) 
	prodlayarray[i].posTop=prodlayarray[i].oTop
	prodlayarray[i].posLeft=prodlayarray[i].oLeft
	showlay('circ')
	showlay('confirmed')
}
ptext = prodarray[i]
atext = actarray[z]
if (e4) {
	prodlayarray[i].visibility="hidden";
	confirmed.innerHTML="<table width=160 height=110><tr><td valign=middle><font class='conw'>"+ptext+"</font>&nbsp;<br><font class='cony'>"+atext+"</font></td></tr></table>";
}
if (n4) {
isatext=atext
if (!plat) {
	prodlayarray[i].visibility="hide";
	document.fastlay.document.main.document.confirmed.document.write("<table width=160 height=110><tr><td valign=middle><font class='conw'>"+ptext+"</font>&nbsp;<br><font class='cony'>"+atext+"</font></td></tr></table>");
	document.fastlay.document.main.document.confirmed.document.close();
	prodlayarray[i].visibility="hide";
	document.fastlay.document.main.document.confirmed.document.write("<table width=160 height=110><tr><td valign=middle><font class='conw'>"+ptext+"</font>&nbsp;<br><font class='cony'>"+atext+"</font></td></tr></table>");
	document.fastlay.document.main.document.confirmed.document.close();
}
}
ptext=ptext.replace(' ','');
ptext=ptext.replace(' ','');
atextarray=atext.split(" ")
//q=0
//if (atextarray.length>1) { q=atextarray.length-1 }
finalnum=null
if (e4) { curractarray=eval("fastframe.opt"+prodIDarray[i]) }
else { curractarray=eval("opt"+prodIDarray[i]) }
	for (t=0; t<oactarray.length; t++) {
		if (curractarray[z]==oactarray[t]) {
		finalnum=t
		}
	}
//e3967 - Link to popup for copier and fax WTB
if ( (actIDarray[finalnum].search(/WhereToBuy/) != -1) && (prodIDarray[i]==5 || prodIDarray[i]==7 || prodIDarray[i]==8 || prodIDarray[i]==9)) {
	if (prodIDarray[i]==5) {
		finaltext="/products/CopierWhereToBuy/1,2076,"+prodIDarray[i]+",00.html";
	}
	if (prodIDarray[i]==7) {
		finaltext="/products/FaxWhereToBuy/1,2077,"+prodIDarray[i]+",00.html";
	}
	if (prodIDarray[i]==8) {
		finaltext="/products/LPGWTBlist/1,2254,"+prodIDarray[i]+",00.html";
	}
	if (prodIDarray[i]==9) {
		finaltext="/products/LPGWhereToBuy/1,2253,,00.html";
	}
	window.open(finaltext, 'wtbwin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=325,top=150,left=150');
}
//e4652-BUG - FastTrack and LPG Landing
else if (prodIDarray[i]==9 && (actIDarray[finalnum].search(/unctionLanding/) != -1)) {
//finaltext="/sharp-usa/be-sharp/LPGLanding/0,2059,,00.html";
//e7681 - Corrected url for multimedia landing page.
finaltext="/products/projectors/multimediaLanding/0,2109,,00.html";
timer = setTimeout("location.href=finaltext",1000)
}
else {	
	finaltext=actIDarray[finalnum]+prodIDarray[i]+",00.html";
	timer = setTimeout("location.href=finaltext",1000)
}
//finaltext=actIDarray[finalnum]+prodIDarray[i]+",00.html";
//timer = setTimeout("location.href=finaltext",1000)
timer = setTimeout("closder()",900)
}


//-----------CLOSE THE FASTTRACK---------------->
//
function closder() {
	if (isform) { 
		if (e4) { 
		mainm.style.clip = "rect(auto,auto,auto,auto,)";
		}
		else if (n4 && formtype!="Reg") { 
			document.mainm.clip.top = 0
			document.mainm.clip.right = owidth		
			document.mainm.clip.bottom = oheight
			document.mainm.clip.left = 0
		}
		else { 
			document.prodreg.visibility="show"
		}
	}
offnum=0;
for (var i=0; i<plen; i++) { 
prodlayarray[i].fontWeight="normal";
prodlayarray[i].zIndex-=1
grabbed=false
prodlayarray[i].posTop=prodlayarray[i].oTop
prodlayarray[i].posLeft=prodlayarray[i].oLeft
}
if (e4) {
fastlay.style.zIndex=0
loadSource('/blank.html')
}
if (n4) {
document.fastlay.zIndex=0;
}
}
																					//
																					//
//-------------------------------END FASTTRACK SPECIFIC FUNCTIONS-------------------->



//-------------------------START SELECTOR FUNCTIONS---------------------------------------------->
																							    //
var oneon=false
var twoon=false

//----------------------START SELECTOR------------------------>
function beginselect(n,whichlen,whichname,offs,tincr,fincr) {
if (n==1) {
	if (!oneon) {
	whichlayer=rwhichlayer('block');
	whichlayer.zIndex+=90
	movenav(whichlen,whichname,offs,tincr,fincr);
	tincr=tincr-tincr-tincr
	fincr=fincr-fincr-fincr
	offs=offs-offs-offs
	oneonarray[0]=whichlen; oneonarray[1]=whichname; oneonarray[2]=offs; oneonarray[3]=tincr; oneonarray[4]=fincr;
	oneon=n;
	}
}
else {
	if (twoon) {
	endselect(2) 
	}
	movenav(whichlen,whichname,offs,tincr,fincr);
	tincr=tincr-tincr-tincr
	fincr=fincr-fincr-fincr
	offs=offs-offs-offs
	twoonarray[0]=whichlen; twoonarray[1]=whichname; twoonarray[2]=offs; twoonarray[3]=tincr; twoonarray[4]=fincr;
	twoon=n;
}
}


//----------------------END SELECTOR------------------------>
function endselect(n) {
	if (n==1) {
		if (oneon) {
		whichlayer=rwhichlayer('block');
		whichlayer.zIndex-=90
		movenav(oneonarray[0],oneonarray[1],oneonarray[2],oneonarray[3],oneonarray[4],oneonarray[5],oneonarray[6])
		oneon=false
		}
	}
	else {
		if (twoon) {
		movenav(twoonarray[0],twoonarray[1],twoonarray[2],twoonarray[3],twoonarray[4],twoonarray[5],twoonarray[6])
		twoon=false
		}
	}
}

//------------------------MOVE SELECTOR FUNCTION----------------------------->
function movenav(whichlen,whichname,offs,tincr,fincr) {
	ytop=offs
	xleft=fincr
	if (tincr>=0) { whichdir='to' }
	if (tincr<0) { whichdir='from' }
	for (var s=0; s<whichlen; s++ ) {
	ytop+=tincr
	thename=whichname+s
		if (whichdir=='to') { showlay(thename) }
		if (whichdir=='from') { hidelay(thename) }
	shifthorz(thename,xleft);
	shiftvert(thename,ytop);
	if (n4) {
		thisname='m'+whichname+s
		shifthorz(thisname,xleft);
		shiftvert(thisname,ytop);
	}
	}
}


function shiftvert(layname,much) {
whichlayer=rwhichlayer(layname)
if (e4) {
if (plat=='mac') {  if (much>0) { much+=3 } if (much<0) { much-=3 } }
if (much==0) { }
else { whichlayer.posTop+=much }
}
if (n4) {
whichlayer.pageY+=much
}
}


function shifthorz(layname,much) {
whichlayer=rwhichlayer(layname)
if (e4) {
if (plat=='mac') {  if (much>0) { much+=3 } if (much<0) { much-=3 } }
if (much==0) { }
else { 
whichlayer.posLeft+=much }
}
if (n4) {
whichlayer.pageX+=much
}
}

function selectoff() {
	if (twoon) {
	endselect(2)
	}
	if (oneon) {
	endselect(1)
	}
}

var hoback
var hofont
var whichhigh=false

function highlight(layname) {
if (whichhigh) { unhighlight(whichhigh) }
whichlayer=rwhichlayer(layname)
aname=layname+'a';
if (e4) {
hoback=whichlayer.backgroundColor
hofont=whichlayer.color
whichlayer.backgroundColor="cc0000"
whichlayer.color="ffffff"
showlay(aname)
}
if (n4) {
whichlayer.bgColor="cc0000";
whichlayer.document.layers[0].document.layers[0].visibility="show";
}
whichhigh=layname
}

function unhighlight(layname) {
whichlayer=rwhichlayer(layname)
aname=layname+'a';
if (e4) {
whichlayer.backgroundColor=hoback
whichlayer.color=hofont
hidelay(aname)
}
if (n4) {
whichlayer.bgColor="666666";
whichlayer.document.layers[0].document.layers[0].visibility="hide";
}
whichhigh=false
}

function sendselect(wtemp,wid) {
//e2667 - Function modified so that Home Theatre link goes to showcase page
// instead of FunctionLanding page
//LPGLanding page enhancement(project) so that Multimedia Projectors, Pro Video
//link goes to LPGLanding page instead of FunctionLanding page
if ((wtemp=="FunctionLanding/0,1050,") && (wid==16)) {
location.href="http://www.sharpusa.com/sharp-usa/be-sharp/beSharpvision/0,2006,,00.html"
} else if((wtemp=="FunctionLanding/0,1050,") && (wid==9)) {
location.href="http://www.sharpusa.com/sharp-usa/be-sharp/LPGLanding/0,2059,,00.html"
} else if((wtemp=="FunctionLanding/0,1050,") && (wid==26)) {
location.href="http://www.sharpusa.com/sharp-usa/be-sharp/LPGLanding/0,2059,,00.html"
} else if ((wtemp=="FunctionLanding/0,1050,") && (wid==12)) {
location.href="http://www.sharpusa.com/sharp-usa/be-sharp/LPGLanding/0,2059,,00.html"
}
else {
location.href=urlstart+wtemp+urlmid+wid+urlend
}
}


																							    //
//-------------------------END SELECTOR FUNCTIONS------------------------------------------------>

//New functions added 9/27/01, MDeodhar

//Functions for top nav rollovers
//************************************

function topnav_roll_over(i) {
	if (e4) {
		//alert("e4")
		document['toprightnav'].src = topnavImages[i].src
	}
	if (n4) {
		//alert("n4")
		document.layers['maint'].document.images['toprightnav'].src = topnavImages[i].src
	}
}

function topnav_roll_out(i) {
	if (e4) {
		document['toprightnav'].src = topnavImages[i].src
	}
	if (n4) {
		document.layers['maint'].document.images['toprightnav'].src = topnavImages[i].src
	}
}

//Functions for category selections roll-overs
//**********************************************

function roll_over(obj,i) {
	if (e4) {
		document[obj].src = catSelections_on[i].src
		//document['selection_name'].src = catSelections_name[i].src
	}
	if (n4) {
		document.layers['midmain'].document.images[obj].src = catSelections_on[i].src
		//document.layers['midmain'].document.images['selection_name'].src = catSelections_name[i].src
	}
}

function roll_out(obj,i) {
	if (e4) {
		document[obj].src = catSelections_off[i].src
		//document['selection_name'].src = '/images/name_blank.gif'
	}
	if (n4) {
		document.layers['midmain'].document.images[obj].src = catSelections_off[i].src
		//document.layers['midmain'].document.images['selection_name'].src = '/images/name_blank.gif'
	}
}

function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function
