// Localized Redirect (.HTML to .JSP extension)

var curLoc;
curLoc = document.location.toString();

	var excludeList = new Array;

		excludeList[0] = new Object; excludeList[0].id = "nl"; excludeList[0].path = "/nl/nl/";
		excludeList[1] = new Object; excludeList[1].id = "cz"; excludeList[1].path = "/cs/cz/";
		excludeList[2] = new Object; excludeList[2].id = "dk"; excludeList[2].path = "/da/dk/";
		excludeList[3] = new Object; excludeList[3].id = "fi"; excludeList[3].path = "/fi/fi/";
		excludeList[4] = new Object; excludeList[4].id = "hu"; excludeList[4].path = "/hu/hu/";
		excludeList[5] = new Object; excludeList[5].id = "no"; excludeList[5].path = "/no/no/";
		excludeList[6] = new Object; excludeList[6].id = "pl"; excludeList[6].path = "/pl/pl/";
		excludeList[7] = new Object; excludeList[7].id = "ru"; excludeList[7].path = "/ru/ru/";
		excludeList[8] = new Object; excludeList[8].id = "se"; excludeList[8].path = "/sv/se/";
		excludeList[9] = new Object; excludeList[9].id = "gr"; excludeList[9].path = "/el/gr/";
		excludeList[10] = new Object; excludeList[10].id = "il"; excludeList[10].path = "/he/il/";
		excludeList[11] = new Object; excludeList[11].id = "tr"; excludeList[11].path = "/tr/tr/";

if (curLoc.charAt(23) == "/" && curLoc.charAt(26) == "/"  && curLoc.charAt(29) == "/" && curLoc.length == "39") {
	switchURL();
	}

function switchURL() {

	for (i = 0; i <= excludeList.length; i++) {

		if (curLoc.indexOf(excludeList[i].path) > -1) {

				curLoc = "http://www.symantec.com/region/" + excludeList[i].id + "/index.html";
				window.location.replace(curLoc);
				break;
		}

		else {

			if (curLoc.indexOf('index.html') > -1 ) {
					curLoc = curLoc.substring(0,(curLoc.length - 10)) + 'index.jsp';
					window.location.replace(curLoc);
					break;
					}
		}
	}
}





// ------------------------------------------------------------------------------------------------------------------

// Section Nav On States

	var navList = new Array;

		navList[0] = new Object; navList[0].id = "mnSupp"; navList[0].path = "/techsupp/";
		navList[1] = new Object; navList[1].id = "mnSecR"; navList[1].path = "/avcenter/";
		navList[2] = new Object; navList[2].id = "mnProd"; navList[2].path = "/products/";
		navList[3] = new Object; navList[3].id = "mnDown"; navList[3].path = "/home_homeoffice/downloads/";
		navList[4] = new Object; navList[4].id = "mnDown"; navList[4].path = "/small_business/downloads/";
		navList[5] = new Object; navList[5].id = "mnProg"; navList[5].path = "/partners/programs/";
		navList[6] = new Object; navList[6].id = "mnTool"; navList[6].path = "/partners/tools/";
		navList[7] = new Object; navList[7].id = "mnHowT"; navList[7].path = "/partners/howto/";
		navList[8] = new Object; navList[8].id = "mnTrai"; navList[8].path = "/training/";
		navList[9] = new Object; navList[9].id = "mnInce"; navList[9].path = "/partners/incentives/";
		navList[10] = new Object; navList[10].id = "mnProf"; navList[10].path = "/about/profile/";
		navList[11] = new Object; navList[11].id = "mnNews"; navList[11].path = "/about/news/";
		navList[12] = new Object; navList[12].id = "mnIndu"; navList[12].path = "/about/industryanalysts/";
		navList[13] = new Object; navList[13].id = "mnJobs"; navList[13].path = "/about/careers/";
		navList[14] = new Object; navList[14].id = "mnIndu"; navList[14].path = "/enterprise/solutions/";
		navList[15] = new Object; navList[15].id = "mnLice"; navList[15].path = "/enterprise/licensing/";
		navList[16] = new Object; navList[16].id = "mnHome"; navList[16].path = "";

	function setNavState() {
		var id = "";
		for (i = 0; i <= navList.length; i++) {

			if (curLoc.indexOf(navList[i].path) > -1) {
				id = navList[i].id;
				break;
				}
		}

		var o = document.getElementById(id);
		o.className = "mainNavOn";

	  }





