/////////////////////////////////////
/// Mouse Over ///
//////////////////
function move_in(img_name,img_src){document[img_name].src=img_src;}
function move_out(img_name,img_src){document[img_name].src=img_src;}

/////////////////////////////////////
/// Navigation Bar ///
//////////////////////
function nav(page){window.location=page}

//////////////////////////////////////
///// hidden layer effect ///
/////////////////////////////
function find_obj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=find_obj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function show_hide_layers() { 
  var i,p,v,obj,args=show_hide_layers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=find_obj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//////////////////////////////////////
///// Validate the contact form ///
///////////////////////////////////
function validate_contact() {
	if(document.contact.name.value == '') {
		alert("Please enter Your Name.");
		document.contact.name.focus();
		return false;
	}
	else if(document.contact.email.value == '') {
		alert("Please enter Your Email Address.");
		document.contact.email.focus();
		return false;
	}
	else if(document.contact.email.value != document.contact.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi)) {
		alert("Please enter a valid Email address.");
		document.contact.email.focus();
		return false;
	}
	else if(document.contact.number_responce.value == '') {
		alert("Please type number you see to the left.");
		document.contact.number_responce.focus();
		return false;
	}
	else {
		return true;
	}
}
