//###########################################################
//	
// <title>Crossframe Links v2.0.3.11</title>
// 		Sunday, 8th February 2004
//	
//###########################################################



//############################################################################
//Global variables
	var NickLinks_DivCounter = 0
	var NickLinks_DivInfo = new Array()
	var NickLinks_DivStatus = null


//############################################################################
function NickLinks(){

	//Create new links array and dummy populate
		this.linkArray = new Array();
			this.linkArray[0] = new Array(0);

	this.LinksScriptPath=(location.href+'').substring(0,(location.href+'').lastIndexOf('/')+1)

	//Default values
		this.startXPos = 0			//Default starting horizontal position of links if no HTML element passed (default=0)
		this.startYPos = 0			//Default starting vertical position of links if no HTML element passed (default=0)
		this.width  = 180			//Width of sublinks/submenus
		this.height = 18			//Height of sublinks/submenus
		this.textPadding = 6		//Horizontal spacing of text from edge of menu
		this.offsetX = 0			//Horizontal offset starting position of top level links (default=0)
		this.offsetY = 19			//Vertical offset starting position of top level links (default=20)
		this.spacingX = 0			//Horizontal spacing of lower level submenus from RHS of menu column (+/-)
		this.spacingY = 0			//Vertical spacing of lower level submenus (+/-)
		this.maxRows=99				//Maximum number of vertical links in a submenu column (set to -1 for one column ONLY!)
		this.showHeader = false		//Display the title of any submenu(true/false)
		this.imageBlank = 'blank.gif'		//Image path of blank spacer gif
		this.imageArrow = 'arrow.gif'		//Image path of submenu arrow gif
		this.hideDelay = 1000		//Delay (m/s) to hide menus once moused out
		
	//Default styles
		this.style           = 'linksStyle'			//Style of menu
		this.styleHover      = 'linksHover'			//Style of menu (on mouse rollover)
		this.styleBackground = 'linksBackground'	//Border style of menus
		this.styleHeader     = 'linksStyle'		//Submenu header style
	
	//Assign unique ID to this link structure
		NickLinks_DivCounter++
		this.divID = NickLinks_DivCounter
	
	//Methods
		this.addlink   = NickLinks_Links;
		this.build     = NickLinks_Build;
		this.hidelinks = NickLinks_HideLinks;
		this.links     = NickLinks_Links;
		this.showlinks = NickLinks_ShowLinks;
	
}


//############################################################################
function NickLinks_Links(Link_Str){
	aTemp = Link_Str.split(']')
	for(i=0;i<aTemp.length-1;i++){
		
		//Get link level and parameters
			iTemp = aTemp[i].indexOf('[')
			Link_ArrLen = (this.linkArray).length
			Link_Params = (aTemp[i].substring(iTemp+1)).split('|')
		
		//Add link paramenters to array
			this.linkArray[Link_ArrLen] = new Array()
			this.linkArray[Link_ArrLen][0] = Math.floor(iTemp/3)+1
			for(j=0;j<Link_Params.length;j++){
				//Trim parameter
					while(Link_Params[j].indexOf(' ')==0){ Link_Params[j]=Link_Params[j].substring(1) }
					while(Link_Params[j].lastIndexOf(' ')==Link_Params[j].length-1 && Link_Params[j].length>0  ){ Link_Params[j]=Link_Params[j].substring(0,Link_Params[j].length-1) }
				//Save parameter in link array
					this.linkArray[Link_ArrLen][j+1] = Link_Params[j]
			}
			
	}
}


//############################################################################
function NickLinks_Build(){
	//Close links array
		this.linkArray[(this.linkArray).length] = new Array(-1,'END')
	//Draw Links
		NickLinks_DrawLinks(this, 1, 1)
}