// ------------------------------------------------------------------------------------------------------------------

// Product Pages Buy Box

function go(form) {
	location = document.form.site.options[document.form.site.selectedIndex].value;                  
	}





// ------------------------------------------------------------------------------------------------------------------

// Popup Window

function P(url,h,w) {
	var p = "height=" + h + ",width=" + w + ",scrollbars=yes";
	window.open(url,"",p);
	}




// ------------------------------------------------------------------------------------------------------------------

// Global Utilities Widget Drop-down

function showSubNav(thisitem) {

	var divname = "gSnav"+thisitem;
	var thediv = document.getElementById(divname);
	thediv.style.visibility = 'visible';
	}
	
function hideSubNav(thisitem) {

	var divname = "gSnav"+thisitem;
	var thediv = document.getElementById(divname);
	thediv.style.visibility = 'hidden';
	}

function swapImage(name, img) {
	if (document.images) {
		document.images[name].src = img.src;
	}
}





// ------------------------------------------------------------------------------------------------------------------

// Rounded corners with rounded border - Learn/Buy/Use Widget

window.onload=function(){
Rounded("div#lbuWdgt","top","transparent","#EBEBEB","border #CCC");
Rounded("div#lbuWdgt","bottom","transparent","#FFF","border #CCC");
}

function Rounded(selector,wich,bk,color,opt){
var i,prefixt,prefixb,cn="r",ecolor="",edges=false,eclass="",b=false,t=false;

if(color=="transparent"){
    cn=cn+"x";
    ecolor=bk;
    bk="transparent";
    }
else if(opt && opt.indexOf("border")>=0){
    var optar=opt.split(" ");
    for(i=0;i<optar.length;i++)
        if(optar[i].indexOf("#")>=0) ecolor=optar[i];
    if(ecolor=="") ecolor="#666";
    cn+="e";
    edges=true;
    }
else if(opt && opt.indexOf("smooth")>=0){
    cn+="a";
    ecolor=Mix(bk,color);
    }
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
else if(wich.indexOf("top")>=0) t="true";
else if(wich.indexOf("tl")>=0){
    t="true";
    if(wich.indexOf("tr")<0) prefixt+="l";
    }
else if(wich.indexOf("tr")>=0){
    t="true";
    prefixt+="r";
    }
if(wich.indexOf("bottom")>=0) b=true;
else if(wich.indexOf("bl")>=0){
    b="true";
    if(wich.indexOf("br")<0) prefixb+="l";
    }
else if(wich.indexOf("br")>=0){
    b="true";
    prefixb+="r";
    }
var v=getElementsBySelector(selector);
var l=v.length;
for(i=0;i<l;i++){
    if(edges) AddBorder(v[i],ecolor);
    if(t) AddTop(v[i],bk,color,ecolor,prefixt);
    if(b) AddBottom(v[i],bk,color,ecolor,prefixb);
    }
}

function AddBorder(el,bc){
var i;
if(!el.passed){
    if(el.childNodes.length==1 && el.childNodes[0].nodeType==3){
        var t=el.firstChild.nodeValue;
        el.removeChild(el.lastChild);
        var d=CreateEl("span");

        d.style.display="block";
        d.appendChild(document.createTextNode(t));
        el.appendChild(d);
        }
    for(i=0;i<el.childNodes.length;i++){
        if(el.childNodes[i].nodeType==1){
            el.childNodes[i].style.borderLeft="0px solid "+bc;
            el.childNodes[i].style.borderRight="1px solid "+bc;
            }
        }
    }
el.passed=true;
}
    
