<!--// Javascript Document


// This variable code courtesy of:
// Script written by SuperDezign.com
// Copyright 2007
	var DOM	= document.getElementById;	// DOM browser
	var IE	= document.all;				// IE browser
	var NS	= document.layers;			// Netscape browser
// End SuperDezign.com vars
			


				/* Simple Javascript validation before the server validates it. */
				re = /[\<\>@#\$%\^\&\+=\{\}\[\]\|\\/]/;
				re2 = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
			function CheckData(myform)	{
					
					
					if (myform.name.value == "")	{
						alert("Please Enter Your Name.");
						myform.name.focus();
						myform.name.select();
						var problem = true;
					}
					
					
					if	(re2.test(myform.email.value)==false)	{
						alert("Please enter a valid email address!");
						myform.email.focus();
						myform.email.select();
						var problem = true;
					}
					
					
					
					if (myform.email.value == "") 	{
						alert("Please Enter Your Email.");
						myform.email.focus();
						myform.email.select();
						var problem = true;
					}	else if	(myform.email.value == "email@example.com")	{
						alert("Please Enter Your Email.");
						myform.email.focus();
						myform.email.select();
						var problem = true;
					}
						
					
					
					
					if (myform.message.value == "")	{
						alert("Please Enter a Message.");
						myform.message.focus();
						myform.message.select();
						var problem = true;
					}

					if	(re.test(myform.message.value))	{
					 	alert("These symbols are not allowed: @ # $ % ^ & + = { } [ ] | \ / < >");
					 	myform.message.focus();
					 	myform.message.select();
					 	var problem = true;
					 	
					}
					
					if (problem==true)	{
						return false;
					} else	{
						return true;
					}
					
				}
				
				
				// Clear the field of a text area when the user clicks
				function clearField(obj)	{
					if	(obj.defaultValue==obj.value)
						obj.value='';
				}
				
				
				
				
// Pop up layer for form information.
var objPopUp = null;
function popUp(whichLink) {
	fetchData('dataPage.php',whichLink,'popUpMessage');
	objPopTrig = document.getElementById(whichLink);
	objPopUp = document.getElementById('popUpMessage');

	objPopUp.innerHTML='<b>Loading</b>';
	
	
	if (objPopTrig = document.getElementById(whichLink))	{
		xPos = objPopTrig.offsetLeft;
		yPos = objPopTrig.offsetTop + objPopTrig.offsetHeight;
	}

	if (IE)	{// Check for IE
		xPos = objPopTrig.offsetLeft;
		yPos = objPopTrig.offsetTop + objPopTrig.offsetHeight;
	}
	
	if (DOM)	{// Check for DOM browsers
		xPos = objPopTrig.offsetLeft;
		yPos = objPopTrig.offsetTop + objPopTrig.offsetHeight;

	}
	
	//alert('xPos=' + xPos + ': yPos=' + yPos +':');
	
	if (xPos + objPopUp.offsetWidth >  document.body.clientWidth) xPos = xPos - objPopUp.offsetWidth;
	if (yPos + objPopUp.offsetHeight >  document.body.clientHeight) yPos = yPos - objPopUp.offsetHeight - objPopTrig.offsetHeight;
	//objPopUp.style.left = xPos + 'px';
	//objPopUp.style.top = yPos + 'px';
	
	// These work for FireFox 2.0,  Camino1.0.3, Safari2.0.4
	objPopUp.style.left = (xPos + 113) +'px';
	objPopUp.style.top = (yPos + 228) + 'px';
	
	// Opera9.10,
	
	/*
	if (IE)	{// Check for IE
		objPopUp.style.left = xPos +'px';
		objPopUp.style.top = yPos + 'px';
	
	}*/
	
	objPopUp.style.visibility = 'visible';
	//alert('x: ' + xPos + 'px; y: ' + yPos + 'px');
	
	



}

function popHide() {
	objPopUp.style.visibility = 'hidden';
	objPopUp = null;
}

function filterData(pageRequest,objectID){
	if (pageRequest.readyState == 4 && (pageRequest.status==200 || window.location.href.indexOf("http")==-1))
		document.getElementById(objectID).innerHTML=pageRequest.responseText
}





/*
function findTop(objectID) {
	var object = document.getElementById(objectID);
	if (object.offsetTop)
		return object.offsetTop;
	if (IE)
		return object.offsetTop;
	return (null);
}
function findLeft(objectID) {
	var object = document.getElementById(objectID);
	if (object.offsetLeft)
		return object.offsetLeft;
	if (IE)
		return object.offsetLeft;
	return (null);
}
function findBottom(objectID) {
	var object = document.getElementById(objectID);
	if (object.offsetTop)
		return object.offsetTop + object.offsetHeight;
	if (IE)
		return object.offsetTop + object.offsetHeight;
	return (null);
}
function showPosTLB(evt) {
	var objectID = (evt.target) ? evt.target.id : ((evt.srcElement) ? evt.srcElement.id : null);
	if (objectID) {
		leftPos = findLeft(objectID);
		topPos = findTop(objectID);
		bottomPos = findBottom(objectID);
		alert('Left: ' + leftPos + 'px; Top: ' + topPos + 'px; Bottom: ' + bottomPos + 'px' );
	}
	else return (null);
}*/

function whatIsThis(popNum) {
	//message = document.getElementById(popNum);
	if (popNum=='pop1')	{
		message="Because of possible security risks and also because I view email in plain text mode, certain characters are not allowed. to see a list of these characters press ok or look on the contact form page.";
	}
	if (popNum=='pop2')	{
		message="In order to stop \'spambots\' from using certain web services, a security image is randomly generated. Because computers as of current have an inability to read distorted text, this will determine a human from a machine user.";
	}
	
	if (confirm(message))	{
	
	} else {
		window.location="contact.php";
		
	}

}



					
		//-->
