<!--

var timeout = 100;
var childLayerWidth = 176;
var vertical_position = 94;
var childCellHeight = 20;
var childBackGroundColor = '#FFFFFF';
var childBorderColor = 'C9CCCE';
var runChildSelectHighlited = false;


function getTheSection(){
	firstPosition = currentSection.indexOf('\/');	
	secondPosition = currentSection.indexOf('\/', firstPosition + 1);
	theSection = currentSection.substring(firstPosition + 1,secondPosition);
	return theSection;
}


function makeArray(len) {
    for (var i = 0; i < len; i++) this[i] = null;
	this.length = len;
}

function showLayer(id,number){		
	if(browser.ns5){			
		document.getElementById(id).style.visibility='visible';		
	}else if ((!browser.WinOs) && (browser.ie)){
		document.all[id].style.visibility='visible';
	}else{
		document.all[id].style.visibility='visible';		
	}	
}

function hideLayer(id){
	if (document.all) document.all[id].style.visibility='hidden';
	else if (browser.ns4) document.layers[id].visibility='hide';
	else if (browser.ns5) document.getElementById(id).style.visibility='hidden';
}

function hover(number,on,color,parentId) {
	if (!browser.ie4){		
		var obj = document.getElementById("div" + number).style;
		on?obj.backgroundColor=color:obj.backgroundColor=childBackGroundColor;		
		on?obj.color='#FF6600':obj.color='#666666';		
		on?obj.cursor='hand':obj.cursor='default';			
	}
}

//BEGIN FUNCTIONS THAT RUN THE DROP DOWN MENUS
function restoreChildLayers(){
	var tempchildid="";
	for (var i=0; i< menus; i++){
		tempchildid='child'+i;
		hideLayer(tempchildid);
	}
}
var bolSectionMatch = false;
function highlightOnParent(id){	
	for (var i = 0; i < parentRolloverArray.length; i++) {		
		if (id == i){
			var arrDirectories = parentDirectoryArray[i].split(",");
			bolSectionMatch = false;
			for(k=0; k<arrDirectories.length; k++){
				if (currentSection == arrDirectories[k]){
					bolSectionMatch = true;
					break;
				}
			}
			
			if (bolSectionMatch){
				eval('imgOnOver(\''+ parentRolloverArray[i] +'\')');
			}else{
				eval('imgOver(\''+ parentRolloverArray[i] +'\')');
			}			
		}			
	}		
}

function highlightOffParent(id){
	if ((!browser.ie4) && (!browser.ns4)){		
		var obj = document.getElementById("parent" + id).style;
		obj.color='#000000';	
		obj.cursor='default';	
	}
}

function restoreParents(mainid){
	for (var i = 0; i < parentRolloverArray.length; i++) {		
		if (mainid != i){
			for(i=0; i<parentDirectoryArray.length;i++){
				var arrDirectories = parentDirectoryArray[i].split(",");
				bolSectionMatch = false;
				for(k=0; k<arrDirectories.length; k++){
					if (currentSection == arrDirectories[k]){
						bolSectionMatch = true;
						break;
					}
				}	
				
				if (bolSectionMatch){
					eval('imgOn(\''+ parentRolloverArray[i] +'\')');
				}else{
					eval('imgOff(\''+ parentRolloverArray[i] +'\')');
				}
					
			}			
		}			
	}
}


function onParent(id,childexists){
	var childid='child'+id;
	if (timerID) clearTimeout(timerID);
			restoreParents(id);
			highlightOnParent(id);			
			restoreChildLayers();
	if (childexists) showLayer(childid,id);
}

var timerID;
function offParent(childexists){ 	
	if (childexists){ 
		timerID = setTimeout('timeup()',timeout); 
	} else { 
		restoreParents();
	} 
}

function onChild(){ clearTimeout(timerID); }

function offChild(id){ timerID = setTimeout('timeup()',timeout); }

function timeup(){
	restoreChildLayers();
	restoreParents();
}
//END FUNCTIONS THAT RUN THE DROP DOWN MENUS

