function submit_cat(cat_id,allids) {
    document.location.href = "browse-by-cat-"+cat_id+".htm";
}

function validate_log1() {      
    var all_ok = true;
    var err_msg = "";
    
    if(isblank(document.login_frm1.cust_uname.value)) {
            all_ok = false;
            err_msg += "\n -Email cannot be left blank.";
    } else if (!validEmail(document.login_frm1.cust_uname.value)) {
            all_ok = false;
            err_msg += "\n -Please enter a valid email.";
    }
    if (isblank(document.login_frm1.cust_password.value)) {
        all_ok = false;
        err_msg += "\n -Password cannot be left blank.";
    }
    
    if (all_ok == false){
        alert("The following error have occured -" + err_msg);

    } 
    
    return all_ok
}
function validate() {
    var all_ok = true;
    var err_msg = "";  
    if(isblank($("#9").val()))    {
        all_ok = false;
        err_msg += "\n -Email Address cannot be left blank.";
    } else if (!validEmail($("#9").val())) {
        all_ok = false;
        err_msg += "\n -Please enter a valid Email Address.";
    }
    if (isblank($("#10").val())) {
        all_ok = false;
        err_msg += "\n -Password cannot be left blank.";
    } else if ($("#10").val().length < 6) {
        all_ok = false;
        err_msg += "\n -Please choose password with a minimum of 6 characters.";
    } else if (isblank($("#11").val())) {
        all_ok = false;
        err_msg += "\n -Repeat Password cannot be left blank.";
    } else if ($("#10").val() != $("#11").val()) {
        all_ok = false;
        err_msg += "\n -Password and Repeat Password does not match.";
    }
    
    if (isblank($("#1").val())) {
        all_ok = false;
        
        err_msg += "\n -Please select Title.";
    }
    if (isblank($("#2").val())) {
        all_ok = false;
        err_msg += "\n -First Name cannot be left blank.";
    }
    if (isblank($("#3").val())) {
        all_ok = false;
        err_msg += "\n -Last Name cannot be left blank.";
    }
    
    if ($("#12").val()=="Other" && $("#other_val").val()=="") {
        all_ok = false;
        err_msg += "\n -Please enter Where did you here about us!";
    }
    if (document.reg_frm.dob_date.value == '') {
        all_ok = false;
        err_msg += "\n -Please select a date.";
    } 
    if (document.reg_frm.dob_month.value == '') {
        all_ok = false;
        err_msg += "\n -Please select a month.";
    } 
    if (document.reg_frm.dob_year.value == '') {
        all_ok = false;
        err_msg += "\n -Please select an year.";
    } 
    if (document.reg_frm.dob_date.value != '' && document.reg_frm.dob_month.value != '' && document.reg_frm.dob_year.value != '') {
        if (!isDate(String(document.reg_frm['dob_date'].value), String(document.reg_frm['dob_month'].value), String(document.reg_frm['dob_year'].value)) ) {            
                    all_ok = false;
                    err_msg += "\n- Please enter a valid Date Of Birth.";
        }
    }  
    
    if (isblank($("#5").val())) {
        all_ok = false;
        err_msg += "\n -Gender cannot be left blank.";
    }
    
    if (isblank($("#6").val())) {
        all_ok = false;
        err_msg += "\n -Home Phone cannot be left blank.";
    }
    if (all_ok == false){
        alert("The following errors have taken place -" + err_msg);

    } 
        
    return all_ok
}
function other_potion(val){
    
    if(val=="Other"){
        document.getElementById('other').style.display="";
    }else{
        document.getElementById('other').style.display="none";
    }

}
function forgot_disp(id){
    if(document.getElementById(id)){
        var divobj = document.getElementById(id);
        
        if(divobj.style.display=="none"){
            divobj.style.display = "";
        }  
    }
}

function validate_for_got() {
    var all_ok = true;
    var err_msg = "";
    
    if(isblank(document.f_g_frm.cust_uname_forgot.value))    {
            all_ok = false;
            err_msg += "\n -Email cannot be left blank.";
    } else if (!validEmail(document.f_g_frm.cust_uname_forgot.value)) {
            all_ok = false;
            err_msg += "\n -Please enter a valid email.";
    }
    
    
    if (all_ok == false){
        alert("The following error have occured -" + err_msg);

    } 
    
    return all_ok
}
function validate_for_got1() {
        var all_ok = true;
        var err_msg = "";  
        if(isblank(document.f_g_frm1.cust_uname_forgot.value))    {
                all_ok = false;
                err_msg += "\n -Email cannot be left blank.";
        } else if (!validEmail(document.f_g_frm1.cust_uname_forgot.value)) {
                all_ok = false;
                err_msg += "\n -Please enter a valid email.";
        }
        if (isblank(document.f_g_frm1.log_grp_id.value)) {
            all_ok = false;
            err_msg += "\n -Please select a group.";
        }
        
        if (all_ok == false){
            alert("The following error have occured -" + err_msg);
    
        } 
        
        return all_ok
}

function reg_submit(){   
    if(validate()){
        document.reg_frm.submit();
    }
}
function log_submit(){
    if(validate_log1()){
        document.login_frm1.submit();
    }
}

function submit_frm() {
    if (validate_for_got1()) {
        document.f_g_frm1.submit();
    }
}