// Popout a new window with URL and size params
function launch(URL, width, height){
	var winLeft = (screen.width - width) / 2;
	var winUp = (screen.height - height) / 2;

	newWindow = window.open(URL,"newwindow","width="+width+",height="+height+",top="+winUp+",left="+winLeft+",scrollbars=yes,toolbar=no,menubar=no,status=no,resizable=yes");
	newWindow.focus();
}

function PopupPic(sPicURL) {
	window.open( "popup.html?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
} 

// This method validates a form
function validate(myform) 
{
	if (!myform.terms[0].checked || myform.terms[1].checked) {
		alert("You must agree to our Terms of Service and our Privacy Policy to proceed.");
		return false;		
	} else if (!isFilled(myform.email)) {	
		alert("Please supply a valid email address.");
		return false;
	} else if (!isFilled(myform.password)) {
		alert("Please supply a password.");
		return false;
	} else if (!(myform.password.value.length >= 5)) {	
		alert("Please supply a password that is at least 5 characters long.");
		return false;
	} else if (myform.password.value != myform.passwordconfirm.value) {
		alert("Your passwords do not match. Please try again.");
		return false;		
	} else if (!isFilled(myform.zipcode)) {
		alert("You forgot to enter your Zipcode.");
		return false;
	} else if (!(myform.zipcode.value.length >= 5)) {	
		alert("Please enter a valid zipcode.");
		return false;				
	} else {
	    return true;
	}
}

function isFilled(elm) {
	if (elm.value == "" || elm.value == " " || elm.value == null) 
		return false;
	else 
		return true;
}

/*
Toggle Layer Visibility
© Eddie Traversa (nirvana.media3.net)
To add more shock to your site, visit www.DHTML Shock.com
*/
function toggleVisibility(id, NNtype, IEtype, WC3type) {
    if (document.getElementById) {
        eval("document.getElementById(id).style.visibility = \"" + WC3type + "\"");
    } else {
        if (document.layers) {
            document.layers[id].visibility = NNtype;
        } else {
            if (document.all) {
                eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
            }
        }
    }
}