function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.0

  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=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}

//

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; 

  

  document.MM_sr=new Array; 

  for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null)

   {

   		document.MM_sr[j++]=x; 

		if(!x.oSrc) 

			x.oSrc=x.src; 

		x.src=a[i+2];

	}

}



function onMouseOverCSS(number)

{

	if (document.all) // Internet Explorer			

		tempReference = eval ("document.all.navText" + number+ ".style");

	else			

		tempReference = eval ("document.getElementById('navText" + number+ "').style");			

					

	tempReference.color = "#ffb900";	

}		



function onMouseOutCSS(number)

{

	if (document.all) // Internet Explorer			

		tempReference = eval ("document.all.navText" + number+ ".style");

	else

		tempReference = eval ("document.getElementById('navText" + number+ "').style");			



	tempReference.color = "#ffffff";					

}		



function onMouseOutImage(number)

{

	MM_swapImgRestore();

	//onMouseOutCSS(number);

	

}

function onMouseOverImage(number)

{

	switch (number)

	{

		case 1: MM_swapImage('image4','','images/icon_who_on.gif',4);						

				break;

		case 2: MM_swapImage('image5','','images/icon_what_on.gif',5);

				break;

		case 3: MM_swapImage('image6','','images/icon_work_on.gif',6);

				break;

	}

	//onMouseOverCSS(number);

				

}



if (document.images) {



// Active images

who_we_are_on = new Image(); 

who_we_are_on.src = "images/bt_home_1_on.gif";



what_we_do_on = new Image();

what_we_do_on.src = "images/bt_home_2_on.gif";



our_work_on = new Image();

our_work_on.src = "images/bt_home_3_on.gif";



contact_us_on = new Image();

contact_us_on.src = "images/bt_home_4_on.gif";



highlights_on = new Image();

highlights_on.src = "images/bt_highlights_on.gif";





// Inactive images

who_we_are_off = new Image(); 

who_we_are_off.src = "images/bt_home_1_off.gif";



what_we_do_off = new Image();

what_we_do_off.src = "images/bt_home_2_off.gif";



our_work_off = new Image();

our_work_off.src = "images/bt_home_3_off.gif";



contact_us_off = new Image();

contact_us_off.src = "images/bt_home_4_off.gif";



highlights_off = new Image();

highlights_off.src = "images/bt_highlights_off.gif";



}



function imgOn(imgName) {



if (document.images) {

document[imgName].src = eval(imgName + "_on.src");

}



}



function imgOff(imgName) {



if (document.images) {

document[imgName].src = eval(imgName + "_off.src");

}



}





function validEmail(email) 



	 {

	

		invalidChars = " /:,;"

	

		if (email == "") {

	

			return false

	

		}

	

		for (i=0; i<invalidChars.length; i++) {

	

			   badChar = invalidChars.charAt(i)

	

			   if (email.indexOf(badChar,0) != -1) {

	

					   return false

	

			   }

	

		}

	

	   

	

		atPos = email.indexOf("@",1)

	

		if (atPos == -1) {

	

		  return false

	

		}

	

	

	

		if (email.indexOf("@",atPos+1) != -1) {

	

		  return false

	

		}

	

	

	

		periodPos = email.indexOf(".",atPos+1)

	

		if (periodPos == -1) {

	

		  return false

	

		}	           			

	

		if (periodPos+3 > email.length) {

	

		  return false

	

		}

	

		return true

	

	}



function isEmpty(str)

{

	try

	{

		var found = str.match(/\S+/);

		if(found==null)

		{

			return true;

		}

		else

		{

			return false;

		}

	}

	catch (e)

	{

		

	}

}



function openWindow(theURL,width,height) 

{

	if (width == undefined)

	{

		width = 600;

	}

	

	if (height == undefined)

	{

		height = 400;

	}

	theURL = contextPath + '/docs/terms_of_use/terms_of_use_popup.jsp?id=' + theURL + '.jsp';

	var newWindow = window.open(theURL,'new_window','scrollbars,resizable,width=' + width +',height=' + height);

	newWindow.focus();

}


