// JavaScript Documentfunction setIEOverState (rootNode) {	for (i=0; i<rootNode.childNodes.length; i++) {		node = rootNode.childNodes[i];		if (node.nodeName=="LI") {			node.onmouseover=function() {				this.className+=" over";			}			node.onmouseout=function() {				this.className=this.className.replace(" over", "");			}			/*			// recurse! - look for sub menus [EXTREMELY BROKEN]			for (j = 0; j < node.childNodes.length; j++) {				subNode = node.childNodes[j];				if (subNode.nodeName == "UL") {					document.getElementById("debug").innerHTML += subNode.nodeName + " ";					setIEOverState(subNode);				}			}*/		}	}}startList = function() {	if (document.all&&document.getElementById) {		var ids = Array("nav");		for (id = 0; id < ids.length; id++) {			setIEOverState(document.getElementById(ids[id]));		}	}}function validateClose(){	if(form_action!='save-action') return true	if (document.getElementById('action_field').value=='close'){		if (confirm("Are you sure you wish to close this lead?")){			if (document.getElementById('notes').value=='')	{				alert("You must add a note before closing the Lead");				return false;			} else return true;		}else return false;	}else if(document.getElementById('action_field').value=='pending_contract'){			if (document.getElementById('projected_closing_date').value=='')	{				alert("Please fill in Projected Closing Date");				return false;			} 			if (document.getElementById('property_address').value=='')	{				alert("Please fill in Property Address");				return false;			} 						return true;	}else{		return true;		}}function confirmArchive(url) {	var answer = confirm("Are you sure you want to archive this lead?")	if (answer){		// alert("Deleted!")		window.location = url;	}	else{		alert("Archive cancelled.")	}}function showPreview(lead_id){	if(document.getElementById('lead_'+lead_id).style.display==''){		document.getElementById('lead_'+lead_id).style.display='none';	}else{		document.getElementById('lead_'+lead_id).style.display='';		document.getElementById('frame_lead_'+lead_id).src='frame_leads_view.php?v='+lead_id;	}}function showAdmins(action){	if(action.value=='pending_contract'){		document.getElementById('div_admins').style.display='';	}else{		document.getElementById('div_admins').style.display='none';	}}function resizeFrame(frame_object){	if(document.frames)		frame_object.style.height =document.frames[frame_object.name].document.body.scrollHeight + 5		else		frame_object.style.height =frame_object.contentDocument.body.scrollHeight + 5	}window.onload=startList;