function childMenu(tablerows,childnumber,position,child_width,horizontal_position,numberOfChildren,child_menu_height){	
	var childtable = '\n<table width="'+ child_width +'" cellpadding="0" cellspacing="0" border="0" bgcolor="'+ childBackGroundColor +'">\n<tbody>\n<tr>\n\t<td colspan="3" bgcolor="'+ childBorderColor +'" height="1"><spacer type="block" height="1" width="1"/></td>\n</tr>\n'+ tablerows + '<tr>\n\t<td colspan="3" bgcolor="'+ childBorderColor +'" height="1"><spacer type="block" height="1" width="1"/></td>\n</tr>\n</tbody>\n</table>\n';
	var childlayerstart = '<div id="child'+ childnumber +'" onmouseover="onChild();" onmouseout="offChild();">';
	var childlayerend = '</div>\n\n';
	return childlayerstart + childtable + childlayerend;
}

function childTableRow(link,url,lastOne,divMenu,childRolloverColor,parentId,topPosition){	
	if (lastOne){
		if (runChildSelectHighlited && (currentSection == url)){
			return '<tr>\n\t<td width="1" bgcolor="'+ childBorderColor +'" height="'+ childCellHeight +'"><spacer type="block" height="'+ childCellHeight +'" width="1"/></td>\n\t<td class="linktext" bgcolor="'+ childRolloverColor +'">&#160;&#160;'+ link +'</td>\n\t<td width="1" bgcolor="'+ childBorderColor +'"><spacer type="block" height="1" width="1"/></td>\n</tr>\n';
		}else{
			return '<tr>\n\t<td width="1" bgcolor="'+ childBorderColor +'" height="'+ childCellHeight +'"><spacer type="block" height="'+ childCellHeight +'" width="1"/></td>\n\t<td class="linktext" id="div'+ divMenu +'" onmouseover="hover('+ divMenu +',true,\''+ childRolloverColor +'\')" onmouseout="hover('+ divMenu +',false)" onclick=\'location.href="'+ url +'";\' >&#160;&#160;'+ link +'</td>\n\t<td width="1" bgcolor="'+ childBorderColor +'"><spacer type="block" height="1" width="1"/></td>\n</tr>\n';
		}			
	}else{
		if (runChildSelectHighlited && (currentSection == url)){
			return '<tr>\n\t<td width="1" bgcolor="'+ childBorderColor +'" height="'+ childCellHeight +'"><spacer type="block" height="'+ childCellHeight +'" width="1"/></td>\n\t<td class="linktext" bgcolor="'+ childRolloverColor +'">&#160;&#160;'+ link +'</td>\n\t<td width="1" bgcolor="'+ childBorderColor +'"><spacer type="block" height="1" width="1"/></td>\n</tr>\n<tr>\n\t<td width="1" bgcolor="'+ childBorderColor +'"><spacer type="block" height="1" width="1"/></td>\n\t<td height="1" bgcolor="#E3E3E3" width="'+ (childLayerWidth - 2) +'"><spacer type="block" height="1" width="1"/></td>\n\t<td width="1" bgcolor="'+ childBorderColor +'"><spacer type="block" height="1" width="1"/></td>\n</tr>\n';
		}else{
			return '<tr>\n\t<td width="1" bgcolor="'+ childBorderColor +'" height="'+ childCellHeight +'"><spacer type="block" height="'+ childCellHeight +'" width="1"/></td>\n\t<td class="linktext" id="div'+ divMenu +'" onmouseover="hover('+ divMenu +',true,\''+ childRolloverColor +'\')" onmouseout="hover('+ divMenu +',false)" onclick=\'location.href="'+ url +'";\' >&#160;&#160;'+ link +'</td>\n\t<td width="1" bgcolor="'+ childBorderColor +'"><spacer type="block" height="1" width="1"/></td>\n</tr>\n';
		}
	}			
}

