/// <reference name="MicrosoftAjax.debug.js" />
/// <reference path="D:\WebControls\QWebControls\js\QFunctions.js" />
/// <reference path="D:\WebControls\QWebControls\js\QCore.js" />


var QWS = new Object;
//#region events
QWS.Init = new QEvent("QWS_Init");
//#endregion
QWS.EditMode = false;

QWS.ProductSorted = function(e, ui) {
    QCore.Debug.WriteLine("QShop.ProductSorted(ev,ui)");
    var index = ui.element.children().index(ui.item);
    var ctlName = QReplace(ui.item.attr('id'), '_', '$');
    QCore.AutoSubmit.CallBack(ctlName, index, 'Sorted', ui.item.get(0));
}

QWS.Init.AddHandler(function() {
    if (QWS.EditMode) {
        $('.Products .ProductType').sortable({
            tolerance: 'pointer',
            update: QWS.ProductSorted
        });
    }
});
QWS._Init = function() {
    QWS.Init.Raise();
}

QCore.Init.AddHandler(QWS._Init);




