// ROLLOVER
if (document.images) {
nav1on   = new Image(); nav1on.src   = "_images/menu_homeon.jpg";
nav1off  = new Image(); nav1off.src  = "_images/menu_home.jpg";
nav2on   = new Image(); nav2on.src   = "_images/menu_abouton.jpg";
nav2off  = new Image(); nav2off.src  = "_images/menu_about.jpg";
nav3on   = new Image(); nav3on.src   = "_images/menu_newson.jpg";
nav3off  = new Image(); nav3off.src  = "_images/menu_news.jpg";
nav4on   = new Image(); nav4on.src   = "_images/menu_touron.jpg";
nav4off  = new Image(); nav4off.src  = "_images/menu_tour.jpg";
nav5on   = new Image(); nav5on.src   = "_images/menu_blogon.jpg";
nav5off  = new Image(); nav5off.src  = "_images/menu_blog.jpg";
nav6on   = new Image(); nav6on.src   = "_images/menu_mediaon.jpg";
nav6off  = new Image(); nav6off.src  = "_images/menu_media.jpg";
nav7on   = new Image(); nav7on.src   = "_images/menu_opportunitieson.jpg";
nav7off  = new Image(); nav7off.src  = "_images/menu_opportunities.jpg";
nav8on   = new Image(); nav8on.src   = "_images/menu_storeon.jpg";
nav8off  = new Image(); nav8off.src  = "_images/menu_store.jpg";
nav9on   = new Image(); nav9on.src   = "_images/menu_resourceson.jpg";
nav9off  = new Image(); nav9off.src  = "_images/menu_resources.jpg";
nav10on   = new Image(); nav10on.src   = "_images/menu_linkson.jpg";
nav10off  = new Image(); nav10off.src  = "_images/menu_links.jpg";
nav11on   = new Image(); nav11on.src   = "_images/menu_faqon.jpg";
nav11off  = new Image(); nav11off.src  = "_images/menu_faq.jpg";
nav12on   = new Image(); nav12on.src   = "_images/menu_contactson.jpg";
nav12off  = new Image(); nav12off.src  = "_images/menu_contacts.jpg";
nav13on   = new Image(); nav13on.src   = "_images/footer_myspaceon.jpg";
nav13off  = new Image(); nav13off.src  = "_images/footer_myspace.jpg";
nav14on   = new Image(); nav14on.src   = "_images/footer_facebookon.jpg";
nav14off  = new Image(); nav14off.src  = "_images/footer_facebook.jpg";
}

function rollOn(img){
    if (document.images) {
        document[img].src=eval(img + "on.src");
    }
}

function rollOff(img){
    if (document.images) {
		document[img].src=eval(img + "off.src");
	}
}


//CLEAR FIELDfunction clearIt(field) {field.value="";}

//SHOW HIDE
function showHide(id) {var style = document.getElementById(id).style;if (style.display == "none"){style.display = "";} else {style.display = "none";
}} 

// OPEN WINDOW
function openWin(url,name,popW,popH) {w = screen.availWidth;
h = screen.availHeight;leftPos = 5;
topPos = 5;window.open(url,name,'width='+popW+',height='+popH+',scrollbars=no,toolbar=no,status=no,resizable=yes,top='+ topPos+',left='+leftPos);}

//AJAX
function ajaxRequest() {var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IEif (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)  for (var i=0; i<activexmodes.length; i++){   try{    return new ActiveXObject(activexmodes[i])   }   catch(e){    //suppress error   }  } } else if (window.XMLHttpRequest) // if Mozilla, Safari etc  return new XMLHttpRequest() else  return false};


//YOUTUBE VIDEO HOME
function YouTubeHome(thefile) {var req = ajaxRequest();
if (req==null) {	alert("Browser does not support HTTP Request");	return;}
req.onreadystatechange = function () {
 if (req.readyState!=4) {
document.getElementById('thevideoload').innerHTML="<b>Loading...</b>"; 
} else {      if (req.status==200) {           document.getElementById('homevideo').innerHTML=req.responseText; //return value;
document.getElementById('thevideoload').innerHTML="";       } else {   	alert("An error has occured making the request");      } }}
var fields = "vidfile="+thefile;req.open("POST", "process_youtubehome.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields); 
};

//YOUTUBE VIDEO
function YouTube(thefile) {var req = ajaxRequest();
if (req==null) {	alert("Browser does not support HTTP Request");	return;}
req.onreadystatechange = function () {
 if (req.readyState!=4) {
document.getElementById('thevideo').innerHTML="<b>Loading...</b>"; 
} else {      if (req.status==200) {           document.getElementById('thevideo').innerHTML=req.responseText; //return value;      } else {   	alert("An error has occured making the request");      } }}
var fields = "vidfile="+thefile;req.open("POST", "process_youtube.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields); 
};




// SIGN UP
function SignupCheck(form) {hasDot = form.email.value.indexOf(".");hasAt = form.email.value.indexOf("@");if (hasDot == -1 || hasAt == -1) {	alert("Please enter your Email Address.");	form.email.focus();	return false;}

//First Name Checkvalcheck = document.getElementById("CustomFields_1_21");if (valcheck.value == "") {	alert("Please enter your First Name");	valcheck.focus();	return false;}//Last Name Check			valcheck = document.getElementById("CustomFields_2_21");if (valcheck.value == "") {	alert("Please enter your Last Name");	valcheck.focus();	return false;} //Zip Check	valcheck = document.getElementById("CustomFields_3_21");if (valcheck.value == "") {	alert("Please enter your Zip Code");	valcheck.focus();	return false;}

//Birth Month Check	valcheck = document.getElementById("CustomFields_4_21");if (valcheck.value == "") {	alert("Please enter your Birth Month");	valcheck.focus();	return false;}

//Birth Day Check	valcheck = document.getElementById("CustomFields_5_21");if (valcheck.value == "") {	alert("Please enter your Birth Day");	valcheck.focus();	return false;}

//Birth Year Check	valcheck = document.getElementById("CustomFields_6_21");if (valcheck.value == "") {	alert("Please enter your Birth Year (YYYY)");	valcheck.focus();	return false;}

 else {	return checkAge();}}

// CHECK AGE
function checkAge() {var d = new Date();var curryear = d.getFullYear();var agelimit = 13;var thebyear = document.getElementById("CustomFields_6_21").value;var diffyear = curryear - thebyear;if (diffyear < agelimit) {window.location.href = "signup_underage.php";	return false;} else {return true;}}

//Birthday Check & Tab
function checkLength(currEl, nextEl) {
      if (currEl.value.length == currEl.maxLength) {
	document.myForm.elements[nextEl].focus();
	}
     }	
