//MENU 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_seeon.jpg";
nav3off  = new Image(); nav3off.src  = "_images/menu_see.jpg";
nav4on   = new Image(); nav4on.src   = "_images/menu_causeon.jpg";
nav4off  = new Image(); nav4off.src  = "_images/menu_cause.jpg";
nav5on   = new Image(); nav5on.src   = "_images/menu_storieson.jpg";
nav5off  = new Image(); nav5off.src  = "_images/menu_stories.jpg";
nav6on   = new Image(); nav6on.src   = "_images/menu_eventson.jpg";
nav6off  = new Image(); nav6off.src  = "_images/menu_events.jpg";
nav7on   = new Image(); nav7on.src   = "_images/menu_promoteon.jpg";
nav7off  = new Image(); nav7off.src  = "_images/menu_promote.jpg";
nav8on   = new Image(); nav8on.src   = "_images/menu_registeron.jpg";
nav8off  = new Image(); nav8off.src  = "_images/menu_register.jpg";
nav9on   = new Image(); nav9on.src   = "_images/menu_buyon.jpg";
nav9off  = new Image(); nav9off.src  = "_images/menu_buy.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");
	}
}



// CHECK REGISTRATION
function SignupCheck(form) {
valcheck = form.email;hasDot = valcheck.value.indexOf(".");hasAt = valcheck.value.indexOf("@");if (hasDot == -1 || hasAt == -1) {	alert("Please enter your Email Address.");	valcheck.focus();	return false;}//First Name Checkvalcheck = document.getElementById("CustomFields_1_22");if (valcheck.value == "") {	alert("Please enter your First Name");	valcheck.focus();	return false;}//Last Name Check			valcheck = document.getElementById("CustomFields_2_22");if (valcheck.value == "") {	alert("Please enter your Last Name");	valcheck.focus();	return false;} //State Check			valcheck = document.getElementById("CustomFields_13_22");if(valcheck.selectedIndex == -1 || valcheck.value == "") {	alert("Please enter your State");	valcheck.focus();	return false;}//Zip Check	valcheck = document.getElementById("CustomFields_3_22");if (valcheck.value == "") {	alert("Please enter your Zip Code");	valcheck.focus();	return false;}
 else {	return true;}}

// 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_22").value;
var thebmonth = document.getElementById("CustomFields_5_22").value;
var thebday = document.getElementById("CustomFields_4_22").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;}}

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

// OPEN WINDOW (POPUP)
function openWin(url,name,popW,popH) {        version = navigator.appVersion;	var w = 1024, h = 768;	if (document.all || document.layers) {		w = screen.availWidth;		h = screen.availHeight;	}	var leftPos = (w-popW)/2, topPos = (h-popH)/2;	window.open(url,name,'width=' + popW + ',height=' + popH + ',scrollbars=no,toolbar=no,status=yes,resizable=yes,top=' + topPos + ',left=' + leftPos);void(0);}


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

//GET STORY
function GetStory(thenum) {var req = ajaxRequest();
if (req==null) {	alert("Browser does not support HTTP Request");	return;}
req.onreadystatechange = function () { if (req.readyState==4) {      if (req.status==200) {           document.getElementById('thestory').innerHTML=req.responseText; //return value;      } else {   	alert("An error has occured making the request");      } }};var fields = "id="+thenum;req.open("POST", "process_story.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields); 
};




