﻿function CreateInitializeRequest(idf, idup, p, ilosc,uasd, UPCI) {
    return function(sender, args) {
    if (prm.get_isInAsyncPostBack()) args.set_cancel(true);
    if ((UPCI!='')&&(sender._postBackSettings.panelID.indexOf(UPCI)<0)) return null;
    var u = $get(idup);
    var f = $get(idf);
    var p = findPos(f);
    var h=f.offsetHeight;
    u.style.height=h+"px";
    u.style.width=f.offsetWidth+"px";
    u.style.left=p[0]+"px";
    u.style.top=p[1]+"px";
    if (p) {
    u.style.paddingTop=h/2-ilosc+"px";
    u.style.height=(h/2+ilosc)+"px";
    }else{
    u.style.height=h+"px";
    }
    if (uasd!=idup) u.style.display = 'block';         
  }
}
function CreateEndRequest(idup,UPCI){
    return function(sender, args) {
    if ((UPCI!='')&&(sender._postBackSettings)&&(sender._postBackSettings.panelID)&&(sender._postBackSettings.panelID.indexOf(UPCI)<0)) return null;
    $get(idup).style.display = 'none';
    }
}