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];}}
	MM_preloadImages('images/inner/home-over.jpg','images/inner/media-over.jpg','images/inner/about-over.jpg','images/inner/experience-over.jpg','images/inner/healthcare-over.jpg','images/inner/why-over.jpg','images/inner/youGet-over.jpg','images/inner/employment-over.jpg','images/inner/contact-over.jpg');
}

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 MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function OnImgLoad()
{
if (g_fPlayMode)
window.setTimeout("Tick()", g_dwTimeOutSec*1000);
}

g_fPlayMode = 0;
g_iimg = -1;
g_imax = 0;
g_ImageTable = new Array();

function ChangeImage(fFwd)
{
if (fFwd)
{
if (++g_iimg==g_imax)
g_iimg=0;
}
else
{
if (g_iimg==0)
g_iimg=g_imax;
g_iimg--;
}
Update();
}

function getobject(obj){
if (document.getElementById)
return document.getElementById(obj)
else if (document.all)
return document.all[obj]
}

function Update(){
getobject("_Ath_Slide").src = g_ImageTable[g_iimg][0];

}


function Play()
{
g_fPlayMode = !g_fPlayMode;
if (g_fPlayMode)
{
getobject("btnPrev").disabled = getobject("btnNext").disabled = true;
Next();
}
else 
{
getobject("btnPrev").disabled = getobject("btnNext").disabled = false;

}
}
function OnImgLoad()
{
if (g_fPlayMode)
window.setTimeout("Tick()", g_dwTimeOutSec*1000);
}
function Tick() 
{
if (g_fPlayMode)
Next();
}
function Prev()
{
ChangeImage(false);
}
function Next()
{
ChangeImage(true);
}


////configure below variables/////////////////////////////

g_ImageTable[g_imax++] = new Array ("../images/inner/gif_animate1.jpg");
g_ImageTable[g_imax++] = new Array ("../images/inner/gif_animate2.jpg");
g_ImageTable[g_imax++] = new Array ("../images/inner/gif_animate3.jpg");
g_ImageTable[g_imax++] = new Array ("../images/inner/gif_animate4.jpg");
g_ImageTable[g_imax++] = new Array ("../images/inner/gif_animate5.jpg");
g_ImageTable[g_imax++] = new Array ("../images/inner/gif_animate6.jpg");
g_ImageTable[g_imax++] = new Array ("../images/inner/gif_animate7.jpg");
g_ImageTable[g_imax++] = new Array ("../images/inner/gif_animate9.jpg");;
g_ImageTable[g_imax++] = new Array ("../images/inner/gif_animate10.jpg");

//extend the above list as desired
g_dwTimeOutSec=3
////End configuration/////////////////////////////

