﻿var glKyupShopcntTimeout = null;
var postbackElement;
function shopChngCnt(pbid) {
    if (glKyupShopcntTimeout != null) clearInterval(glKyupShopcntTimeout);
    glKyupShopcntTimeout = setTimeout(function() { __doPostBack(pbid,''); },500);
}

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);
function beginRequest(sender, args) {
    postbackElement = args.get_postBackElement();
}
function pageLoaded(sender, args) {
    if (typeof(postbackElement) === "undefined") return;
    if (postbackElement.id.toLowerCase().indexOf('btncnt') > -1) shopupdateCart();
    if (postbackElement.id.toLowerCase().indexOf('btndelete') > -1) shopupdateCart();    
    if (postbackElement.id.toLowerCase().indexOf('prices_button1') > -1) shopupdateCart();
}

function tb_changed(bid) {
    __doPostBack(bid,'');
}

var glBid=null;
var glTbTmt=null;
function tb_keydown(bid) {
    glBid = bid;
    if (glTbTmt != null) clearTimeout(glTbTmt);
    glTbTmt=setTimeout("tb_changed(glBid)",1000);
}