var parentRolloverArray = new Array();
var parentDirectoryArray = new Array();
var childLinkArray = new Array();
var childLinkArrayLoop = 0;
var leftPosition = ""; var parent_htmlstring = ""; var child_htmlstring = ""; var leftNav_HtmlString = ""; var CSSstring = ""; var menus = 0; var menusCount = 0; var numberOfChildren = 0; var loopForChildren = 0;var divMenu = 0; var topPosition = 1;
function writenavMenus(){	
	horizontal_position = 0;	
	var i = 0; var cur_child_tablerows = ""; var childexists; var left_nav_tablerows = "";
	for (var parentlink in navMenus){			
		menusCount++;
	}
	mainNavRollovers = new makeArray(menusCount);
	for (var parentlink in navMenus){
		parentRolloverArray[menus] = parentlink;
		for (var parenturl in navMenus[parentlink]){
			parentDirectoryArray[menus] = parenturl;
			for (var mainImageWidth in navMenus[parentlink][parenturl]){
				for (var mainImageHeight in navMenus[parentlink][parenturl][mainImageWidth]){
					leftPosition = "";
					leftPosition = mainImageWidth;
					for (var mainImageAlt in navMenus[parentlink][parenturl][mainImageWidth][mainImageHeight]){
						for (var childRolloverColor in navMenus[parentlink][parenturl][mainImageWidth][mainImageHeight][mainImageAlt]){
							for (var childLink in navMenus[parentlink][parenturl][mainImageWidth][mainImageHeight][mainImageAlt][childRolloverColor]){													
								numberOfChildren = numberOfChildren + 1;
								childLinkArray[childLinkArrayLoop] = false;								
								for (var childUrl in navMenus[parentlink][parenturl][mainImageWidth][mainImageHeight][mainImageAlt][childRolloverColor][childLink]){																		
									for (var ThirdLevelLink in navMenus[parentlink][parenturl][mainImageWidth][mainImageHeight][mainImageAlt][childRolloverColor][childLink][childUrl]){
										childLinkArray[childLinkArrayLoop] = true;										
									}																					
								}														
								childLinkArrayLoop = childLinkArrayLoop + 1;								
							}	
							for (var childLink in navMenus[parentlink][parenturl][mainImageWidth][mainImageHeight][mainImageAlt][childRolloverColor]){													
								for (var childUrl in navMenus[parentlink][parenturl][mainImageWidth][mainImageHeight][mainImageAlt][childRolloverColor][childLink]){									
									loopForChildren = loopForChildren + 1;
									if (numberOfChildren == loopForChildren){
										cur_child_tablerows += childTableRow(childLink,childUrl,true,divMenu,childRolloverColor,menus,topPosition);
									}else{
										cur_child_tablerows += childTableRow(childLink,childUrl,false,divMenu,childRolloverColor,menus,topPosition);
									}	
									
									divMenu = divMenu + 1;	
									topPosition = topPosition + (childCellHeight + 1);													
								}		
							}
							if (cur_child_tablerows!=''){ childexists=true; } else { childexists=false; }					
							
							mainNavRollovers[i] = parentlink;
							
							CSSstring += eval('cssStr(\'child\','+ i +','+ (7+i) +','+ vertical_position +','+ leftPosition +')');
							child_htmlstring += childMenu(cur_child_tablerows,i,vertical_position,childLayerWidth,horizontal_position,numberOfChildren,topPosition);
							
							cur_child_tablerows = "";										
						}							
					}					
				}
			}
		}	
		//alert(numberOfChildren);
		topPosition = 1;
		loopForChildren = 0;
		numberOfChildren = 0;
		i++;
		menus++;		
	}
	
	
	//alert (parent_htmlstring);
	//alert (CSSstring);
	//alert (child_htmlstring);
	//alert (menus);
	//alert(menusCount);
	//alert(leftNav_HtmlString);
	//alert(childLinkArrayLoop);	
	
	
}
function cssStr(type,id,z, position,left_position,layerWidth) {
	switch(type){
		case "start": return '<style type="text/css">\n';
		case "end": return '</style>';
		case "child": return (browser.ns4)? '\n' : '\t#child'+ id +' { position:absolute; visibility:hidden; left:' + left_position + 'px; top:'+ position +'px; z-index:'+ z +'}\n';		
		default: return '\n'
	}
}

function writeCSS(str,showAlert) {
	if (!browser.ns4){
		str = cssStr('start')+str+cssStr('end');
		document.write(str);
		if (showAlert) alert(str);
	}
}

function writeChildMenus(){ if ((child_htmlstring) && (!document.layers)) document.write(child_htmlstring); }
//-->