/* Header */
function validateHeaderLoginForm() {
    var errStr = '';
    strUserName = document.getElementById("txtUsername").value;
    strPassword = document.getElementById("txtPassword").value;

    if ((strUserName.length == 0) || (strPassword.length == 0)) {
        errStr = errStr + 'You need to enter a username and password!';
    }
    
    if (errStr.length == 0) {
        return true;
        } else {
            alert(errStr);
            return false;
        }
}

/* Search Box */
function validateSearchBox() {
    var errStr = '';
    strSearchTerm = document.getElementById("txtSearchTerm").value;

    if (strSearchTerm.length == 0) {
        errStr = errStr + 'You need to enter a search term!';
    }
    
    if (errStr.length == 0) {
        return true;
        } else {
            alert(errStr);
            return false;
        }
}

/* Generic */
function open_imgwin(sku)
{
      var img_win = window.open("/popup/popup_image.asp?pID="+sku, "win1", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=525,height=525");
      img_win.focus();
}
function open_urlwin(url)
{
      var urlwin = window.open(url, "win1", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=525,height=525");
      urlwin.focus();
}
function open_urlwin_pers(url)
{
      var urlwin = window.open(url, "win1", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=390,height=350");
      urlwin.focus();
}

function open_pu_hlp()
{
      var hlpwin = window.open("/pu-hlp/", "help", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=800,height=450");
      hlpwin.focus();
}
function open_pu_hlp_trms()
{
      var hlpwin = window.open("/pu-hlp/terms_and_conditions", "help", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=800,height=450");
      hlpwin.focus();
}
function open_pu_quickentry()
{
      var hlpwin = window.open("/popup/popup_basket_quickentry.asp", "quickentry", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=430,height=400");
      hlpwin.focus();
}
