
var menuComplete = true
	
	
function activateDropDownMenus()	{

	/* check the browser is capable of recognising the DOM objects
	   we need to implement the script - otherwise return false and allow the normal link to be executed */
	   
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("topMenu")) return false;
	
	
	/* get the reference to the mainnav object and then create an array 
	   of all the <ul> tags found in the array. To each href link we find we will
	   set the target attribute to _blank to force the link to open in a new browser window */
	
	
	var dropDowns = document.getElementById("topMenu").getElementsByTagName("li"); 

			

	if (dropDowns.length > 0) {
		
			for(i = 0; i < dropDowns.length; i++) {

					
						
						
						//if (dropDowns[i].className == "viewRange") {
												

												dropDowns[i].onmouseover = function() {
										
												
														showMenu(this)
											
													}
													
														dropDowns[i].onmouseout = function() {
								
															hideMenu(this)
											
														}													
													
												
																		
						//}
																															
			}
			
	}	   
	
}


function showMenu(subMenu)	{

					

	
	if (subMenu.hasChildNodes){

		children = subMenu.childNodes
				
			for(j=0 ; j < children.length; j++) {
							
									
				if(children[j].nodeName == "UL") {
					
					node = children[j]
					node.style.display = "block"
					node.style.zIndex = 50


				}	
								
			
		}
	
	}
	

	
return true

}




function animateOpening(el) {
	

	el.clippingRectangle[1] += 20
	

	if(el.clippingRectangle[1] >= el.savedOW) {
		
		el.clippingRectangle[1]= el.savedOW
		el.clippingRectangle[2] += 20
		
		if(el.clippingRectangle[2]>= el.savedOH){
			
			el.clippingRectangle[2]= el.savedOH	
			clearInterval(el.intervalID)
			
		}
		
	}
	
	el.style.clip = 'rect(' + el.clippingRectangle.join('px ') + 'px)'
	el.style.display = 'block'
			
}







function hideMenu(subMenu)	{
	

	if (subMenu.hasChildNodes){
				
		children = subMenu.childNodes

			for(j=0 ; j < children.length; j++) {
											
				if(children[j].nodeName == "UL") {
				
					node = children[j]
					node.style.display = "none"
	

				}
				
					
			}
	
	}


	return true
}


function animateClosing(el){
	
	el.clippingRectangle[2] -= 20
	
	if(el.clippingRectangle[2] <= 4){
		
		el.clippingRectangle[2] = 4	
		el.clippingRectangle[1] -= 20
		
		if(el.clippingRectangle[1] <= 0){
			
			clearInterval(el.intervalID)

				
		}
		
	}

	el.style.clip = 'rect(' + el.clippingRectangle.join('px ') + 'px)'

						
						
}
