function hideIt(elm) {
  if (dom) {
  	document.getElementById(elm).style.visibility='hidden';
  	} else {
  	document.layers[elm].visibility='hide';
  }
}

function showIt(elm) {
  if (dom) {
  	document.getElementById(elm).style.visibility='visible';
  	} else {
  	document.layers[elm].visibility='show';
  }
}

function forHome() {
	hideIt("NavLine2");
	hideIt("NavLine2a");
	hideIt("NavContent1");
	hideIt("NavContent2");
}
function forAgency() {
	showIt("NavLine2");
	hideIt("NavLine2a");
	showIt("NavContent1");
	hideIt("NavContent2");
}
function forSnapshot() {
	showIt("NavLine2a");
	hideIt("NavLine2");
	hideIt("NavContent1");
	showIt("NavContent2");
}

function clientSwitch(now,next) {
	var Showing = "client"+now;
	var Hiding = "client"+next;
	hideIt(Hiding);
	showIt(Showing);
}

function goBack() {
	if (CurrentProj!=1) {
		sCurProj = CurrentProj-1;
	} else {
		sCurProj = MaxProj;
	}
	var Showing = "proj"+sCurProj;
	var Hiding = "proj"+CurrentProj;
	hideIt(Hiding);
	showIt(Showing);
	CurrentProj = sCurProj;
}

function goForward() {
	if (CurrentProj!=MaxProj) {
		sCurProj = CurrentProj+1;
	} else {
		sCurProj = 1;
	}
	var Showing = "proj"+sCurProj;
	var Hiding = "proj"+CurrentProj;
	hideIt(Hiding);
	showIt(Showing);
	CurrentProj = sCurProj;
}

function projectCompile(which) {
	for (var i = 1; i <= MaxProj; i++) {
		var finalProj = "<div class=\"Project\" id=\"proj" + i;
		if (i != CurrentProj) {
			finalProj += "\" style=\"visibility:hidden\">";
		} else {
			finalProj += "\">";
		}
		finalProj += "<iframe src=\"Projects/" + which + i + ".html\" height=\"500\" width=\"100%\" frameborder=\"0\"><\/iframe><\/div>";
		document.write(finalProj);
	}
}

function isEmail(elm) {
    if (elm.value.indexOf("@") + "" != "-1" && elm.value.indexOf(".") + "" != "-1" && elm.value != "") 
	return true;
	else return false;
}

function isFilled(elm) {
	if (elm.value == "" || elm.value == null) 
	return false;
	else return true;
}

function isPhone(elm) {
	var elmstr = elm.value + "";
	if (elmstr.length != 12) return false;
	for (var i = 0; i < elmstr.length; i++) {
		if ((i < 3 && i > -1) || (i > 3 && i < 7) || (i > 7 && i < 12)) {
			if (elmstr.charAt(i) < "0" || elmstr.charAt(i) > "9") return false;
		}
		else if (elmstr.charAt(i) != "-" || elmstr.charAt(i) != "/") return false;
	}
	return true;
}

function secondNav(elm) {
	var browserName=navigator.appName; 
	if (browserName=="Microsoft Internet Explorer") { 
 		document.write("<div id=\"NavLineIE" + elm + "\" style=\"visibility:hidden\">");
	} else { 
 		document.write("<div id=\"NavLine" + elm + "\" style=\"visibility:hidden\">");
   }
}