//############################################################################
function NickLinks_DrawLinks(obj, Link_ArrayStart, Link_Level){
	
	//Set Variables
		var Link_Str = ''				//Link text(HTML) to display
		var Link_SubMenuHeader = ''		//Sublink header text to display
		var Link_Cols = 1				//Number of columns displayed
		var Link_ItemsDisplayed = 0		//Count of items displayed
	
	//Loop through links array
		for(i=Link_ArrayStart;i<obj.linkArray.length;i++){
			if(obj.linkArray[i][0]<Link_Level){break}			//No more lower level links - Exit loop
			if(obj.linkArray[i][0]==Link_Level){				//Is this link level with requesting link?
					
					//Start new column if MaxRows have been displayed...
					if(Link_ItemsDisplayed%obj.maxRows == 0 && Link_ItemsDisplayed>0){
						Link_Str+='</td><td width="' + obj.width + '" class="' + obj.style + '" valign="top">'
						Link_Cols++
					}

					//Start this link...
					Link_Str+='<table width="100%" cellpadding="0" cellspacing="0" border="0">'

					//Has this item got sublinks?? - YES
					if(obj.linkArray[i+1][0]>Link_Level){
						Link_Str+='<tr ' + NickLinks_BuildNavigation(obj, i ) + ' ONMOUSEOVER="NickLinks_Rollover(this,\'' + obj.styleHover + '\');NickLinks_ShowLinks_Do(this,' + obj.divID + ',' + (i+1) + ',' + (Link_Level+1) + ',' + obj.startXPos + ',' + obj.startYPos + ',' + obj.spacingX + ',' + obj.spacingY + ',' + obj.width + ', null);" ONMOUSEOUT="NickLinks_Rollover(this,\'' + obj.style + '\');">'
							Link_Str+='<td width="' + obj.textPadding + '" nowrap style="cursor:hand;" class="' + obj.style + '"><img src="../../marshallrental/includes/images/' + obj.imageBlank + '" width="' + obj.textPadding + '" height="' + obj.height + '" border="0"></td>'
							Link_Str+='<td nowrap style="cursor:hand;" class="' + obj.style + '">'
							Link_Str+=obj.linkArray[i][1]
							Link_Str+='</td>'
							Link_Str+='<td nowrap style="cursor:hand;" class="' + obj.style + '" align="right"><img src="../../marshallrental/includes/images/arrow.gif" border="0"></td>'
						Link_Str+='</tr>'
					}
					//Has this item got sublinks?? - NO
					else{
							switch((obj.linkArray[i][1]).toLowerCase()){
								case '<blank>':
									Link_Str+='<tr class="' + obj.style + '">'
										Link_Str+='<td><img src="../../marshallrental/includes/images/' + obj.imageBlank + '" width="' + obj.textPadding + '" height="' + (obj.height*0.8) + '" border="0"></td>'
									Link_Str+='</tr>'
									break;
								case '<hr>':
									Link_Str+='<tr class="' + obj.style + '">'
										Link_Str+='<td width="' + obj.textPadding + '"><img src="../../marshallrental/includes/images/' + obj.imageBlank + '" width="' + obj.textPadding + '" height="' + obj.height + '" border="0"></td>'
										Link_Str+='<td><hr width="100%"></td>'
										Link_Str+='<td width="' + obj.textPadding + '"><img src="../../marshallrental/includes/images/' + obj.imageBlank + '" width="' + obj.textPadding + '" height="' + obj.height + '" border="0"></td>'
									Link_Str+='</tr>'
									break;
								default:
									Link_Str+='<tr ' + NickLinks_BuildNavigation(obj, i ) + ' ONMOUSEOVER="NickLinks_Rollover(this,\'' + obj.styleHover + '\');NickLinks_HideLinks(' + (obj.linkArray[i][0]+1) + ')" ONMOUSEOUT="NickLinks_Rollover(this,\'' + obj.style + '\');">'
										Link_Str+='<td width="' + obj.textPadding + '" nowrap style="cursor:hand;" class="' + obj.style + '"><img src="../../marshallrental/includes/images/' + obj.imageBlank + '" width="' + obj.textPadding + '" height="' + obj.height + '" border="0"></td>'
										Link_Str+='<td nowrap style="cursor:hand;" class="' + obj.style + '">'
										Link_Str+=obj.linkArray[i][1]
										Link_Str+='</td>'
										Link_Str+='<td width="' + obj.textPadding + '" nowrap style="cursor:hand;" class="' + obj.style + '"><img src="../../marshallrental/includes/images/' + obj.imageBlank + '" width="' + obj.textPadding + '" height="' + obj.height + '" border="0"></td>'
									Link_Str+='</tr>'
							}
					}
					
					//Complete this link!
					Link_Str+='</table>'

					//Increment displayed item count
					Link_ItemsDisplayed++
			
			}
		}//End of for loop...
	
	//Add sub menu header
		if(Link_Level>1 && obj.showHeader){
				Link_SubMenuHeader+='<table width="100%" cellpadding="0" cellspacing="0" border="0">'
				Link_SubMenuHeader+='<tr class="' + obj.styleHeader + '">'
					Link_SubMenuHeader+='<td width="' + obj.textPadding + '" nowrap><img src="../../marshallrental/includes/images/' + obj.imageBlank + '" width="' + obj.textPadding + '" height="' + obj.height + '" border="0"></td>'
					Link_SubMenuHeader+='<td nowrap>'
					Link_SubMenuHeader+=obj.linkArray[Link_ArrayStart-1][1]
					Link_SubMenuHeader+='</td>'
					Link_SubMenuHeader+='<td width="' + obj.textPadding + '" nowrap><img src="../../marshallrental/includes/images/' + obj.imageBlank + '" width="' + obj.textPadding + '" height="' + obj.height + '" border="0"></td>'
				Link_SubMenuHeader+='</tr>'
				Link_SubMenuHeader+='</table>'
		}
	
	//Add containing div/table
		NickLinks_DivInfo[NickLinks_DivInfo.length] = new Array(obj.divID, Link_ArrayStart, Link_Level)
		Link_Str= '<div id="NickLinksDiv' + obj.divID + '-' + Link_ArrayStart + '" onmouseover="NickLinks_DivOver()" onmouseout="NickLinks_DivOut(' + obj.hideDelay + ')" style="position:absolute; z-index:' + (16384+NickLinks_DivInfo.length) + '; visibility:hidden; top:0px; left:0px; width:' + (obj.width*Link_Cols) + ';">' +
							Link_SubMenuHeader +
						'<table width="' + (obj.width*Link_Cols) + '" cellpadding="0" cellspacing="0" border="0" class="' + obj.styleBackground + '"><tr><td width="' + obj.width + '" class="' + obj.style + '" valign="top">' +
							Link_Str +
						'</td></tr></table>' +
						'<table cellpadding="0" cellspacing="0" border="0"><tr><td></td></tr></table>' +	// Mac IE Fix
					'</div>'
	
	//Draw links Divs
		document.write(Link_Str)
	
	//Build sublink divs
		for(var sl=Link_ArrayStart;sl<obj.linkArray.length;sl++){
			if(obj.linkArray[sl][0]<Link_Level){break}
			if(obj.linkArray[sl][0]==Link_Level){ if(obj.linkArray[sl+1][0]>Link_Level){ NickLinks_DrawLinks(obj, sl+1, Link_Level+1) } }
		}
	
}//All Done!


