// JavaScript Document

function resetSigninText() {
	if ("email address"==document.login.email_address.value) { 
		document.login.email_address.value = "";
		document.login.password.value = "";
		//document.login.password.type = "password";
		passit(document.getElementById("password"));
		
	}
}


function passit(ip) {
	var np=ip.cloneNode(true);
	np.type='password';
	if(np.value!=ip.value)
		np.value=ip.value;
	ip.parentNode.replaceChild(np,ip);
}

function resetSearchText() {
	
	if ("search..."==document.quick_find.keywords.value) {
		document.quick_find.keywords.value = "";
	}
}

function signinOver() {
	signinimg.src="images/signinMouseOver.gif";
}

function signinOut() {
	signinimg.src="images/signin.gif";
}

// PULLDOWN MENU SYSTEM
// Written by Adrian Borrmann  ::  http://www.adrianborrmann.com
// Copyright 2007
// Feel free to use this script, but please leave this citation in!

	   
bNS4 = bNS6 = bIE = bOPERA = false;
if     (navigator.userAgent.indexOf("Opera") != -1) { bOPERA = true; }
else if(navigator.userAgent.indexOf("Gecko") != -1) { bNS6 = true;   }
else if(document.layers)                            { bNS4 = true;   }
else if(document.all)                               { bIE = true;    }


 	function InitMenu() {
	
		if (bIE) {
			var bar = menuBar.children;
		
			for(var i=0;i < bar.length;i++) {
				var menu=eval(bar[i].menu)
				menu.style.visibility = "hidden"
				bar[i].onmouseover = new Function("ShowMenu("+bar[i].id+")")
				var Items = menu.children
			  
				for(var j=0; j<Items.length; j++) {
					var menuItem = eval(Items[j].id)
					
					if(menuItem.menu != null) { 
						FindSubMenu(menuItem.menu)
					}
				   
					if(menuItem.cmd != null) {
					menuItem.onclick = new Function("Do("+menuItem.id+")")
					} 
					   
					menuItem.onmouseover = new Function("highlight("+Items[j].id+")")
				
				}    
			}
		}
		else if (bNS6) {
				
			var bar = document.getElementById('menuBar');
			var childList = bar.childNodes;

			for (var i=0; i < childList.length; i++) {
				if (childList.item(i).id != null) {
					var attributes = childList.item(i).attributes;
					var menu = eval(attributes.item(0).value);
					menu.style.visibility = "hidden";
					
					var newattrib = document.createAttribute('onmouseover');
					newattrib.value = "ShowMenu("+attributes.getNamedItem('id').value+")";
					attributes.setNamedItem(newattrib);
					
					var Items = menu.childNodes;
					
					for (var j=0; j<Items.length; j++) {
						if (Items.item(j).attributes) {
							var menuItem = eval(Items.item(j).id);
							
							if (menuItem.attributes.getNamedItem('menu') != null) {
								FindSubMenu(menuItem.attributes.getNamedItem('menu').nodeValue);
							}
							
							if (menuItem.attributes.getNamedItem('cmd') != null) {
								menuItem.onclick = new Function("Do("+menuItem.id+")");
							}
							
							var anotherattrib = document.createAttribute('onmouseover');
							anotherattrib.value = "highlight("+Items.item(j).id+")";
							menuItem.attributes.setNamedItem(anotherattrib);
						}
					}
				}
			}
		}
	}
	function FindSubMenu(subMenu) {
		
		if (bIE) {
			var menu=eval(subMenu)
			var Items = menu.children
			for(var j=0; j<Items.length; j++) {
				menu.style.visibility = "hidden"
				var menuItem = eval(Items[j].id)
								  
				if(menuItem.menu!= null) {
					FindSubMenu(menuItem.menu)
				}
				if(menuItem.cmd != null) {
					menuItem.onclick = new Function("Do("+menuItem.id+")")
				} 
				menuItem.onmouseover = new Function("highlight("+Items.item(j).id+")");				
			}
		}
		else if (bNS6) {
			
			var menu = eval(subMenu);
			var Items = menu.childNodes;

			for (var j=0; j<Items.length; j++) {
				if (Items.item(j).attributes) {
					var menuItem = eval(Items.item(j).id);
					
					if (menuItem.attributes.getNamedItem('menu') != null) {
						FindSubMenu(menuItem.attributes.getNamedItem('menu').nodeValue);
					}
					
					if (menuItem.attributes.getNamedItem('cmd') != null) {
						menuItem.onclick = new Function("Do("+menuItem.id+")");
					}
					var anotherattrib = document.createAttribute('onmouseover');
					anotherattrib.value = "highlight("+Items.item(j).id+")";
					menuItem.attributes.setNamedItem(anotherattrib);

				}
			}
		}
	} 
	function ShowMenu(obj) {

		
		if (bIE) {
			HideMenu(menuBar)
			var menu = eval(obj.menu)
			var bar = eval(obj.id);
			var clientWidth = document.body.clientWidth;
			var spacer = (800 - clientWidth) / 2;
			//alert(clientWidth);
			bar.className="barOver"
			menu.style.visibility = "visible"			
			menu.style.position = "absolute";
			//alert(obj.innerHTML);
			menu.style.left = obj.getBoundingClientRect().left + spacer - 2;
			//alert(menu.style.marginLeft);
			//alert(menu.style.left);
			menu.style.top = obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop;
		}
		else if (bNS6) {
			
			HideMenu(document.getElementById('menuBar'));
			
			var menu = document.getElementById(obj.attributes.getNamedItem('menu').value);
			obj.className="barOver";
			menu.style.visibility = "visible";
			menu.style.position = "absolute";
			menu.style.left = document.getBoxObjectFor(obj).x - 8;
			menu.style.top = document.getBoxObjectFor(obj).y + obj.offsetHeight + Bdy.scrollTop;
		}
	}
	function highlight(obj) {
		
		if (bIE) {
			var PElement = eval(obj.parentElement.id)
			if (PElement.hasChildNodes() == true) {
				var Elements = PElement.children
				for(var i=0;i<Elements.length;i++) {
					TE = eval(Elements[i].id)
					TE.className = "menuItem"
				}
			} 
			obj.className="ItemMouseOver"
			window.defaultStatus = obj.title
			ShowSubMenu(obj)
		}
		else if (bNS6) {

			var PElement = obj.parentNode;
			if (PElement.hasChildNodes() == true) {
				var Elements = PElement.childNodes;
				for (var i=0; i<Elements.length; i++) {
					var element = Elements.item(i);
					element.className = "menuItem";
				}
			}
			obj.className = "ItemMouseOver";
			window.defaultStatus = obj.title;
			ShowSubMenu(obj);
		}
	}   
	function Do(obj) {
		
		if (bIE) {
			var cmd = eval(obj).cmd	
			window.navigate(cmd)
		}
		else if (bNS6) {
			var cmd = obj.attributes.getNamedItem('cmd').value;
			window.location = cmd;
		}
	}
	function HideMenu(obj) {
		
		if (bIE) {
			if (obj.hasChildNodes()==true) {
				var child = obj.children
					 
				for(var j =0;j<child.length;j++) {
					if (child[j].className=="barOver") {
						var bar = eval(child[j].id)
						bar.className="Bar"
					}
							  
					if (child[j].menu != null) {
						var childMenu = eval(child[j].menu)
						if (childMenu.hasChildNodes()==true) 
							HideMenu(childMenu)
						

						childMenu.style.visibility = "hidden" 
					}
				}
					  
			}
		}
		else if (bNS6) {
			
			if (obj.hasChildNodes() == true) {
				var child = obj.childNodes;
				
				for (var j=0; j<child.length; j++) {
					if (child.item(j).attributes) {
						if (child.item(j).className == "barOver") {
							child.item(j).className="Bar";
						}
						
						if (child.item(j).hasChildNodes() == true) {
							
							if (child.item(j).attributes.getNamedItem('menu')) {
								var childMenuName = child.item(j).attributes.getNamedItem('menu').value;
								var childMenu = document.getElementById(childMenuName);
								if (childMenu.hasChildNodes() == true) {
									HideMenu(childMenu);
								}
								childMenu.style.visibility = "hidden";
							}
						}
					}
				}
			}
		}
	}
	function ShowSubMenu(obj) {
		
		if (bIE) {
			PMenu = eval(obj.parentElement.id)
			HideMenu(PMenu)
			if(obj.menu != null) {
				var menu = eval(obj.menu)
				menu.style.visibility = "visible"
				
				menu.style.position = "absolute";
				//menu.style.left = obj.getBoundingClientRect().right;
				menu.style.left = 200;
				menu.style.top = obj.getBoundingClientRect().top + Bdy.scrollTop;
			}
		}
		else if (bNS6) {
			var parentMenu = obj.parentNode;
			HideMenu(parentMenu);
			
			if (obj.attributes.getNamedItem('menu')) {
				var menu = document.getElementById(obj.attributes.getNamedItem('menu').value);
				menu.style.visibility = "visible";
				menu.style.position = "absolute";
				menu.style.left = document.getBoxObjectFor(obj).x + obj.clientWidth;
				menu.style.top = document.getBoxObjectFor(obj).y + Bdy.scrollTop;
			}
		}
	}