// JavaScript Document
video_to_video = false;

n=navigator;
nav=n.appVersion;
if (nav.indexOf("MSIE") > -1 && nav.indexOf("Macintosh") > -1) {
	var is_mac_ie = true;	
} else {
	var is_mac_ie = false;	
}

function img_handle(t,a) {
	var tags = t.getElementsByTagName("img");
	var i = tags[0];
	var fn = i.src;
	if (fn.indexOf(".png")>-1) {
		extension = ".png";	
	} else if (fn.indexOf(".gif") > -1) {
		extension = ".gif";
	} else if (fn.indexOf(".jpg") > -1) {
		extension = ".jpg";	
	}
	
	if (a == "over") {
		h = fn.replace(extension, "_over"+extension);
	} else if (a == "out") {
		h = fn.replace("_over"+extension, extension);
	} else {
		h = fn;	
	}
	i.src = h;
	
}

function checkForm() {
	
	
		
		FirstName = document.forms['signup'].FirstName.value;
		LastName = document.forms['signup'].LastName.value;
		addr_1 = document.forms['signup'].addr_1.value;
		city = document.forms['signup'].city.value;
		state = document.forms['signup'].state.value;
		zipcode = document.forms['signup'].zipcode.value;
		email = document.forms['signup'].email.value;
		address = "/^(\w+)@(\w+)\.(\w+)$/";
		
		
		
		if (email.indexOf("@") == -1 || email.indexOf(".") == -1) {
			email_test = null;	
		} else {
			email_test = true;
		}	
		
		msg = "Error: ";
		if(email_test == null) {
			msg += "the email address you entered was not valid.\n\n";
		}
		if(FirstName == "") {
			msg += "Please fill in your First Name.\n";
		}
		if(LastName == "") {
			msg += "Please fill in your Last Name.\n";
		}
/*
		if(addr_1 == "") {
			msg += "Please fill in your Address.\n";
		}
		if(city == "") {
			msg += "Please fill in your City.\n";
		}
		if(state == "") {
			msg += "Please fill in your State.\n";
		}
		if(zipcode == "") {
			msg += "Please fill in your Zip.\n";
		}
*/
		if (msg == "Error: ") {
			return true;
		} else {
			alert(msg); 
			return false;
		}
}
	
function toggle_div(d) {
	var i = null;
	i = document.getElementById(d);
	alert(i);
	if (i != null) {
		if (i.style.display == "block") {
			i.style.display = "none";	
		} else {
			i.style.display = "block";	
		}
	}
	
}
function get_anchor(a) {
	
	location.replace(a);
	window.scrollTo(0,0);
	setTimeout("window.scrollTo(0,0)", 500);
	
	
}
function set_sound_var(x) {
	if (!is_mac_ie && !video_to_video) {
	
		parent.set_sound(x);
	}
}
function set_music_var(x) {
	
	if (!is_mac_ie) {
		
		parent.set_music(x);
	}
}

if (window == top) {
	url = window.location.href;
 	top.location.href = "../main.php?page=" + url; 
}
