/*  
Script made by Martial Boissonneault © 2001-2003 http://getElementById.com/
This script may be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
*/
function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("div");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
function ChangeClass(menu, newClass) { 
	 if (document.getElementById) { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
document.onselectstart = new Function("return false");
		
/*
 Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
 Script to make sure the contact form is submitted only once
*/
var submitcount=0;
function contact_form_reset() {
    document.contact_form.Name.value = "";
    document.contact_form.Email.value = "";
    document.contact_form.Phone.value = "";
    document.contact_form.Company_Name.value = "";
    document.contact_form.Message_Request.value = "";
    document.contact_form.Referral.value = "";
}

function check_contact_fields() {   
                  
  if (document.contact_form.Name.value=="")
  {
    alert("Please enter a value for the \"Name\" field.");
    document.contact_form.Name.focus();
    return (false);
  }
  else
  {
    if (document.contact_form.Email.value=="")
    {
      alert("Please enter a value for the \"Email\" field.");
      document.contact_form.Email.focus();
      return (false);
    }
    else 
    {
	  if (document.contact_form.Message_Request.value=="")
	  {
	    alert("Please enter a message / request.");
	    document.contact_form.Message_Request.focus();
	    return (false);
	  }
	  else
	  {
	    if (submitcount == 0)
	    {
	      submitcount++;
	      return (true);
	    }
	    else 
	    {
	      alert("This form has already been submitted.");
	      return (false);
	    }
	  }
    }
  }
}

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function createWindow(page)
{
 // Find the URL of the Page
 pgLoc = new String(document.location);
 
 //Extract the directory name from the URL
 dirName = new String(pgLoc.substring(pgLoc.indexOf("/", 8), pgLoc.lastIndexOf("/") + 1));
 
 // Pass the directory name and page name to the popup window
 window.open("../popWindow.asp?page=" + page,"","scrollbars,resizable=1,width=700,height=500");
}

/*  
Script made by Martial Boissonneault © 2002-2003 http://getElementById.com/
This script may be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
*/
var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all);

// there are 25 differents effects you can use.
// to change the duration of the effect, change the duration number. "Duration=2" => 2 seconds
var fade = "blendTrans(Duration=0.2)";
var boxIn = "revealTrans(Duration=0.7,Transition=0)";
var boxOut = "revealTrans(Duration=0.3,Transition=1)"; 
var circleIn ="revealTrans(Duration=0.7,Transition=2)";
var circleOut ="revealTrans(Duration=0.7,Transition=3)";
var wipeUp = "revealTrans(Duration=0.5,Transition=4)";
var wipeDown = "revealTrans(Duration=0.5,Transition=5)";
var wipeRight = "revealTrans(Duration=0.5,Transition=6)";
var wipeLeft = "revealTrans(Duration=0.5,Transition=7)";
var verticalblinds = "revealTrans(Duration=0.7,Transition=8)"; 
var horizontalblinds = "revealTrans(Duration=0.7,Transition=9)"; 
var checkerboardAcross = "revealTrans(Duration=0.7,Transition=10)";
var checkerboardDown = "revealTrans(Duration=0.7,Transition=11)";
var dissolve = "revealTrans(Duration=0.7,Transition=12)";
var splitVerticalIn = "revealTrans(Duration=0.5, Transition=13)";
var splitVerticalOut = "revealTrans(Duration=0.3, Transition=14)";
var splitHorizontalIn = "revealTrans(Duration=0.7, Transition=15)";
var splitHorizontalOut = "revealTrans(Duration=0.3, Transition=16)";
var stripsLeftDown = "revealTrans(Duration=0.7, Transition=17)";
var stripsLeftUp = "revealTrans(Duration=0.7, Transition=18)";
var stripsRightDown = "revealTrans(Duration=0.7,Transition=19)";
var stripsRightUp = "revealTrans(Duration=0.7,Transition=20)";
var randomBarsHorizontal = "revealTrans(Duration=0.7,Transition=21)";
var randomBarsVertical = "revealTrans(Duration=0.7,Transition=22)";
var random = "revealTrans(Duration=0.7,Transition=23)";

var myEffect = fade;

function showFilter(obj, visibility) {
	if(ie5){
	//	menu[obj].style.filter = myEffect; // set your effect from one of the top 25 differents effects
	//	menu[obj].filters[0].Apply();
		menu[obj].style.visibility = visibility;
	//	menu[obj].filters[0].Play();
	}
	else if(ns6){
		menu[obj].style.visibility = visibility;
	}
}

function showHide(obj, visibility) {
	if(ie5 || ns6){
		menu[obj].style.visibility = visibility;
	}
}

function menuBarInit() {
	if(ie5 || ns6){
   		menu = document.getElementsByTagName("div");
	}
}
