﻿// JScript File
//*************** REMOVE CART ITEM ******************
function removeCartItem(itemId)
{
    $get("ctl00_cph1_hdnUpdateValue").value = itemId;
    $get("ctl00_cph1_btnUpdate").click();
}

// INITIAZIE REQUEST *******************************************
function InitializeRequest(sender, args)
{
    // needed for credit card processing.
    //Disables the page from making any callbacks if another one is already in progress
    if (prm.get_isInAsyncPostBack()) 
    {
        alert('The web site was in the middle of completing an update when you made another request. This initial update is now complete so please try you action again. \n (This is an information message and not a system error message)');
        prm.abortPostBack();                 //cancels current request
        args.set_cancel(true);               //cancels new request
    }

}
  
// SHOW RECEIPT **************************************************
function showReceipt()
{
    var a = window. open('','','scrollbars=yes');
    a.document.open("text/html");
    a.document.write('<html><head><link rel="stylesheet" href="css/Styles.css" /><style type="text/css">#frame{background-image:none;background-color:#FFFFFF;}</style></head><body style="padding-left:20px;background-image:none;background-color:#FFFFFF;text-align:center;">');
    a.document.write($get('print').innerHTML);
    a.document.write('</body></html>');
    a.document.close();
    a.print();
}
  
// CHANGE INPUT TYPE ***********************************************
function changeInputType(obj)
{
    if(obj.getAttribute('type')=='text')
    { 
        obj.setAttribute('type','password');
    }else
    {
        obj.setAttribute('type','text');
    }
    obj.focus();    
}

//SCRIPT MANAGER END
if(typeof(Sys) !== 'undefined'){
    Sys.Application.notifyScriptLoaded();
}
