window.defaultStatus = ("Heart to Mind - Leslie Bouche");
window.status = ("Heart to Mind - Leslie Bouche");

var browserType = null
if( document.layers )   browserType="Netscape";
else if( document.all )	browserType="IE";
else if( document.getElementById ) browserType = "NS6";


///////////////////////////////////

//preload images
var preLoad = new Array();

preLoad['home'] = new Image();
preLoad['home'].src = "images/nav/home.gif";
preLoad['home_on'] = new Image();
preLoad['home_on'].src = "images/nav/home_on.gif";

preLoad['about'] = new Image();
preLoad['about'].src = "images/nav/about.gif";
preLoad['about_on'] = new Image();
preLoad['about_on'].src = "images/nav/about_on.gif";

preLoad['hh'] = new Image();
preLoad['hh'].src = "images/nav/hh.gif";
preLoad['hh_on'] = new Image();
preLoad['hh_on'].src = "images/nav/hh_on.gif";

preLoad['therapeutic'] = new Image();
preLoad['therapeutic'].src = "images/nav/therapeutic.gif";
preLoad['therapeutic_on'] = new Image();
preLoad['therapeutic_on'].src = "images/nav/therapeutic_on.gif";

preLoad['ties'] = new Image();
preLoad['ties'].src = "images/nav/ties.gif";
preLoad['ties_on'] = new Image();
preLoad['ties_on'].src = "images/nav/ties_on.gif";

preLoad['faq'] = new Image();
preLoad['faq'].src = "images/nav/faq.gif";
preLoad['faq_on'] = new Image();
preLoad['faq_on'].src = "images/nav/faq_on.gif";

preLoad['reasons'] = new Image();
preLoad['reasons'].src = "images/nav/reasons.gif";
preLoad['reasons_on'] = new Image();
preLoad['reasons_on'].src = "images/nav/reasons_on.gif";

preLoad['happy'] = new Image();
preLoad['happy'].src = "images/nav/happy.gif";
preLoad['happy_on'] = new Image();
preLoad['happy_on'].src = "images/nav/happy_on.gif";

preLoad['contact'] = new Image();
preLoad['contact'].src = "images/nav/contact.gif";
preLoad['contact_on'] = new Image();
preLoad['contact_on'].src = "images/nav/contact_on.gif";

preLoad['testimonials'] = new Image();
preLoad['testimonials'].src = "images/nav/testimonials.gif";
preLoad['testimonials_on'] = new Image();
preLoad['testimonials_on'].src = "images/nav/testimonials_on.gif";

preLoad['home_title'] = new Image();
preLoad['home_title'].src = "images/titles/home.gif";

preLoad['about_title'] = new Image();
preLoad['about_title'].src = "images/titles/about.gif";

preLoad['hh_title'] = new Image();
preLoad['hh_title'].src = "images/titles/hh.gif";

preLoad['therapeutic_title'] = new Image();
preLoad['therapeutic_title'].src = "images/titles/therapeutic.gif";

preLoad['ties_title'] = new Image();
preLoad['ties_title'].src = "images/titles/ties.gif";

preLoad['faq_title'] = new Image();
preLoad['faq_title'].src = "images/titles/faq.gif";

preLoad['reasons_title'] = new Image();
preLoad['reasons_title'].src = "images/titles/reasons.gif";

preLoad['happy_title'] = new Image();
preLoad['happy_title'].src = "images/titles/happy.gif";

preLoad['contact_title'] = new Image();
preLoad['contact_title'].src = "images/titles/contact.gif";

preLoad['about2_title'] = new Image();
preLoad['about2_title'].src = "images/titles/about2.gif";

preLoad['hh2_title'] = new Image();
preLoad['hh2_title'].src = "images/titles/hh2.gif";

preLoad['hh3_title'] = new Image();
preLoad['hh3_title'].src = "images/titles/hh3.gif";

/////////////////////////////////////


 function submitForm(e){   
   document.mailing.submit();
 }


 function imgOver(img, nav2){ 
   var name = img.name;
   document[name].src = preLoad[name+'_on'].src;   
   if(nav2)
     showMenu(nav2); 
 }
 
 function imgOut(img, nav2){ 
   var name = img.name;
   document[name].src = preLoad[name].src;
  
   if(nav2)
     hideMenu(nav2);    
 }


 function getObj(){
   var oDiv = document.all
   if (document.all)
     oDiv = document.all.tags("iff");
   else if (document.layers)
     oDiv = document.layers();
   else if (document.getElementById)
     oDiv = document.getElementsByTagName("iff");
     
   return oDiv;
 }
 

var ie = document.all&&navigator.userAgent.indexOf("Opera")==-1;
var dom = document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;
var fox = navigator.userAgent.indexOf("Firefox")>-1;
var safari = navigator.userAgent.indexOf("Safari")>-1;

//////////////////////////////////

var browserType = null
if( document.layers )   browserType="Netscape";
else if( document.all )	browserType="IE";
else if( document.getElementById ) browserType = "NS6";


///////////////////////////////////


function showMenu( strMenu, nav1 ) {

        cancelWait(switchTimeout);

	if( browserType == "Netscape" ) {
		setMenuVisibility("document.layers[\"" + strMenu + "\"]","show")
	}
	else if( browserType == "IE" ) {
		setMenuVisibility("document.all[\"" + strMenu + "\"]","visible")
	}
	else if( browserType == "NS6" ) {
		setMenuVisibility(strMenu,'visible')
	}
	if(nav1){
		imgOver(document[nav1]);
	}
}

function hideMenu( strMenu, nav1 ) {

	if( browserType == "Netscape" ) {
		setMenuVisibility("document.layers[\"" + strMenu + "\"]","hide")
	}
	else if( browserType == "IE" ) {
		setMenuVisibility(document.all[strMenu],"hidden")
	}
	else if( browserType == "NS6" ) {
		setMenuVisibility(strMenu,'hidden')
	}	
	if(nav1){
		imgOut(document[nav1]);
	}

}

/////////////////////////////////////

function setMenuVisibility( strMenuDiv, strNewMenuState ){
	var objMenuDiv;
	if( browserType == "Netscape")
	{
		objMenuDiv = eval(strMenuDiv);
  		if( objMenuDiv ) objMenuDiv.visibility = strNewMenuState;
	}
	else if( browserType == "IE" )
	{
		objMenuDiv=eval(strMenuDiv);
		if( objMenuDiv ) objMenuDiv.style.visibility = strNewMenuState;
	}
	else if( browserType == "NS6" )
	{
		objMenuDiv=eval("document.getElementById(\"" + strMenuDiv + "\")");
		if( objMenuDiv ){
		objMenuDiv.style.visibility = strNewMenuState;
		}
	}	
	else
	{
		return
	}
}

/////////////////////////////////////

var switchTimeout;
//wait then execute
function wait(_msecs, _menu) {
  if (switchTimeout != null) clearTimeout(switchTimeout);
  switchTimeout = setTimeout("hideMenu('" + _menu + "')",_msecs);
}

//cancel wait for a timeout
function cancelWait(_timeout) {
  if (_timeout != null || _timeout != ''){
    clearTimeout(_timeout);
    }
}

