﻿function OnClientDragStart(dock, args) {
     
}

function OnClientDragEnd(dock, args) {
    if (dock.get_dockZoneID() == "ctl00_RadPanelBar1_i0_i0_zoneCatalog") {
        dock.set_collapsed(true);
    } else {
        dock.set_collapsed(false);
    }
    dock.updateClientState();
}

function swapZoneLayout(sLayout) {
    var yesno = confirm("Warning this will remove all parts from your page! Continue?");
    if (yesno) {
        site.swapZoneLayout(sLayout, document.location.href, callback_swapZoneLayout);
    }
}
function callback_swapZoneLayout(res) {
    if (res.value == "OK") {
        location.reload(true);
    } else {
        alert("An Error has occured, please contact support@contractor.co.uk!");
    }
}




// admin specific
try {
    if (document.location.href.indexOf("ADMIN") > 0) {
        // handle the toolbox
        document.getElementById(document.getElementById("ctl00_mainContent_lblZoneLayout").innerHTML + "Off").style.display = "none";
        document.getElementById(document.getElementById("ctl00_mainContent_lblZoneLayout").innerHTML + "On").style.display = "block";
    }
} catch (e) { }
