//MENU ROLLOVER
if (document.images) {
nav1on   = new Image(); nav1on.src   = "_images/menu_homeon.gif";
nav1off  = new Image(); nav1off.src  = "_images/menu_home.gif";
nav2on   = new Image(); nav2on.src   = "_images/menu_newson.gif";
nav2off  = new Image(); nav2off.src  = "_images/menu_news.gif";
nav3on   = new Image(); nav3on.src   = "_images/menu_abouton.gif";
nav3off  = new Image(); nav3off.src  = "_images/menu_about.gif";
nav4on   = new Image(); nav4on.src   = "_images/menu_calendaron.gif";
nav4off  = new Image(); nav4off.src  = "_images/menu_calendar.gif";
nav5on   = new Image(); nav5on.src   = "_images/menu_videoon.gif";
nav5off  = new Image(); nav5off.src  = "_images/menu_video.gif";
nav6on   = new Image(); nav6on.src   = "_images/menu_storeon.gif";
nav6off  = new Image(); nav6off.src  = "_images/menu_store.gif";
nav7on   = new Image(); nav7on.src   = "_images/menu_linkson.gif";
nav7off  = new Image(); nav7off.src  = "_images/menu_links.gif";}

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="";}


// 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_26");if (valcheck.value == "") {	alert("Please enter your First Name");	valcheck.focus();	return false;}//Last Name Check			valcheck = document.getElementById("CustomFields_2_26");if (valcheck.value == "") {	alert("Please enter your Last Name");	valcheck.focus();	return false;} //Zip Check	valcheck = document.getElementById("CustomFields_3_26");if (valcheck.value == "") {	alert("Please enter your Zip Code");	valcheck.focus();	return false;}

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

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

//Birth Year Check	valcheck = document.getElementById("CustomFields_6_26");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 currday = "0"+d.getDay();
var currmonth = "0"+d.getMonth();
var thebyear = document.getElementById("CustomFields_6_26").value;
var thebmonth = document.getElementById("CustomFields_5_26").value;
var thebday = document.getElementById("CustomFields_4_26").value;
var diffyear = curryear - 13;

if (diffyear < thebyear) {
window.location.href = "signup_underage.php";
return false;
} else if(diffyear == thebyear && currmonth < thebmonth) {
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.theForm.elements[nextEl].focus();
	}
     }	

// 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};


//VIDEO
function SwapVideo(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", "video_process.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields); 
};