//############################################################################
function NickLinks_ShowLinks(elemID, elemAlign){
	if(elemID==null){ NickLinks_ShowLinks_Do(null, this.divID, 1, 1, this.startXPos, this.startYPos, this.offsetX, this.offsetY, this.width, elemAlign) }
	else{ NickLinks_ShowLinks_Do(elemID, this.divID, 1, 1, this.startXPos, this.startYPos, this.offsetX, this.offsetY, this.width, elemAlign) }
}
function NickLinks_ShowLinks_Do(elemID, divID, divSubID, divLinkLevel, objStartX, objStartY, objSpaceX, objSpaceY, objWidth, objAlign){
	
	//Mouse over... Clear hide timeout
		NickLinks_DivOver()
	//Hide all lower level links
		NickLinks_HideLinks(divLinkLevel)
	
	//No X-offset if top level link
		if(divLinkLevel==1 && elemID!=null){objWidth=0;objSpaceX=0}
	
	//If no element passed set X & Y pos as startup co-rods,else calculate X & Y pos.
		if(elemID==null){ var tmpX = objStartX ; var tmpY = objStartY }	//Absolute
		else{
			var tmpX = NickLinks_GetXPos(elemID) + objWidth + objSpaceX - 1
			var tmpY = NickLinks_GetYPos(elemID) + objSpaceY - 1
			if(objAlign=="XOnly"){ var tmpY = objStartY }
			if(objAlign=="YOnly"){ var tmpX = objStartX }
		}
	
	//Position links
		if(document.layers){
			var LayerID=document.layers['NickLinksDiv'+divID+'-'+divSubID].left = tmpX;
			var LayerID=document.layers['NickLinksDiv'+divID+'-'+divSubID].top = tmpY;
			var LayerID=document.layers['NickLinksDiv'+divID+'-'+divSubID].visibility = 'show';
		}
		else if(document.all){
			document.all['NickLinksDiv'+divID+'-'+divSubID].style.left = tmpX;
			document.all['NickLinksDiv'+divID+'-'+divSubID].style.top = tmpY;
			document.all['NickLinksDiv'+divID+'-'+divSubID].style.visibility='visible';
		}
		else{
			document.getElementById('NickLinksDiv'+divID+'-'+divSubID).style.left = tmpX;
			document.getElementById('NickLinksDiv'+divID+'-'+divSubID).style.top = tmpY;
			document.getElementById('NickLinksDiv'+divID+'-'+divSubID).style.visibility='visible';
		}
		
}


