// 	EJFIIIWebDesign.com General API(JavaScript)
// 	Author : EJFIIIWebDesign.com

//	Browser Brand Determination
	var isIE=false; var isNN=false; var isOP=false; isFF=false; 
	if (navigator.userAgent.indexOf("Opera")!=-1) isOP=true;
	if ((navigator.appName.indexOf("Microsoft")!=-1) && (navigator.userAgent.indexOf("Opera")==-1)) isIE=true;
	if (navigator.userAgent.indexOf("Firefox")!=-1) isFF=true;
	if ((navigator.appName.indexOf("Netscape")!=-1) && (navigator.userAgent.indexOf("Firefox")==-1)) isNN=true;
	if (isIE) {
		if (navigator.appVersion.indexOf("MSIE 7.0") > 0) {
			document.write("<link rel='stylesheet' href='http://www.ejfiiiwebdesign.com/Style_IE7.css' type='text/css' />");
			}
		}

//	Reposition Content for Window Containers set Smaller than Content
// 	Necessary to prevent non-scrollable off screen content with negative margin style sheet centering method
	function checkVerticalPosition() {
	var viewHeight = 0, contentHeight = 680; thresholdHeight = 600;

	// 	Determine Available Window Size
  		if (isIE) {viewHeight = document.documentElement.clientHeight;}
		else{viewHeight = window.innerHeight;} 

	// 	Set Content Window Coordinates
		if (viewHeight < thresholdHeight) {
			document.getElementById('verticalPosition').style.top = 310+"px";
			}
		}


//	Change Key Image View
	var keyImage_position = 1;
	function changeKeyImage(direction) {
		if (direction == "back") {
			keyImage_position--;
			keyImage_position = (keyImage_position < 1) ? keyImage_Count : keyImage_position;
		}else{
			keyImage_position++;
			keyImage_position = (keyImage_position > keyImage_Count) ? 1 : keyImage_position;
			}
		document.getElementById('keyImage_src').src = keyImage_category + "_" + keyImage_position +".jpg";
		}

//	Launch External Document
	function launch(file,type) {
		popUpWin=window.open(file+"."+type, file, "width=696px,height=690px,toolbar=0,status=0,menubar=0,scrollbars=1,resizable=1,location=0");
		if (window.focus) {popUpWin.focus();}
		}

//	Clear Default Input Field Value on Focus
	function clearText(value) {
		testValue = document.getElementsByName("First")[0].value;
		if (value == "First") document.getElementsByName("First")[0].value = "";
		if (value == "Last Name") document.getElementsByName("Last")[0].value = "";
		}

//	Select Menu Go Button Function
	function go() {
		urlAddress = document.getElementsByName('client')[0].value;
		if (urlAddress) window.location.href = urlAddress;
		}