function AddTop(el,bk,color,bc,cn){
var i,lim=4,d=CreateEl("b");

if(cn.indexOf("s")>=0) lim=2;
if(bc) d.className="artop";
else d.className="rtop";
d.style.backgroundColor=bk;
for(i=1;i<=lim;i++){
    var x=CreateEl("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    if(bc) x.style.borderColor=bc;
    d.appendChild(x);
    }
el.style.paddingTop=0;
el.insertBefore(d,el.firstChild);
}

function AddBottom(el,bk,color,bc,cn){
var i,lim=4,d=CreateEl("b");

if(cn.indexOf("s")>=0) lim=2;
if(bc) d.className="artop";
else d.className="rtop";
d.style.backgroundColor=bk;
for(i=lim;i>0;i--){
    var x=CreateEl("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    if(bc) x.style.borderColor=bc;
    d.appendChild(x);
    }
el.style.paddingBottom=0;
el.appendChild(d);
}

function CreateEl(x){
return(document.createElement(x));
}

function getElementsBySelector(selector){
var i,selid="",selclass="",tag=selector,f,s=[],objlist=[];

if(selector.indexOf(" ")>0){  //descendant selector like "tag#id tag"
    s=selector.split(" ");
    var fs=s[0].split("#");
    if(fs.length==1) return(objlist);
    f=document.getElementById(fs[1]);
    if(f) return(f.getElementsByTagName(s[1]));
    return(objlist);
    }
if(selector.indexOf("#")>0){ //id selector like "tag#id"
    s=selector.split("#");
    tag=s[0];
    selid=s[1];
    }
if(selid!=""){
    f=document.getElementById(selid);
    if(f) objlist.push(f);
    return(objlist);
    }
if(selector.indexOf(".")>0){  //class selector like "tag.class"
    s=selector.split(".");
    tag=s[0];
    selclass=s[1];
    }
var v=document.getElementsByTagName(tag);  // tag selector like "tag"
if(selclass=="")
    return(v);
for(i=0;i<v.length;i++){
    if(v[i].className.indexOf(selclass)>=0){
        objlist.push(v[i]);
        }
    }
return(objlist);
}

function Mix(c1,c2){
var i,step1,step2,x,y,r=new Array(3);
if(c1.length==4)step1=1;
else step1=2;
if(c2.length==4) step2=1;
else step2=2;
for(i=0;i<3;i++){
    x=parseInt(c1.substr(1+step1*i,step1),16);
    if(step1==1) x=16*x+x;
    y=parseInt(c2.substr(1+step2*i,step2),16);
    if(step2==1) y=16*y+y;
    r[i]=Math.floor((x*50+y*50)/100);
    }
return("#"+r[0].toString(16)+r[1].toString(16)+r[2].toString(16));
} 



// ------------------------------------------------------------------------------------------------------------------

// product finder

// debug: uncomment this to turn debugging on so we don't need to use netscape
self.onerror = function showErr(msg,url,line) {
	alert("ERROR: "+msg+"\nline: "+line);
}

// Popup Windows
function popup (url,width,height,name) {
	var w = window.open (url,name,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=" + width + ",height=" + height,true);
	w.focus();
	if(arguments.length >= 5) {
		return w;
	}
}

// Menus
var timerID = null; 
var timerOn = false; 
var timecount = 500; 
var check = false;
function getPos(element, which) {
	pos = 0
	while (element != null) {
		pos += element["offset" + which]
		element = element.offsetParent
	}
	return pos;
}

function show(name) {
			var elem = document.getElementById(name);
			var parent = elem.parentNode;
			if (elem != null) {
				elem.style.visibility="visible";
				elem.style.display="block";
				elem.style.left=(getPos(parent, "Left") + 10) + "px";
				elem.style.top=(getPos(parent, "Top") + 18) + "px";
			}
}

function hide(name) {
			var elem = document.getElementById(name);
			if (elem != null) {
				elem.style.visibility="hidden";
				elem.style.display="none";
			}
}

var Divs = new Array();
Divs[0] = "utility_symantec";
Divs[1] = "utility_about";
Divs[2] = "utility_i18n";
Divs[3] = "utility_login";
function hideAll(omit) {
	for (i = 0; i < Divs.length; i++) {
		if (omit != Divs[i]) {
			hide(Divs[i]);
		}
	}
}

function startTime() {
	if (timerOn == false) {
		timerID = setTimeout("hideAll()", timecount);
		timerOn = true;
	}
}

function stopTime() {
	if (timerOn) {
		clearTimeout(timerID);
		timerID = null;
		timerOn = false;
	}
}

// Product Selector
var prod_selector = new Object();
prod_selector.anchorDivId = ""; prod_selector.anchorBtmId=""; prod_selector.primaryWidth = 0; prod_selector.secondaryWidth = 0;
prod_selector.mouseOverImg = ""; prod_selector.normalImg = ""; prod_selector.topStatusTxt = ""; prod_selector.bgColorClass = "";
prod_selector.itemBorderClass = ""; prod_selector.menuGraphicClass = ""; prod_selector.btmBorderClass = ""; 
prod_selector.itemContentClass = ""; prod_selector.objWinHgt = ""; prod_selector.objScrollOffset = ""; prod_selector.objWinWidth = "";
prod_selector.spacerGifPath = "/img/spacer.gif"; prod_selector.browser = ""; prod_selector.tOffset = 0; prod_selector.invTOfsset = 0;
prod_selector.iemac = false; prod_selector.psLayers = new Array();

var mItems = new Array();
var lList = new Object();
var selTmrId = null; 
var selTmrOn = false; 
var selTmrCnt = 700; 
prod_selector.iemac = (navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1);
if(document.layers) { // NS 4.x specific
	var origWidth = window.innerWidth;
	var origHeight = window.innerHeight;
	window.onresize = function() {
if(window.innerWidth != origWidth || window.innerHeight != origHeight) {//extra code to ensure a genuine resize has occurred
	origWidth = window.innerWidth; 
	origHeight = window.innerHeight;
	window.location.reload();
	}
};

} // end NS4.x block
function window_on_load () {
	if(document.getElementById) {
		window.onresize = function() {calculate_lOffset()};
		var top = document.getElementById('prod-selector'); 
		if(top) {
				getHghts(); getInvs(); calculate_lOffset();calculate_TOffsets();
				top.onmouseover = function(){window.status = prod_selector.topStatusTxt; showSelDiv('level-1', prod_selector.anchorBtmId); selstop();};
				top.onmouseout = function(){window.status=''; selstart();};
				top=null;;
		}
	}
}

function calculate_lOffset() {
	if(prod_selector.secondaryWidth > 0) {
		var right_terminus = getPos(document.getElementById(prod_selector.anchorDivId), 'Left') + prod_selector.primaryWidth + prod_selector.secondaryWidth;
		if(right_terminus <= eval(prod_selector.objWinWidth) || prod_selector.iemac) {
			prod_selector.leftOffset = prod_selector.primaryWidth;
		} else {
			prod_selector.leftOffset = (-1 * prod_selector.secondaryWidth) - 2;
		}

		if(prod_selector.browser == 'IE') {
			prod_selector.leftOffset = prod_selector.primaryWidth + 1;
		}
	}
}

function calculate_TOffsets() { //values determined empirically
	if(prod_selector.browser == 'IE' && !(prod_selector.iemac)) {
		prod_selector.tOffset = 0;
		prod_selector.invTOfsset = -1;
	} else {
		prod_selector.tOffset = -1;
		prod_selector.invTOfsset = 0;
	}
}

function setobjs(){
	if(navigator.userAgent.indexOf('Safari') != -1)	{
		prod_selector.objWinHgt = 'window.innerHeight';
		prod_selector.objScrollOffset = 'window.pageYOffset';
		prod_selector.objWinWidth = 'window.innerWidth';
		prod_selector.browser = 'Safari';
	}
	else if(window.innerHeight) { //NS
		prod_selector.objWinHgt = 'window.innerHeight';
		prod_selector.objScrollOffset = 'window.pageYOffset';
		prod_selector.objWinWidth = 'window.innerWidth';
		prod_selector.browser = 'Mozilla';
	}	
	else if(document.body.clientHeight) { //IE
		prod_selector.objWinHgt = 'document.body.clientHeight';
		prod_selector.objWinWidth = 'document.body.clientWidth';
		prod_selector.objScrollOffset = 'document.body.scrollTop';
		prod_selector.browser = 'IE';
	}
}

function mustInv(toShow){
	var inv = false;
	var lTop = getPos(prod_selector.psLayers[lList[toShow]].lock, "Top");
	if((lTop + prod_selector.psLayers[lList[toShow]].height) >= (eval(prod_selector.objWinHgt) + eval(prod_selector.objScrollOffset)) && (lTop - prod_selector.psLayers[lList[toShow]].height > 15)) inv = true;
	return inv;
}

function showSelDiv(toshow, lockto){
	if(prod_selector.psLayers.length > 0) {
			var ptr = document.getElementById(toshow);
			var inv = mustInv(toshow);
			if((!(prod_selector.iemac) && inv) || (prod_selector.iemac && toshow != 'level-1' && inv))
			{
				var oLft = (toshow == 'level-1') ? 0 : prod_selector.leftOffset;
				var oTop = 0;
				ptr.style.visibility="visible";
				ptr.style.display="block";
				ptr.style.left= (getPos(prod_selector.psLayers[lList[toshow]].inv_lock, 'Left') + oLft) + "px";
				ptr.style.top = '';
				ptr.style.top= (getPos(prod_selector.psLayers[lList[toshow]].inv_lock, 'Top') - (prod_selector.psLayers[lList[toshow]].height + prod_selector.invTOfsset)) + "px";
			}
			else
			{
				var offsetLeft = (toshow == 'level-1') ? (0) : prod_selector.leftOffset;
				var offsetTop = 0;
				ptr.style.visibility="visible";
				ptr.style.display="block";
				ptr.style.left= (getPos(prod_selector.psLayers[lList[toshow]].lock, 'Left') + offsetLeft) + "px";
				ptr.style.top = ''; //odd hack, necessary to accomodate ie on the mac!
				ptr.style.top = (prod_selector.iemac) ? ((lockto == prod_selector.anchorBtmId) ? '' : (getPos(prod_selector.psLayers[lList[toshow]].lock, 'Top') + prod_selector.tOffset) + "px") : ((getPos(prod_selector.psLayers[lList[toshow]].lock, 'Top') + prod_selector.tOffset) + "px");
			}
	}
}

function selstart() {
	if (document.getElementById('selectorHead')){
		document.getElementById('selectorHead').style.backgroundColor = "#f27f1a";
	}
	if (selTmrOn == false) {
		selTmrId = setTimeout("hideselall()", selTmrCnt);
		selTmrOn = true;
	}
}

function selstop() {
	if (document.getElementById('selectorHead')){
		document.getElementById('selectorHead').style.backgroundColor = "#999999";
	}
	if (selTmrOn) {
		clearTimeout(selTmrId);
		selTmrId = null;
		selTmrOn = false;
	}
}

function hideselall() {
	if(arguments.length != 0)
	{
		var exclude;
		for (var i = 0; i < prod_selector.psLayers.length; i++)
		{
			exclude = false;
			for(var ii = 0; ii < arguments.length; ii++)
			{
				if(prod_selector.psLayers[i].id == arguments[ii])
				{
					exclude = true;
					break;
				}
			}
			if(!(exclude))
			{
				hide(prod_selector.psLayers[i].id);
			}
		}
	}
	else
	{
		for (var i = 0; i < prod_selector.psLayers.length; i++)
		{
			hide(prod_selector.psLayers[i].id);
		}
	}
}

function hvr(ID, href, value){
		window.status = href; 
		document.getElementById((ID)).style.backgroundColor = (value) ? "#f27f1a" : ""; //TBD: color in a variable
		document.getElementById(('td-' + ID)).style.color = (value) ? "#ffffff" : ""; //TBD: color in a variable
		if(document.images[('img-' + ID)]) document.images[('img-' + ID)].src = (value) ?  prod_selector.mouseOverImg : prod_selector.normalImg;
		// This code is added so as to make the main category selected when the mouse is at the child layer (Product)
		if (ID.indexOf("_")!= "-1")
		{
			ID = ID.substring(0, ID.indexOf("_"));
			document.getElementById((ID)).style.backgroundColor = (value) ? "#f27f1a" : ""; //TBD: color in a variable
			document.getElementById(('td-' + ID)).style.color = (value) ? "#ffffff" : ""; //TBD: color in a variable
			if(document.images[('img-' + ID)]) document.images[('img-' + ID)].src = (value) ?  prod_selector.mouseOverImg : prod_selector.normalImg;
		}
	}

function copyArray(arrToCopy){
	var temp = new Array();
	for(var i=0; i < arrToCopy.length; i++)
	{
		temp[i] = arrToCopy[i];
	}
	return temp;
}

function initiateBuild()
{
	 if(mItems.length != 0)
	 {
		buildSel(mItems);
	}
}

function buildSel(arrInfo){
	var markup, itemMU;
	var styleOverride = '';
	var arrArg;
	var xclusion;
	var containingLayer;
	var width;
	var zIndex;
	if(arguments.length == 1) //first time in
	{
		setobjs();
		width = prod_selector.primaryWidth ;
		containingLayer = 'level-1' ;
		var elem = new Object();
		elem['id'] = containingLayer;
		elem['top'] = 0;
		elem['height'] = 0;
		prod_selector.psLayers[0] = elem;
		xclusion = "'" + containingLayer + "'";
		arrArg = new Array(containingLayer);
	}
	else //recursion
	{
		width = prod_selector.secondaryWidth; //TBD: needs to be tweaked, or perhaps controllable dynamically;
		containingLayer = arrInfo[0].parent + '-sub';
		var surr =  arguments[1];
		//build the exclusion list: 
		for(x=0; x < surr.length; x++)
		{
			xclusion = (x==0) ? ("'" + surr[x] + "'") : (xclusion + ",'" + surr[x] + "'");
		}
		xclusion += ",'" + containingLayer + "'";
		arrArg = copyArray(arguments[1]); //copy to augment
		arrArg[arrArg.length] = containingLayer;
	}
	styleOverride = ' style="width:' + width + 'px;"';
	zIndex = arguments.length == 1 ? 1 : 2;
	markup = '<div id="' + containingLayer + '" style="z-Index:' + zIndex + '; position:absolute; visibility:hidden; " onMouseOver="selstop();" onMouseOut="selstart();">';
	markup += '\n<table class="' + prod_selector.bgColorClass + '" width="' + width + '" cellspacing="0" cellpadding="0">\n';
	itemMU = '';
	//for each menu item:
	for(var i=0; i < arrInfo.length; i++)
	{
		var thisExclusion = '';
		var obj = arrInfo[i];
		var aParent = (obj.sub_nav && obj.sub_nav.length >= 1);
		itemMU += '<tr>';
		if(i == arrInfo.length - 1)
		{
			itemMU += '<td class="' + prod_selector.btmBorderClass + '">';
			
		} else {
			itemMU += '<td class="' + prod_selector.itemBorderClass + '">';
		}
		itemMU += '<div id="' + obj.id + '" onClick="window.location=' + "'" + obj.link + "'" + ';"';
		itemMU += ' onMouseOver="hvr(' + "'" + obj.id + "'" + ', ' + "'" + obj.link + "'" + ', true); ';
		/* extra mouseover code here: */
		thisExclusion = ' hideselall(';		
		if(aParent) //if there are children, we have to *show* specific layers, as well as hide others
		{
			thisExclusion += xclusion + ",'" +obj.id + "-sub'" + "); showSelDiv('" + obj.id + "-sub', " + "'" + obj.id + "', '" + containingLayer + "');" + ' selstop();" ';
		}
		else //just hide the others
		{
			thisExclusion += xclusion + ');" ';
		}
		itemMU += thisExclusion;
		itemMU += 'onMouseOut="hvr(' + "'" + obj.id + "'" + ', ' + "''," + ' false);" ';
		itemMU += ' style="width:' + width + 'px;">\n';;  
		itemMU += '<table border="0" cellspacing="0" cellpadding="0">\n';
		var dynamWidth = width - 5; //5 is the width of the arrow graphic
		itemMU += '<tr><td style="padding:.3em 1em; line-height:1.2em" id="td-' + obj.id + '" class="' + prod_selector.itemContentClass + '" >' + obj.text + '</td>';
		//do we need to add the arrow, which signifies that the menu item has children?
		var rightMostCell = (aParent) ? '<img id="img-' + obj.id + '" src="' + prod_selector.normalImg + '" width="5" height="5" border="0">' : '';
		itemMU += '<td style="padding:.2em .3em 0 0" class="' + prod_selector.menuGraphicClass + '" >' + rightMostCell + '</td>';
		itemMU += '</tr></table>\n</div></td></tr>\n';
		if(aParent) //recurse
		{
			buildSel(obj.sub_nav, arrArg)
		}
	}
	markup += itemMU;
	markup += '</table>\n<div id="' + containingLayer + '-bottom"><img src="' + prod_selector.spacerGifPath + '" width="1" height="1" alt="" border="0">' + '</div>\n</div>';
	document.write(markup);
	if(containingLayer != 'level-1')
	{
		var elem = new Object();
		elem['id'] = containingLayer;
		elem['height'] = 0;
		prod_selector.psLayers[prod_selector.psLayers.length] = elem;
	}
}

function fetchNode(id, arrToSearch){
	var found = null;
	for(var i=0; i <= arrToSearch.length - 1; i++)
	{
		var current = arrToSearch[i];
		if(current['id'])
		{
			if(current['id'] == id)
			{
				found = current;
				break;
			}
		}
		if(current['sub_nav'] && current['sub_nav'].length >= 1)
		{
			found = fetchNode(id, current['sub_nav']);
			if(found) break;
		}
	}
	return found;
}

function buildNode(parentID, id, txt, href, hasSub){
if(parentID == prod_selector.anchorDivId)
	{
		mItems[mItems.length] = new Object();
		var node = mItems[mItems.length - 1];
		node['id'] = id;
		node['text'] = txt;
		node['link'] = href;
		//does this have children?
		if(hasSub) node['sub_nav'] = new Array();
	}
	else //build subordinate item:
	{
		var parent = fetchNode(parentID, mItems);
		if(parent)
		{
			if(!parent['sub_nav']) parent['sub_nav'] = new Array();
			var sub = parent['sub_nav'][parent['sub_nav'].length] = new Object();
			sub['parent'] = parent.id;
			sub['id'] = id;
			sub['text'] = txt;
			sub['link'] = href;
			//Does this have a sub nav?
			if(hasSub) sub['sub_nav'] = new Array();
		}
	}
}

function getHghts(){
	for(var i=0; i < prod_selector.psLayers.length; i++)
	{
		var posID;
		var id; 
		if(i==0) //level-1
		{
			posID = prod_selector.anchorBtmId;
			id = 'level-1';
		}
		else //the subs
		{
			posID = prod_selector.psLayers[i].id.substr(0, prod_selector.psLayers[i].id.indexOf('-sub'));
			id = prod_selector.psLayers[i].id;
		}
	//positioning element:
	var posEl = document.getElementById(posID);
	//element to be positioned:
	var el = document.getElementById(id);
	var top = getPos(posEl, "Top");
	el.style.top = top  + "px";
	var bottom = document.getElementById(id + '-bottom');
	var Hght = getPos(bottom, "Top") - top;
	prod_selector.psLayers[i].height = Hght;
	if(i==0)
		{
			prod_selector.psLayers[i]['lock'] = document.getElementById(prod_selector.anchorBtmId);
		}
		else
		{
			prod_selector.psLayers[i]['lock'] = posEl;
		}
		//put entry in the linked list:
		lList[id] = i;
	}
}

var getInvs="function getInvs() {"; 
getInvs += "for(var i=0; i < prod_selector.psLayers.length; i++){";
getInvs += "switch(i) {";
getInvs += "case 0:";
getInvs += "prod_selector.psLayers[i]['inv_lock'] = document.getElementById(prod_selector.anchorDivId); break;";
getInvs += "case (prod_selector.psLayers.length - 1):";
getInvs += "prod_selector.psLayers[i]['inv_lock'] = document.getElementById('level-1-bottom'); break;";
getInvs += "default:";
getInvs += "prod_selector.psLayers[i]['inv_lock'] = prod_selector.psLayers[i + 1]['lock'];}";
getInvs += "} }";
eval(getInvs);



// ------------------------------------------------------------------------------------------------------------------

// metrics

/*

	<!-- SiteCatalyst code version: G.6.
	Copyright 1997-2004 Omniture, Inc. More info available at
	http://www.omniture.com --><script language="JavaScript"><!--

*/

	/* You may give each page an identifying name, server, and channel on the next lines. */

	var s_pageName=""
	var s_server=""
	var s_channel=""
	var s_pageType=""
	var s_prop1=""
	var s_prop2=""
	var s_prop3=""
	var s_prop4=""
	var s_prop5=""
	var s_prop6=""
	var s_prop7=""
	var s_prop8=""
	var s_prop9=""
	var s_prop10=""
	/* E-commerce Variables */
	var s_campaign=""
	var s_state=""
	var s_zip=""
	var s_events=""
	var s_products=""
	var s_purchaseID=""
	var s_eVar1=""
	var s_eVar2=""
	var s_eVar3=""
	var s_eVar4=""
	var s_eVar5=""
	var s_eVar6=""
	var s_eVar7=""
	var s_eVar8=""
	var s_eVar9=""
	var s_eVar10=""
	var s_charSet="UTF-8"

	//--></script>		



// ------------------------------------------------------------------------------------------------------------------