function quickLinksOnChange(dropdown)
{
    var index = dropdown.selectedIndex
    var value = dropdown.options[index].value
    top.location.href = value
    
    return true;
}


function ValidateForm(form)   // function used to validate the form
{
    if(form.email_address.value == "")
    {
        alert("You must enter your email address!");
        form.email_address.focus(); 
        return(false);
    }
    else
    {
        var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
        var address = form.email_address.value;
        if(reg.test(address) == false) 
        {
            alert('Invalid Email Address');
            form.email_address.value = "";
            form.email_address.focus();
            return(false);
	}
    }

    if(form.password.value == "")
    {
        alert("You must enter a password!");
        form.password.focus(); 
        return(false);
    }

    if(form.confirm_password.value == "")
    {
        alert("You must confirm the entered password!");
        form.confirm_password.focus(); 
        return(false);
    }

    if(form.password.value != form.confirm_password.value)
    {
        alert("The passwords you have entered do not match!");
        form.password.value = "";
        form.confirm_password.value = "";
        form.password.focus(); 
        return(false);
    }

    if(form.fname.value == "")
    {
        alert("You must enter a first name!");
        form.fname.focus(); 
        return(false);
    }

    if(form.lname.value == "")
    {
        alert("You must enter a last name!");
        form.lname.focus(); 
        return(false);
    }

    if(form.company_name.value == "")
    {
        alert("You must enter a company name!");
        form.company_name.focus(); 
        return(false);
    }

    if(form.address.value == "")
    {
        alert("You must enter an address!");
        form.address.focus(); 
        return(false);
    }

    if(form.city.value == "")
    {
        alert("You must enter a city!");
        form.city.focus(); 
        return(false);
    }

    if(form.zip.value == "")
    {
        alert("You must enter a postal code!");
        form.zip.focus(); 
        return(false);
    }

    if(form.phone_number.value == "")
    {
        alert("You must enter a phone number!");
        form.phone_number.focus(); 
        return(false);
    }


    return(true);
}


function ValidateLoginForm(form)   // function used to validate the form
{
    if(form.email_address.value == "")
    {
        alert("You must enter your email address!");
        form.email_address.focus(); 
        return(false);
    }
    else
    {
        var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
        var address = form.email_address.value;
        if(reg.test(address) == false) 
        {
            alert('Invalid Email Address');
            form.email_address.value = "";
            form.email_address.focus();
            return(false);
	}
    }

    if(form.password.value == "")
    {
        alert("You must enter a password!");
        form.password.focus(); 
        return(false);
    }


    return(true);
}


function getCookie(name) 
{
    //alert("calling getCookie()");

    var start = document.cookie.indexOf(name + "=");
    var len = start + name.length + 1;

    if((!start) && (name != document.cookie.substring(0, name.length)))
    {
        return(null);
    }
    if(start == -1) return(null);
    var end = document.cookie.indexOf( ';', len );
    if(end == -1) end = document.cookie.length;
   
    var value = unescape(document.cookie.substring(len, end));
    //alert("value of cookie \"" + name + "\" = \"" + value + "\"");
    return(value);
}