if (document.getElementById||document.all)
window.onload=Play()
/*------------------inner pages pull down menus-------------------*/
function mmLoadMenus() {
  if (window.mm_menu_0406194707_0) return;
  window.mm_menu_0406194707_0 = new Menu("root",162,22,"Arial, Helvetica, sans-serif",10,"#000000","#ffffff","#fdfe00","#3a3a3a","left","middle",12,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0406194707_0.addMenuItem("THE PEOPLE","location='people.htm'");
  mm_menu_0406194707_0.addMenuItem("THE TRAINING","location='training.htm'");
  mm_menu_0406194707_0.addMenuItem("THE TOOLS","location='tools.htm'");
  mm_menu_0406194707_0.addMenuItem("THE FOLLOW UP","location='follow_up.htm'");
  mm_menu_0406194707_0.addMenuItem("THE RESULTS","location='why_space.htm'");
   mm_menu_0406194707_0.hideOnMouseOut=true;
   mm_menu_0406194707_0.bgColor='#';
   mm_menu_0406194707_0.menuBorder=0;
   mm_menu_0406194707_0.menuLiteBgColor='#';
   mm_menu_0406194707_0.menuBorderBgColor='#';

mm_menu_0406194707_0.writeMenus();
}
/*------------------inner pages pull down menus-------------------*/

function holdlink(id)
{
	if(id=='about'){
	document.getElementById('img_'+id).src='../images/inner/about-over.jpg';
	}
	else if(id=='media'){
	document.getElementById('img_'+id).src='../images/inner/media-over.jpg';
	}
	else if(id=='experience'){
	document.getElementById('img_'+id).src='../images/inner/experience-over.jpg';
	}
	else if(id=='healthcare'){
	document.getElementById('img_'+id).src='../images/inner/healthcare-over.jpg';
	}
	else if(id=='why'){
	document.getElementById('img_'+id).src='../images/inner/why-over.jpg';
	}
	else if(id=='youGet'){
	document.getElementById('img_'+id).src='../images/inner/youGet-over.jpg';
	}
	else if(id=='employment'){
	document.getElementById('img_'+id).src='../images/inner/employment-over.jpg';
	}
	else if(id=='contact'){
	document.getElementById('img_'+id).src='../images/inner/contact-over.jpg';
	}
}

function media(path)
{

	var NewWin3;
	NewWin3=window.open(path+'.htm','NewWin1','height=620,width=621,top=10,left=150,location=no,status=no,toolbar=no,menubar=no,scrollbars=yes');
	NewWin3.focus();
}

/*------------include function---------------------*/
function include_file(id, url) {
	
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
  if (req) {
    // Synchronous request, wait till we have it all
	req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } 
}
/*------------include function---------------------*/

function validateAnnouncement(e){
	form = document.frm;
	if(trim(form.f.value)==""){
		alert("Please browse for the image.");
		form.f.focus();
		return false;
	}
	if(trim(form.title.value)==""){
		alert("Please enter the title.");
		form.title.focus();
		return false;
	}
	form.action="db_announcements.php?e="+e;
	form.submit();
}

function validateAccountInformation()
{
	form = document.frm_accountInformation;
	if(trim(form.admin_email.value)=="")
	{
		alert("Please Enter E-mail");
		form.admin_email.focus();
		return false;
		}
	else if(checkEmailAddress(form.admin_email.value)=="")
	{
		alert("Please Enter Valid E-mail");
		form.admin_email.focus();
		return false;
		}	
	
	form.action = "db_accountInformation.php";
	form.submit();
	return true;
	
	}	
function validateChangePassword()
{
	form = document.changepassword;
	if(trim(form.oldPass.value)=='')
	{
		alert("Please Enter Old Password");
		form.oldPass.focus();
		return false;
		}
	if(trim(form.newPass.value)=='')
	{
		alert("Please Enter New Password");
		form.newPass.focus();
		return false;
		}	
	if(trim(form.cNewPass.value)=='')
	{
		alert("Please Enter Confirm Password");
		form.cNewPass.focus();
		return false;
		}	
	if(form.newPass.value!=form.cNewPass.value)
	{
		alert("New Password and Confirm Password are not matched ");
		form.cNewPass.focus()
		return false;
		}
	form.action = "db_changePassword.php";
	form.submit();
	}	
	
function validatecontactinfo(){
		form = document.frm;
		if(trim(form.fname.value)==""){
			alert("Please enter first name.");
			form.fname.focus();
			return false;
		}else if(checkname(form.fname.value)=="") {
			alert("Please Enter valid first name");
			form.fname.focus();
			return false;
		}
		if(trim(form.lname.value)==""){
			alert("Please enter last name.");
			form.lname.focus();
			return false;
		}else if(checkname(form.lname.value)=="") {
			alert("Please Enter valid last name");
			form.lname.focus();
			return false;
		}
		if(trim(form.addr.value)==""){
			alert("Please enter address.");
			form.addr.focus();
			return false;
		}else if(checkadd(form.addr.value)=="") {
			alert("Please Enter valid address");
			form.addr.focus();
			return false;
		}
		if(trim(form.city.value)==""){
			alert("Please enter city.");
			form.city.focus();
			return false;
		}else if(checkname(form.city.value)=="") {
			alert("Please Enter valid city");
			form.city.focus();
			return false;
		}
		if(trim(form.state.value)==""){
			alert("Please enter state.");
			form.state.focus();
			return false;
		}else if(checkname(form.state.value)=="") {
			alert("Please Enter valid state");
			form.state.focus();
			return false;
		}
		if(trim(form.zip.value)==""){
			alert("Please enter zip.");
			form.zip.focus();
			return false;
		}else if(inValidCharZip(form.zip.value)=="") {
			alert("Please Enter valid zip code");
			form.zip.focus();
			return false;
		}
		if(trim(form.phone.value)==""){
			alert("Please enter phone.");
			form.phone.focus();
			return false;
		}else if(checkPhone(form.phone.value)=="") {
			alert("Please Enter valid phone");
			form.phone.focus();
			return false;
		}
		if(trim(form.email.value)==""){
			alert("Please enter E-mail.");
			form.email.focus();
			return false;
		}else if(checkEmailAddress(form.email.value)=="") {
			alert("Please Enter Valid E-mail");
			form.email.focus();
			return false;
		}
		form.action = "db_contactus.php"
		form.submit();
}

function validatePressRelease(e){
	if(trim(document.pressrelease.release_date.value)==""){
		alert("Please Enter Release Date");
		document.pressrelease.release_date.focus();
		return false;
	}

	if(trim(document.pressrelease.title.value)==""){
		alert("Please Enter Title");
		document.pressrelease.title.focus();
		return false;
	}	

	if(!checkcity(document.pressrelease.title.value)){
		alert("Please Enter Valid Title");
		document.pressrelease.title.focus();
		return false;
	}	

	if(trim(document.pressrelease.contact_name.value)=="")	{
		alert("Please Enter Contact Name");
		document.pressrelease.contact_name.focus();
		return false;
	}		

	if(!checkcity(document.pressrelease.contact_name.value))	{
		alert("Please Enter Valid Contact Name");
		document.pressrelease.contact_name.focus();
		return false;
	}	
	document.pressrelease.action="db_news.php?e="+e;
	//alert(document.pressrelease.action)
 	document.pressrelease.submit();	
	return true;

	}