var id=null;
var urlI = "img/";
var nameMenuItem = "";
var smName;
var activeFlag = 0;
var smFlag = 1;
var idContent = 0;
var unDef;
var locHref;

function isIE5() { return (navigator.userAgent.indexOf("MSIE 5") > -1); }
function isIE6() { return ((navigator.userAgent.indexOf("MSIE 6") > -1) && (navigator.userAgent.indexOf("Opera") == -1)); }
function isIE() { return (isIE5() || isIE6());}
var isIE = isIE();

function doContent(id,ank) {	
	if(id!=idContent) {
		if(idContent!=0) {			
			document.getElementById("li"+idContent).className = "h3-list-off";
			document.getElementById("li"+idContent+"-cont").className = "cont-off";
			document.getElementById("link"+idContent).title = "click to expand";
		}
		idContent = id;		
		document.getElementById("li"+idContent).className = "h3-list-on";
		document.getElementById("li"+idContent+"-cont").className = "cont-on";
		document.getElementById("link"+idContent).title = "click to hide";
		if (!isIE) {
			if (ank!=unDef) {
				locHref=document.location.href;
				if (locHref.indexOf("#")!=-1) locHref=locHref.substring(0,(locHref.indexOf("#")))
				document.location.href=locHref+"#"+ank;
			}
		}
		else {
			if (ank!=unDef) {
				locHref=document.location.href;
				if (locHref.indexOf("?")!=-1) locHref=locHref.substring(0,(locHref.indexOf("?")))
				else if (locHref.indexOf("#")!=-1) locHref=locHref.substring(0,(locHref.indexOf("#")));
				document.location.href=locHref+"#"+ank;
			}
		}
	}
	else {		
		document.getElementById("li"+id).className = "h3-list-off";
		document.getElementById("li"+id+"-cont").className = "cont-off";
		document.getElementById("link"+id).title = "click to expand";
		idContent = 0;
	}
}

function doSMC0ntent() {
	var urlPar="";
	var urlNumb;
	urlPar = urlPar+location;
	if (urlPar.indexOf("?")!=-1) {		
		urlPar = urlPar.substring(urlPar.indexOf("?")+1,urlPar.indexOf("num"));
		urlNumb = parseInt(urlPar);
		doContent(urlNumb);
	}
}

function DoOver(iname,smenu){	

	if (nameMenuItem != "") {
		smFlag = 1;
		DoHide();
	}
	
	if (iname == nameMenuItem) smFlag = 0;
	else {
		nameMenuItem = iname;
	
		smName = smenu;
		if(smName != undefined) {
			document.getElementById(nameMenuItem).className = "on";
			document.getElementById(smName).className = "sm-on";			
			activeFlag = 1;
		}	
	}	
	
}

function killtimer(){

	if(id!=null){
		clearTimeout(id);
		id=null;		
	}

	return true;
}

function DoHide(){	

	if (smFlag) {

		if(id!=null) {
			killtimer();		
		}
			
		if(smName != undefined) {		
			document.getElementById(smName).className = "sm-off";
			if (nameMenuItem!=("mi"+mItemOn)) document.getElementById(nameMenuItem).className = "off";
			smName = undefined;
			activeFlag = 0;		
		}		
		
		nameMenuItem = "";
	
	}

}

function reset(){
	
	killtimer();
	
	if (activeFlag) {		
		id = setTimeout('DoHide()', 500);
	}
	else {
		if(smName != undefined) {
			document.getElementById(smName).className = "sm-off";
			if (nameMenuItem!=("mi"+mItemOn)) document.getElementById(nameMenuItem).className = "off";
		}
		nameMenuItem = "";
	}
		
}

function DoOut(aSMflag) {
	if (aSMflag) {
		smFlag = 1;
		reset();
	}
	else smFlag = 0;
}
function checkIt(theForm) {
	if (theForm.Name.value == "") {
		alert("Please fill out the 'Name' field.");
		theForm.Name.focus();
		return false;
	}
	if (theForm.Email.value == "") {
		alert("Please fill out the 'Email' field.");
		theForm.Email.focus();
		return false;
	}
	else if (theForm.Email.value.indexOf ( "@" ,1 ) == -1 ) { 
		alert("Please use the format you@data.com for the e-mail field." ) ;
		theForm.Email.focus();
		return false
	}
	if (theForm.Phone.value == "") {
		alert("Please enter the 'Phone' field.");
		theForm.Phone.focus();
		return false;
	}
	if (theForm.Industry.value == "") {
		alert("Please fill out the 'Business Name & Industry:' field.");
		theForm.Industry.focus();
		return false;
	}
}

