﻿function EnsureFormSubmit() {
    
    //TODO: Do validation here:
    //Ensure all form fields are valid and not empty.
    //If any value is empty just 'return false;' in this javascript so that form will not be submitted.

    //-------------------------------------------------------------
    // Important code for ASO login to work - DO NOT REMOVE THE CODE BELOW. ADDED JAN25th10
    //-------------------------------------------------------------
    //Assign P-UID to G-PUID and then submit the form.
    var puid = document.getElementsByName("password_login");
    var gpuid = document.getElementsByName("G-PUID");
    if (puid[0].value == "") {
        //As password seems empty, just assigning some strange string so ASO will display 'Incorrect login' error.
        puid[0].value = "InvalidPass";
    }
    gpuid[0].value = puid[0].value;
    return true;
}


// Basket

function togglelogin() {

    var container = $telerik.$("#container");

    if (container.is(":hidden")) {
        container.slideDown("slow").show(function () {
            $telerik.$(this).show();
        });
        
    } else {
        container.hide();
    }


}