//############################################################################
function NickLinks_HideLinks(lLevel){
	if(lLevel==null){ lLevel = 1 }
	for(i=0;i<NickLinks_DivInfo.length;i++){
		if(NickLinks_DivInfo[i][2]>=lLevel){
			if(document.layers){ var LayerID=document.layers['NickLinksDiv'+NickLinks_DivInfo[i][0]+'-'+NickLinks_DivInfo[i][1]].visibility = 'hide';  }
			else if(document.all){ document.all['NickLinksDiv'+NickLinks_DivInfo[i][0]+'-'+NickLinks_DivInfo[i][1]].style.visibility='hidden'; }
			else{ document.getElementById('NickLinksDiv'+NickLinks_DivInfo[i][0]+'-'+NickLinks_DivInfo[i][1]).style.visibility='hidden'; }
		}
	}
}


//############################################################################
function NickLinks_Rollover(linkElem,linkStyle){
	if(!document.layers){
		//Change CSS style of child elements
	    var linkElemchild=linkElem.childNodes;
		for(i=0;i<linkElemchild.length;++i){linkElemchild[i].className = linkStyle; }
	}
}


//############################################################################
function NickLinks_BuildNavigation(obj, LinkID){
	var Link_URL = Link_Target = Link_JS = ''
	//Loop through (3) paramters
	for(k=4;k>=2;k--){
		//If parameter exists...
		if(obj.linkArray[LinkID][k]!=null){
			//Get parameter
				tmpStr = (obj.linkArray[LinkID][k]).toLowerCase()
			//Detect parameter type and store as required
				if(tmpStr.indexOf('target:')>=0){ Link_Target = (obj.linkArray[LinkID][k]).substring(7) }
				else if(tmpStr.indexOf('javascript:')>=0){ Link_JS += (obj.linkArray[LinkID][k]).substring(11) + ';' }
				else{ Link_URL = (obj.linkArray[LinkID][k]) }
		}
	}
	//Return results
	return 'ONCLICK="' + Link_JS + 'NickLinks_Navigate(\'' + Link_URL + '\',\'' + Link_Target + '\')"'
}


//############################################################################
function NickLinks_Navigate(URL,frame_Name){
	if(frame_Name==null){ frame_Name='' }
	//Detect reserved HTML target and action as necessary
		switch(frame_Name){
			case '':
				//Navigate self to URL
				location.href = URL 
				break;
			case '_blank':
				//open new window
				window.open(URL ,'','')
				break;
			case '_parent':
				//Navigate parent frame to URL
				parent.location.href = URL 
				break;
			case '_self':
				//Navigate self to URL
				location.href = URL 
				break;
			case '_top':
				//Navigate top frame to URL
				top.location.href = URL 
				break;
			default:
				//Navigate frame to URL
				for(i=0;i<parent.frames.length;i++){ 
					if(parent.frames[i].name==frame_Name){ parent.frames[i].location.href = URL; }
				}
		}
}


//############################################################################
function NickLinks_GetXPos(obj) {
	var x = 0
	if (!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE = document.all && !onWindows
		var par = obj;
		var lastOffset = 0;
		while(par){
			if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);
			if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);
			//if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;
			par = macIE ? par.parentElement : par.offsetParent;
		}
	} else if (obj.x) x += obj.x;
	return x;
}
function NickLinks_GetYPos(obj) {
	var y = 0
	if(!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE = document.all && !onWindows
		var par = obj;
		var lastOffset = 0;
		while(par){
			if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);
			if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);
			//if( par.offsetTop != 0 ) lastOffset = par.offsetTop;
			par = macIE ? par.parentElement : par.offsetParent;
		}
	} else if (obj.y >= 0) y += obj.y;
	return y;
}


//############################################################################
function NickLinks_DivOver(){
	//Clear hidelinks delay
		if(NickLinks_DivStatus!=null){ clearTimeout(NickLinks_DivStatus) }
		NickLinks_DivStatus=null
}
function NickLinks_DivOut(delayMs){
	//Set hidelinks delay
		NickLinks_DivStatus = setTimeout("NickLinks_DivTimeOut()", delayMs)
}
function NickLinks_DivTimeOut(){
	//Hide links if mouse not over
		if(NickLinks_DivStatus!=null){ NickLinks_HideLinks(); }
}
function on(gif)
{
document [gif].src= "images/menu/" + gif+"1.gif"
}
function off(gif)
{
document [gif].src="images/menu/" + gif+"0.gif"
}
function servon(gif)
{
document [gif].src= "images/on.gif"
}
function servoff(gif)
{
document [gif].src="images/off.gif"
}



