// PHOTO GALLERY
function update(url,index,isSuper) { document['PhotoBig'].src=url; }
// Pop-Up Window
function feedback()
{window.open("feedback.php",'feedback','resizable=0,status=0,scrollbars=1,toolbar=0,width=350,height=400,top=100,left=100');}
function edit_photo()
{window.open("edit-photo.php",'edit_photo','resizable=0,status=0,scrollbars=1,toolbar=0,width=350,height=400,top=100,left=100');}
function support()
{window.open("chat-support.php",'support','resizable=0,status=0,scrollbars=1,toolbar=0,width=350,height=400');}

// Auto Select
function formHandler(i){
if (i==1){
var URL = document.location.country.options[document.location.country.selectedIndex].value;
window.location.href = URL; }
if (i==2){
var URL = document.location.state.options[document.location.state.selectedIndex].value;
window.location.href = URL; }
if (i==3){
var URL = document.location.county.options[document.location.county.selectedIndex].value;
window.location.href = URL; }
if (i==4){
var URL = document.location.selected_school_district.options[document.location.selected_school_district.selectedIndex].value;
window.location.href = URL; }
if (i==5){
var URL = document.location.city.options[document.location.city.selectedIndex].value;
window.location.href = URL; }
if (i==6){
var URL = document.seven_forecast.regional_forecast.options[document.seven_forecast.regional_forecast.selectedIndex].value;
window.location.href = URL; }
if (i==7){
var URL = document.sent_event.sent_type.options[document.sent_event.sent_type.selectedIndex].value;
window.location.href = URL; }
if (i==8){
var URL = document.things.to_do.options[document.things.to_do.selectedIndex].value;
window.location.href = URL; }}

<!-- Begin
// Preload images
var empty = new Image(); empty.src = "image/fieldempty.gif";
var uname = new Image(); uname.src = "image/fieldempty.gif";
var pwd = new Image(); pwd.src = "image/fieldempty.gif";
var cpwd = new Image(); cpwd.src = "image/fieldempty.gif";

var haveerrors = 0;
function showImage(imagename, imageurl, errors) {
document[imagename].src = imageurl;
if (!haveerrors && errors) haveerrors = errors;
}

function validateForm(f) {
haveerrors = 0;
(f.uname.value.length < 1) // validate user name length
? showImage("unameerror", "image/fieldempty.gif", true)   // no semi-colon after this line!
: showImage("unameerror", "image/blankimage.gif", false); // true = errors, false = no errors

(f.pwd.value.length < 3) // validate password length
? showImage("pwderror", "image/fieldempty.gif", true)
: showImage("pwderror", "image/blankimage.gif", false);

(f.cpwd.value.length < 3) // validate confirm password length
? showImage("cpwderror", "image/fieldempty.gif", true)
: showImage("cpwderror", "image/blankimage.gif", false);

return (!haveerrors);
}
//  End -->

// Login and Password
function validate_login( f ) { if (( f.uname.value == '' ) || ( f.uname.value.length < 3 )) { alert( 'Enter a username' ); exit; } if (( f.pwd.value == '' )||( f.pwd.value.length < 3 )) { alert( 'Enter a password' ); exit; } }

