var o4wScriptCache=[],o4wSheetCache=[],o4wImageCache=[],o4wOtherCache=[],o4wbcCurr="",o4wbcDiv="",o4wbcDivs="",o4wbcNames="",o4wbcPath="",o4wbcClass="",o4wbcFlags="",o4wbcImages="",o4wbcWarning="",o4wbcChanges="",o4wbSettingFlag="";function o4wload_stylesheet(a){var b;if(!o4wAlreadyLoaded(a,"sheet")){b=document.createElement("link");b.rel="stylesheet";b.type="text/css";b.href=a;document.getElementsByTagName("head")[0].appendChild(b)}}function o4wload_scripts(){var d=arguments.length,b=0,c,a;a=arguments[0];for(i=1;i<d;i++){if(!o4wAlreadyLoaded(arguments[i],"script")){c=document.createElement("script");c.type="text/javascript";c.src=arguments[i];c.onreadystatechange=function(){if(this.readyState=="complete"){a()}};c.onload=arguments[0];document.getElementsByTagName("head")[0].appendChild(c)}else{a()}}}function o4wpreload_images(){var c=arguments.length,a,b;for(b=0;b<c;b++){if(!o4wAlreadyLoaded(arguments[b],"image")){a=document.createElement("img");a.src=arguments[b]}}}function o4wAlreadyLoaded(d,b){var a,c=o4wOtherCache;if(b=="sheet"){c=o4wSheetCache}else{if(b=="image"){c=o4wImageCache}else{if(b=="script"){c=o4wScriptCache}}}a=jQuery.inArray(d,c);if(a==-1){c.push(d);return false}return true}function o4wload_response(strresponse){if(strresponse.length){if(strresponse.substring(0,1)=="*"){document.open("text/html","replace");document.write(strresponse.substring(1));document.close()}else{eval(strresponse)}}}function o4wFindForm(d){var a=$(d),c=a.closest("form"),b=$("input",c).length;if(b==0){c=$("#form"+d.substring(1));b=$("input",c).length}if(b==0){c=a;b=$("input",c).length}return c}function o4wDynamicResponse(a,e,b,g){var c=$("#"+e).parents("table"),d=$("#"+e).parent().parent().parent().parent().children(),h=d.index($("#"+e).parent().parent().parent()),f=$("#"+e).parent().parent().parent().children(),l=f.index($("#"+e).parent().parent()),j,k=0;g=g+"&o4wDynamicTable="+c.attr("id");if($("th",c).length==0){j=c.find("tbody tr:first").find("td:eq(1)");k=1;if($("div",j).length==0){k=0}h+=k}else{j=c.find("tbody tr:first").find("td:eq(0)");if($("div",j).length){k=1}l+=k;h+=1}g=g+"&o4wDynamicCol="+l+"&o4wDynamicRow="+h;o4wResponse(a,e,b,g)}function o4wResponse(a,e,b,k,l){var g=false,n,m,d,j,p="",o,h="",f,c;if(l!="1"){g=o4wFileResponse(a,e,b,k)}if(g==false){n=o4wFindForm(a);m=$("[o4wSelectAll=1]",n);if(m.length){for(d=0;d<m.length;d++){j=$(m[d]).attr("id");$("#"+j+" *").attr("selected","selected")}}$(".o4wencrypt",n).each(function(){if($(this).val()!="eNcRyPtEd"){$(this).blur()}});o=document.cookie.match("(^|;) ?o4wPHP=([^;]*)(;|$)");if(o){h=unescape(o[2])}if(h=="1"){f=n.serializeArray();jQuery.each(f,function(q,r){p=p+r.name+"[]="+encodeURIComponent(r.value)+"&"})}else{p=n.serialize()}c=origquery+"&O4WControl="+e+"&O4WEvent="+b;if(p!=""){c=c+"&"+p}c=c+k;$("#o4wWaitDiv").show();o4wBasicResponse(c,function(){$("#o4wWaitDiv").hide()})}}function o4wBasicResponse(b,a){o4wSubmissionCounter=o4wSubmissionCounter+1;$.ajax({cache:false,complete:a,data:b+"&O4WUniqueID="+o4wuniqueID+"&O4WSubCount="+o4wSubmissionCounter+o4wAddlParams,error:function(c,d){o4wAjaxError(c,d)},global:false,processData:false,success:function(c){o4wload_response(c)},type:"POST",url:origdispatch})}function o4wFileResponse(a,h,b,j){var k=o4wFindForm(a),f,c="",m,l,g,d=$("input",k).length,e;if(d==0){return false}e=$(".o4wfile",k);if(e.length>0){if($("#o4wpostframe").length){$("#o4wpostframe").remove()}f="<iframe id='o4wpostframe' name='o4wpostframe' src='about:none' />";$("#o4wSubmitFormDiv").append(f);$("#o4wpostframe").css("display","none");$("#o4wpostframe").load(function(){o4wUploadDone(a,h,b,j)});m=$('<input type="hidden" name="O4WControl" id="O4WControl" value="'+h+'" />');l=$('<input type="hidden" name="O4WEvent" id="O4WEvent" value="O4WUPLOAD" />');$(e).each(function(){c=c+$(this).attr("name")+","});g=$('<input type="hidden" name="O4WFields" id="O4WFields" value="'+c+'" />');$("#o4wWaitDiv").show();$(k).append(m).append(l).append(g);$(k).attr("action",origdispatch).attr("method","post").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data").attr("target","o4wpostframe").submit();$("#O4WControl").remove();$("#O4WEvent").remove();$("#O4WFields").remove();return true}return false}function o4wUploadDone(d,b,c,a){$("o4wWaitDiv").hide();o4wResponse(d,b,c,a,"1")}function o4wwindowopener(a,c){if($("#o4whintdiv").length){$("#o4whintdiv").remove()}var b="<div id='o4whintdiv'><input type='hidden' id='o4wwindowhint' name='o4wwindowhint' value='"+c+"' /><input type='hidden' id='o4wdestinationhint' name='o4wdestinationhint' value='"+a+"' /> </div>";$("#o4wSubmitFormDiv").append(b);$("#o4whintdiv").css("display","none");window.open(a,c)}function o4wTabNext(b,c,a){o4wTabMove(b,"1",c,a)}function o4wTabBack(b,c,a){o4wTabMove(b,"0",c,a)}function o4wTabMove(j,f,h,g){var k="#"+j,c=$(k).tabs("option","selected"),d=$(k).find("a").eq(c).attr("href"),e=$(d).find("form").attr("id"),b,a;if(f=="1"){b=c+1}else{b=c-1}if(b>=0){if(!e){e=$(k).closest("form").attr("id")}if(e){e="#"+e}else{e="#O4WformBody"}a="&O4WTab="+(b+1)+"&O4WPrevTab="+(c+1);g=a+g;o4wResponse(e,j,"TAB",g);$(k).tabs("enable",b).tabs("select",b);if(h=="1"){$(k).tabs("disable",c)}}}function o4wMoveValue(f,j,c){var a=$("#"+f),l=a.attr("type"),k,b,d,e,g,h;if(j){k=$("#"+j);b=k.attr("type");if(b=="select"||b=="select-one"||b=="select-multiple"){if(k.val("<none>").val()){k.val("<none>");$("#"+j+" :selected").remove()}if(k.val("").val()&&k.val("").text()==""){k.val("");$("#"+j+" :selected").remove()}}if(l=="text"){d=a.val();if(b=="text"){k.val(d)}else{if(b=="select"||b=="select-one"||b=="select-multiple"){if(!k.val(d).val()){k.append('<option value="'+d+'">'+d+"</option>")}}}}else{if(l=="select"||l=="select-one"||l=="select-multiple"){$("#"+f+" :selected").each(function(m,n){e=$(n).val();g=$(n).text();if(b=="text"){h=k.val();if(h==""){k.val(e)}else{if(h!=e&&h.indexOf(e+" ")==-1&&h.indexOf(" "+e)==-1){k.val(h+" "+e)}}}else{if(b=="select"||b=="select-one"||b=="select-multiple"){if(!k.val(e).val()){k.append('<option value="'+e+'">'+g+"</option>")}}}})}}}if(c=="1"){if(l=="text"){a.val("")}else{if(l=="select"||l=="select-one"||l=="select-multiple"){$("#"+f+" :selected").remove()}}}}function o4wSelectAll(c,a){var d=$("#"+c),b=d.attr("type");if(b="select-multiple"){$("#"+c+" *").attr("selected","");if(a=="1"){$("#"+c+" *").attr("selected","selected")}}}function o4wClearElement(a){$('input[name="'+a+'"]').each(function(){$(this).attr("checked",false);$(this).attr("selected",false)})}function o4wUpdateUnknownElement(f,a,e,b){var d=$("#"+f),h=d.attr("type"),c=1,g="";if(a=="text"){if(h=="text"||h=="hidden"||h=="password"||h=="textarea"){if(d.val()==e){c=0}d.val(e)}else{if(d.text()==e){c=0}d.text(e)}}else{if(a=="checked"){if(h=="radio"||h=="checkbox"){if(d.attr("checked")){if(e=="checked"||e=="1"||e=="true"){c=0}}else{if(e=="0"||e==""||e=="false"){c=0}}d.attr("checked",e)}else{g="";if(e=="checked"){g="selected"}if(d.attr("selected")){if(g=="selected"){c=0}}else{if(g==""){c=0}}d.attr("selected",g)}}}if(b=="1"||(b=="-1"&&c==1)){d.change()}}function o4wDeleteRowFromButton(a){o4wDeleteRowFromButtonCommon(a,false)}function o4wDeleteRowFromButtonSpecial(a){o4wDeleteRowFromButtonCommon(a,true)}function o4wDeleteRowFromButtonCommon(b,a){var c=$(b).parents("tr"),d=c.parents("table");if(d.children("tbody").children("tr").length<1){return false}if(d.children("tbody").children("tr").length==1){if(!a){return false}d.data("lastrow",c)}c.remove()}function o4wClearSelection(a){$(".o4wClearDuplicateText",a).text("");$(".o4wClearDuplicateVal",a).val("");$(".o4wClearDuplicateCheckbox",a).attr("checked",false);$(".o4wClearDuplicateRadio",a).attr("checked",false);$(".o4wClearDuplicateCombo",a).find("option:first").attr("selected","selected").parent("select")}function o4wReplug(myDom){var fnName,addParamStr,addParams;$(myDom).find(".color_picker").remove();$(".o4wpicker",myDom).each(function(){fnName=$(this).attr("o4wpickerfn");addParamStr=$(this).attr("o4wpickerparam");if(addParamStr!=""){addParams=eval("("+addParamStr+")")}else{addParams={}}if(fnName=="datepicker"){$(this).removeClass("hasDatepicker");$(this).datepicker(addParams)}else{if(fnName=="timeEntry"){$(this).timeEntry("destroy");$(this).timeEntry(addParams)}else{if(fnName=="colorPicker"){$(this).colorPicker()}else{if(fnName=="date_input"){$(this).unbind();$(this).date_input(addParams)}else{}}}}})}function o4wInsertRowFromButton(c,e){var f=$(c).parents("tr"),a=f.parents("table"),d=a.data("iCounter"),b;if(isNaN(d)){d=0}else{if(d==null){d=0}}a.data("iCounter",d+1);b=f.clone(true);if(e=="1"){o4wClearSelection(b)}o4wRenameElement(b,d);o4wReplug(b);b.insertBefore(f)}function o4wInsertRow(b,c){var a=$("#"+b),d=a.data("iCounter");if(isNaN(d)){d=0}else{if(d==null){d=0}}a.data("iCounter",d+1);o4wInsertRowCommon(b,c,d)}function o4wInsertRowCommon(b,e,c){var a=$("#"+b),f,d;if(e=="0"){f=a.children("tbody").children("tr:first")}else{if(e=="-1"){f=a.children("tbody").children("tr:last")}else{f=a.children("tbody").children("tr:eq("+(e-1)+")")}}if(f.length==0||f.children("th").length){f=a.data("lastrow");if(f.length>0){o4wClearSelection(f);o4wRenameElement(f,c);o4wReplug(f);a.append(f)}}else{d=f.clone(true);o4wClearSelection(d);o4wRenameElement(d,c);o4wReplug(d);if(e=="-1"){d.insertAfter(f)}else{d.insertBefore(f)}}}function o4wDeleteRow(b,c){var a=$("#"+b);if(a.children("tbody").children("tr").length<1){return false}if(a.children("tbody").children("tr").length==1){a.data("lastrow",a.children("tbody").children("tr"))}if(c=="0"){a.children("tbody").children("tr:first").remove()}else{if(c=="-1"){a.children("tbody").children("tr:last").remove()}else{a.children("tbody").children("tr:eq("+(c-1)+")").remove()}}}function o4wDeleteColFromButton(b){var c=$(b).parents("tr"),a=c.children().index($(b).parent()),d;if(c.find("td").length<=2){}else{d=c.parents("table");d.find("tr").each(function(){$(this).find("td:eq("+a+")").remove()})}}function o4wInsertColFromButton(b,f){var a=$(b).parents("table"),d=a.data("iCounter"),g,c,e;if(isNaN(d)){d=0}else{if(d==null){d=0}}a.data("iCounter",d+1);g=$(b).parents("tr");c=g.children().index($(b).parent());a.find("tr").each(function(){e=$(this).find("td:eq("+c+")").clone(true);if(f=="1"){o4wClearSelection(e)}o4wRenameElement(e,d);o4wReplug(e);e.insertBefore($(this).find("td:eq("+c+")"))})}function o4wInsertCol(b,d){var a=$("#"+b),c=a.data("iCounter");if(isNaN(c)){c=0}else{if(c==null){c=0}}a.data("iCounter",c+1);o4wInsertColCommon(b,d,c)}function o4wInsertColCommon(b,f,d){var a=$("#"+b),c,e;a.find("tr").each(function(){if(f=="0"){c=$(this).find("td:eq(1)")}else{if(f=="-1"){c=$(this).find("td:last")}else{c=$(this).find("td:eq("+(f)+")")}}e=c.clone(true);o4wClearSelection(e);o4wRenameElement(e,d);o4wReplug(e);if(f=="-1"){e.insertAfter(c)}else{e.insertBefore(c)}})}function o4wDeleteCol(b,c){var a=$("#"+b);if(a.find("tbody tr:first").find("td").length<=2){}else{a.find("tr").each(function(){if(c=="0"){$(this).find("td:eq(1)").remove()}else{if(c=="-1"){$(this).find("td:last").remove()}else{$(this).find("td:eq("+(c)+")").remove()}}})}}function o4wBreadCrumbs(j,d,h,k,c,g,f){o4wbcDiv=j;o4wbcDivs=d;o4wbcNames=h;o4wbcImages=k;o4wbcFlags=c;o4wbcClass=g;o4wbcChanges=f;var b=o4wbcDivs.split(">"),a=$("#"+j),e;for(e=0;e<b.length;e++){$("#"+b[e]).hide()}a.addClass(g)}function o4wDropBreadCrumb(g){var a="",w=0,o=o4wbcDivs.split(">"),n=o4wbcNames.split(">"),l=o4wbcImages.split(">"),d=o4wbcFlags.split(">"),p=o4wbcPath.split(">"),b=o4wbcChanges.split(">"),h,e,q,f,v,t,u="",m="",c=1,k="",s,r;if(o4wbcCurr.length){h=$("#"+o4wbcCurr);h.hide()}o4wsetConfirmUnload(false);e=g*1;if(isNaN(e)==false){e=e-1;g=p[e];m=d[e]}else{for(s=0;s<o.length;s++){v=o[s];if(v==g){m=d[s]}}}o4wbcCurr=g;q=$("#"+o4wbcCurr);if(m.length){o4wResponse(o4wbcCurr,o4wbcCurr,"BCLICK","")}else{q.show()}f=$("#"+o4wbcDiv);f.html("").addClass(o4wbcClass);if(o4wbcPath.length){for(s=0;s<p.length;s++){v=p[s];if(w==0){if(v==g){w=1}else{a=a+v+">";t=v;u="";m="";for(r=0;r<o.length;r++){if(o[r]==v){t=n[r];u=l[r];m=d[r]}}if(u.length){f.append('<a href="#'+v+'" id="bc_'+v+'" class="BCRUMB_ALL BCRUMB_INACTIVE"><img src="'+u+'" alt="'+t+'"></a>')}else{f.append('<a href="#'+v+'" id="bc_'+v+'" class="BCRUMB_ALL BCRUMB_INACTIVE">'+t+"</a>")}q=$("#bc_"+v);if(m.length){q.click(function(){q=$(this).attr("id");o4wResponse(q,q,"BCLICK","");return false})}else{q.click(function(){c=1;if(o4wbcWarning.length){if(confirm(o4wbcWarning)){c=1}else{c=0}}if(c==1){o4wsetConfirmUnload(false);q=$(this).attr("id");o4wDropBreadCrumb(q.substring(3))}return false})}}}}}a=a+g;t=g;u="";k="";for(r=0;r<o.length;r++){if(o[r]==g){t=n[r];u=l[r];k=b[r]}}if(u.length){f.append('<a href="#" id="bc_'+g+'" class="BCRUMB_ALL BCRUMB_ACTIVE"><img src="'+u+'" alt="'+t+'"></a>')}else{f.append('<a href="#" id="bc_'+g+'" class="BCRUMB_ALL BCRUMB_ACTIVE">'+t+"</a>")}q=$("#bc_"+g);q.click(function(){return false});o4wHandleHistory("add",{pathNames:["section",o4wbcDiv,g,t]});if(k=="1"){$("#"+g+" :input").bind("change",function(){o4wsetConfirmUnload(true)})}o4wbcPath=a}function o4wsetConfirmUnload(a){if(a){o4wbcWarning=o4wunloadMessage();window.onbeforeunload=o4wunloadMessage}else{o4wbcWarning="";window.onbeforeunload=null}}function o4wunloadMessage(){return"You have entered or modified information on this page. If you navigate away from this page without saving your data, your changes will be lost."}function o4wRegisterChangeDynamic(b,a,c){o4wRegisterChangeHandler(b,a,c,1)}function o4wRegisterChange(b,a,c){o4wRegisterChangeHandler(b,a,c,0)}function o4wRegisterChangeHandler(a,h,g,c){var d="",j="",b,f,e;if(h=="select"){d="select[name='"+a+"']";j="1"}else{d="input[type='"+h+"'][name='"+a+"']"}if(a.substr(0,1)=="#"){$(a).change(function(){if(j=="1"){b=$("option:selected",this)}else{b=$(this)}f=$(this).attr("id");e=$(b).val();if(c==0){o4wResponse("#"+f,f,"CHANGE","&O4WChangeID="+escape(f)+"&O4WChangeValue="+escape(e)+g)}else{if(c==1){o4wDynamicResponse("#"+f,f,"CHANGE","&O4WChangeID="+escape(f)+"&O4WChangeValue="+escape(e)+g)}}})}else{$(d).change(function(){if(j=="1"){b=$("option:selected",this)}else{b=$(this)}f=$(b).attr("id");e=$(b).val();if(c==0){o4wResponse("#"+f,a,"CHANGE","&O4WChangeID="+escape(f)+"&O4WChangeValue="+escape(e)+g)}else{if(c==1){o4wDynamicResponse("#"+f,a,"CHANGE","&O4WChangeID="+escape(f)+"&O4WChangeValue="+escape(e)+g)}}})}}function o4wRenameElement(d,c){var a,b,e;if(d.length){b=$(d).attr("name");if(b&&b.length){$(d).attr("name",b+"_O4WIGNORE_"+c)}a=$(d).attr("id");if(a&&a.length){e=a.indexOf("_o4wid_");if(e>=0){a=a.substr(0,e)}$(d).attr("id",a+"_o4wid_"+c)}$(d).children().each(function(){o4wRenameElement($(this),c)})}}function o4wValidationDisplay(c,d){var a=$("#"+c),b=$("#o4werr_"+c);if(d.length){if(b.length==0){a.after('<span id="o4werr_'+c+'" style="color:red">'+d+"</span>")}else{b.text(d)}}else{if(b){b.remove()}}}function o4wDoPopup(g,d,f,a,h,e){if($("#o4wIPopup").length){$("#o4wIPopup").remove()}if($("#o4wFPopup").length){$("#o4wFPopup").remove()}if(h.length==0){h=500}if(e.length==0){e=800}$("#o4wPopup").dialog("destroy");if(g.indexOf("O4W_")>=0){if(g.indexOf("?")>=0){g+="&o4wIFRAME=1"}else{g+="?o4wIFRAME=1"}}var c=$("<iframe id='o4wIPopup' name='o4wIPopup' src='"+g+"' width='100%' height='100%'/>"),b=$('<form id="o4wFPopup"><input type="hidden" name="o4wTarget" id="o4wTarget" value="'+d+'" /><input type="hidden" name="o4wValue" id="o4wValue" value="nothing" /><input type="hidden" name="o4wPopupCtl" value="'+f+'" /></form>');$("#o4wPopup").append(b).append(c);$("#o4wPopup").dialog({autoOpen:false,title:a,height:h*1,width:e*1,buttons:{Close:function(){$(this).dialog("close")}}}).dialog("open")}function o4wReturnFromPopup(a){var b=$("#o4wTarget").val();$("#o4wValue").val(a);$("#o4wPopup").dialog("close");o4wResponse("#o4wFPopup",b,"RETURNVALUE","")}function o4wAjaxError(b,e){$("#o4wWaitDiv").hide();if(o4wCommErrorText==""){o4wCommErrorText="We're sorry, your request was unable to be completed at this time due to a communications %1%.  Detailed reason:\n\n%2%"}var a=b.statusText,d,c;if(a==""){a=e}d=o4wCommErrorText.replace(/%1%/g,a);c=b.responseText;if(c==""){c="Unspecified"}d=d.replace(/%2%/g,c);alert(d)}function o4wSpecialForm(b,e,a){var f="<form id='o4wpostform' name='o4wpostform' ></form>",c,d;$("#o4wSubmitFormDiv").append(f);c=$("#o4wpostform");d=location.protocol+"//"+location.host+location.pathname;if(origquery!=""){d+="?"+origquery}a=a.replace(/%1%/g,d);a=a.replace(/&#37;1&#37;/g,d);if(origquery==""){d+="?"}else{d+="&"}a=a.replace(/%2%/g,d);a=a.replace(/&#37;2&#37;/g,d);$(c).append(a).attr("action",b).attr("method","post").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data");if(e!=""){$(c).attr("target",e)}$(c).submit();$(c).remove()}function o4wScrollTable(a,e,g){var c=$("#"+a),f=$("#"+a+" tbody"),d=$("#"+e),b=false;if($.browser.mozilla&&g=="1"){if(d.css("width")&&d.css("width")!="auto"){c.css("width",d.css("width"));f.css("width",d.css("width"));b=true}if(d.css("height")&&d.css("height")!="auto"){c.css("height",d.css("height"));f.css("height",d.css("height"));b=true}f.css("overflow","auto")}if(!b){d.css("overflow","auto")}}function o4wTableUpdateDetails(b,a,f,e,d){var c=$("#"+b);if(e!=""||d=="1"){c.data("iCurrPage",e)}if(a!=""||d=="1"){c.data("iRowsPerPage",a)}if(f!=""||d=="1"){c.data("iMaxRows",f)}}function o4wTableBuildPage(l,e,a){var p=$("#"+l),n=p.data("iCurrPage"),c=p.data("iRowsPerPage"),m=p.data("iMaxRows"),j=1,o=1,k=1,d,h,g,f,b;if(isNaN(n)){n=0}else{if(n==null){n=0}}if(isNaN(c)){k=0;c=20}else{if(c==null){c=20;k=0}}if(isNaN(m)){m=0;o=0}else{if(m==null){m=0;o=0}}m=m*1;c=c*1;n=n*1;d="O4WControl="+l+"&O4WEvent=TABLE_BUILD_PAGE&O4WRowsPerPage="+c;$("#o4wWaitDiv").show();if(e=="all"){d=d+"&O4WStartRow=1&O4WNumRows=-1"}else{if(e=="first"||e=="init"){h=(c-1);if(c>m&&o==1&&m>0){h=m-1}d=d+"&O4WStartRow=1&O4WNumRows="+h;p.data("iCurrPage","1");if(e=="init"){d=d+"&O4WTableInit=1"}else{if(n=="1"){j=0}}}else{if(e=="last"){if(m!=0){g=Math.ceil(m/c);f=(g-1)*c+1;h=(c-1);b=f+h;if(b>m){h=m-f}d=d+"&O4WStartRow="+f+"&O4WNumRows="+h;if(n==g){j=0}else{p.data("iCurrPage",g)}}else{d=d+"&O4WStartRow=-1&O4WNumRows="+numPerPage}}else{if(e=="next"){f=(n*c)+1;h=(c-1);b=f+h;if(f<=m&&m!=0){if(b>m){h=m-f}d=d+"&O4WStartRow="+f+"&O4WNumRows="+h;p.data("iCurrPage",n+1)}else{j=0}}else{if(e=="prev"){f=(n-2)*c+1;h=(c-1);b=f+h;if(f>0&&(f<m&&m!=0)){if(b>m){h=m-f}d=d+"&O4WStartRow="+f+"&O4WNumRows="+h;p.data("iCurrPage",n-1)}else{j=0}}}}}}if(j==1){if(a!=""){d=d+"&"+a}o4wBasicResponse(d,function(){$("#o4wWaitDiv").hide()})}else{$("#o4wWaitDiv").hide()}}function o4wTableSort(c,b,g){var d=$("#"+c),a=d.data("headerDir"+b),e=d.data("iRowsPerPage"),f;$("#o4wWaitDiv").show();if(a=="1"){a="0"}else{a="1"}d.data("headerDir"+b,a);if(isNaN(e)){e=20}else{if(e==null){e=20}}e=e*1;f="O4WControl="+c+"&O4WEvent=TABLE_SORT&O4WSortDir="+a+"&O4WSortCol="+(b*1+1*1)+"&O4WRowsPerPage="+e+"&O4WStartRow=1&O4WNumRows="+(e-1);if(g!=""){f=f+"&"+g}d.data("iCurrPage","1");o4wBasicResponse(f,function(){$("#o4wWaitDiv").hide()})}function o4wSelectTab(b,c){var a=$("#"+b),e=c*1,d=a.tabs("option","selected");if(d!=e){a.tabs("enable",e);a.tabs("select",e)}}function o4wHandleHistory(k,b){var l=b.pathNames,c=l.length,h="",j="",d="",e="",a="",f="",g=0,m=0;if(k=="init"||k=="add"){if(o4wbSettingFlag!="-1"){if(k=="init"){o4wbSettingFlag="1"}j=$.address.value().substring(1).split("/");if(j==""){c=0}else{c=j.length}a=encodeURIComponent(b.pathNames[1]);for(m=0;m<c&&g==0;m+=4){if(j[m]==b.pathNames[0]&&j[m+1]==a){if(j[m+2]==encodeURIComponent(b.pathNames[2])&&j[m+3]==encodeURIComponent(b.pathNames[3])&&m+4>=c){g=-1}else{g=1}}else{d+=e+j[m]+"/"+j[m+1]+"/"+j[m+2]+"/"+j[m+3];e="/"}}if(g!="-1"){d+=e+b.pathNames[0]+"/"+a+"/"+encodeURIComponent(b.pathNames[2])+"/"+encodeURIComponent(b.pathNames[3]);$.address.value(d)}}o4wbSettingFlag="0"}else{if(k=="change"){if(o4wbSettingFlag!="1"){if(b.pathNames!=""){if($.address.title()!=""){a=$.address.title().split("|")[0]}else{a=$.address.baseURL()}for(m=0;m<c;m+=4){h=(c>m?l[m]:"");j=(c>m+1?decodeURIComponent(l[m+1]):"");d=(c>m+2?decodeURIComponent(l[m+2]):"");e=(c>m+3?decodeURIComponent(l[m+3]):"");if(h=="tab"&&j!=""&&d!=""){if($("#"+j).tabs("option","enabled")){o4wbSettingFlag="-1";$("#"+j).tabs("select",d*1);if(e==""&&d==0){}else{if(e==""){e="Tab "+d}if(e!=""){e=" | "+e}a=a+e}}}else{if(h=="section"&&d!=""){if(d!=o4wbcCurr){o4wbSettingFlag="-1";o4wDropBreadCrumb(d)}if(e==""){e="Section "+d}if(e!=""){e=" | "+e}a=a+e}else{if(h="user"&&j!=""){f="O4WControl="+j+"&O4WEvent=HISTORY";if(d!=""){f=f+"&"+d}if(e!=""){a=a+" | "+e}$("#o4wWaitDiv").show();o4wBasicResponse(f,function(){$("#o4wWaitDiv").hide()})}}}}$.address.title(a)}}o4wbSettingFlag=""}}}function o4wjq(a){a.replace(/(:|\.)/g,"\\$1");return(a.substr(0,1)=="#"?a:"#"+a)};
