/***

    Polaris.Polaris 1.0 : PACKED VERSION

    THIS FILE IS AUTOMATICALLY GENERATED.  If creating patches, please
    diff against the source tree, not this file.

    See <http://polarisnow.com/> for documentation, downloads, license, etc.

    (c) 2007 Bart Bons.  All rights Reserved.

***/

var isUndefined=function(v){
var _2;
return v===_2;
};
var hasMochiKitEffects=typeof (MochiKit.Visual)!="undefined";
if(typeof (log)=="undefined"){
var log=function(){
};
}
if(typeof (roundElement)=="undefined"){
var roundElement=function(){
};
}
if(typeof (roundClass)=="undefined"){
var roundClass=function(){
};
}
if(typeof (Polaris)=="undefined"){
Polaris={};
}
Polaris.VERSION="2.3";
Polaris.NAME="Polaris";
var Base=MochiKit.Base;
Polaris.Base={};
Base.update(Polaris.Base,{mConnect:function(_3,_4,_5){
map(function(_6){
if(_6){
connect(_6,_4,bind(_5,_6));
}
},_3);
},encryptPasswordFields:function(_7,_8,_9){
$(_7).name="";
$(_8).value=hex_md5(hex_md5($("pass").value)+_9);
return true;
},argItems:function(_a){
var _b=parseQueryString(location.search);
return _b[_a];
},trim:function(s){
return s.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");
},remove:function(s,t){
return s.replace(new RegExp(t,"g"),"");
},checkPattern:function(e,_10){
e=e.target();
if(_10.test(e.value)==false){
alert("Not numeric in "+e.name);
field.value=0;
}
},encodeUrlValue:function(_11){
var _12=escape(_11);
_12=_12.replace(/\//g,"%2F");
_12=_12.replace(/\?/g,"%3F");
_12=_12.replace(/=/g,"%3D");
_12=_12.replace(/&/g,"%26");
_12=_12.replace(/@/g,"%40");
return _12;
},getQueryParameter:function(key,_14){
var _15=parseQueryString(_14);
return _15[key];
},removeQueryParameter:function(key,_17){
if(_17==""){
return [];
}
var _18=parseQueryString(_17);
_18[key]="";
return queryString(_18);
},addQueryParameter:function(key,_1a,_1b){
_1b=Polaris.Base.removeQueryParameter(key,_1b);
var _1c=parseQueryString(_1b);
_1c[key]=_1a;
return queryString(_1c);
},getLocationVariable:function(key){
return Polaris.Base.getQueryParameter(key,window.location.search);
},removeLocationVariable:function(key){
var _1f=Polaris.Base.removeQueryParameter(key,window.location.search);
return window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+_1f;
},addLocationVariable:function(key,_21){
var _22=Polaris.Base.addQueryParameter(key,_21,window.location.search);
return window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+_22;
},masterItemSelect:function(on){
if(!on){
removeElementClass(document.body,"insert");
addElementClass(document.body,"allitems");
}else{
addElementClass(document.body,"insert");
removeElementClass(document.body,"search");
removeElementClass(document.body,"allitems");
}
},rawPopup:function(url,_25,_26){
var _27="width=640,height=480,scrollbars,resizable,toolbar,status,menubar,location";
var _28=navigator.userAgent.toLowerCase();
var _29=(_28.indexOf("opera")!=-1)?true:false;
if(isUndefined(_26)){
_26=_27;
}
if(isUndefined(_25)){
_25="_blank";
}
var _2a=window.open(url,_25,_26);
if(_2a&&!_29){
_2a.focus();
}
return (_2a)?false:true;
},linkPopup:function(src,_2c){
if(typeof (_2c)=="undefined"){
_2c="width="+Math.floor(screen.availWidth*0.8)+",height="+Math.floor(screen.availHeight*0.8);
}
return Polaris.Base.rawPopup(src.getAttribute("href"),src.getAttribute("target")||"_blank",_2c);
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Base.EXPORT_OK=[];
Polaris.Base.EXPORT=["mConnect","encryptPasswordFields","argItems","trim","remove","encodeUrlValue","getLocationVariable","removeLocationVariable","addLocationVariable","rawPopup","linkPopup"];
Polaris.Base.__new__();
Base._exportSymbols(this,Polaris.Base);
Polaris.Visual={};
Base.update(Polaris.Visual,{timerMouseout:null,hideSubmenu:function(){
setStyle($("submenucontainer"),{"visibility":"hidden"});
setStyle($("submenucontainer"),{"display":"none"});
replaceChildNodes($("submenucontainer"),{});
},buildHorizontalSubmenus:function(_2d){
for(var i=0;i<_2d.length;i++){
if(document.getElementById(_2d[i])){
var _2f=document.getElementById(_2d[i]).getElementsByTagName("ul");
for(var t=0;t<_2f.length;t++){
var li=_2f[t].parentNode;
if(li.parentNode.id==_2d[i]){
setStyle(_2f[t],{"top":li.offsetHeight-6+"px"});
setStyle(_2f[t],{"left":"0px"});
}else{
setStyle(_2f[t],{"left":_2f[t-1].getElementsByTagName("a")[0].offsetWidth+"px"});
}
connect(li,"onclick",function(e){
var _33=$(this.getElementsByTagName("ul")[0]);
if((typeof (timerMouseout)!="undefined")){
clearTimeout(timerMouseout);
}
var div=$("submenucontainer");
if(getStyle(div,"display")!="block"){
setStyle(div,{"visibility":"visible"});
setStyle(div,{"display":"block"});
var pos=getElementPosition(this);
var dim=getElementDimensions(this);
elemcopy=_33.cloneNode(true);
setStyle(div,{"top":pos.y+dim.h+"px"});
setStyle(div,{"left":pos.x+"px"});
replaceChildNodes($("submenucontainer"),elemcopy);
}else{
Polaris.Visual.hideSubmenu();
}
});
connect(li,"onmouseover",function(e){
var div=$("submenucontainer");
if(getStyle(div,"display")=="block"){
var _39=$(this.getElementsByTagName("ul")[0]);
if(_39.childNodes.length!=0){
if((typeof (timerMouseout)!="undefined")){
clearTimeout(timerMouseout);
}
var pos=getElementPosition(this);
var dim=getElementDimensions(this);
elemcopy=_39.cloneNode(true);
setStyle(div,{"top":pos.y+dim.h+"px"});
setStyle(div,{"left":pos.x+"px"});
replaceChildNodes($("submenucontainer"),elemcopy);
}else{
Polaris.Visual.hideSubmenu();
}
}
});
connect(li,"onmouseout",function(e){
timerMouseout=setTimeout(Polaris.Visual.hideSubmenu,200);
});
connect($("submenucontainer"),"onmouseover",function(e){
if((typeof (timerMouseout)!="undefined")){
clearTimeout(timerMouseout);
}
});
connect(currentDocument,"onmouseover",function(e){
log("doc mouseover");
});
}
}
}
},stripeTable:function(t){
var _40=t.getElementsByTagName("tr");
for(var l=1;l<_40.length;l+=2){
addElementClass(_40[l],"odd");
}
},stripeTables:function(){
map(Polaris.Visual.stripeTable,getElementsByTagAndClassName("table","striped"));
},yellowFade:function(_42){
var _43=$(_42);
Polaris.Visual._yellowFadeOriColor=_43.style.backgroundColor;
Polaris.Visual._yellowFade(Polaris.Visual._yellowFadeStartAt,_42);
},FADESTEPS:{1:"ff",2:"f0",3:"ee",4:"e0",5:"dd",6:"d0",7:"cc",8:"c0",9:"bb",10:"b0",11:"aa",12:"a0",13:"99",14:"90"},_yellowFadeOriColor:0,_yellowFadeStartAt:14,_yellowFadeInterval:100,_yellowFade:function(_44,_45){
var _46=$(_45);
var _47=Polaris.Visual;
if(_44>=1){
setStyle(_46,{backgroundColor:"#ffff"+_47.FADESTEPS[_44]});
if(_44==1){
setStyle(_46,{backgroundColor:_47._yellowFadeOriColor});
}
if(_44==_47._yellowFadeStartAt){
customFadeInterval=1200;
}else{
customFadeInterval=_47._yellowFadeInterval;
}
_44--;
setTimeout("Polaris.Visual._yellowFade("+_44+",'"+_45+"')",customFadeInterval);
}
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Visual.EXPORT_OK=[];
Polaris.Visual.EXPORT=["stripeTable","stripeTables","yellowFade"];
Polaris.Visual.__new__();
Base._exportSymbols(this,Polaris.Visual);
Polaris.Window={};
Base.update(Polaris.Window,{maximizeForm:function(){
var _48=function(){
if($("headercomplete").style.display=="none"){
$("toggleMaximize").childNodes[0].src=_serverroot+"/images/maxarrowdown.gif";
}else{
$("toggleMaximize").childNodes[0].src=_serverroot+"/images/maxarrow.gif";
}
Polaris.Window.resizeCustomForm();
};
if(hasMochiKitEffects){
toggle("headercomplete","blind",{afterFinish:_48});
}else{
if(getStyle("headercomplete","display")=="none"){
showElement("headercomplete");
}else{
hideElement("headercomplete");
}
_48();
}
},resizeCustomForm:function(){
if($("customform_iframe")){
var _49=window.innerHeight?window.innerHeight:document.documentElement.clientHeight;
var _4a=29;
if($("constructtitle")){
_4a+=$("constructtitle").scrollHeight;
}
if($("headercomplete")){
_4a+=$("headercomplete").clientHeight;
}
$("customform_iframe").style.height=(_49-_4a)+"px";
}
},openCenteredWindow:function(url,_4c,_4d,_4e,_4f){
var _50=Math.floor((screen.width-_4d)/2);
var top=Math.floor((screen.height-_4c)/2);
var _52="top="+top+",left="+_50+",height="+_4c+",width="+_4d;
if(_4f){
_52+=","+_4f;
}
var win=window.open(url,_4e,_52);
if(parseInt(navigator.appVersion)>=4){
win.window.focus();
}
return win;
},openMaxApp:function(e,_55){
return Polaris.Window.openCenteredWindow(e.href,screen.height*0.75,screen.width*0.75,_55,"status=yes,toolbar=yes,menubar=yes,location=yes");
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Window.EXPORT_OK=[];
Polaris.Window.EXPORT=["maximizeForm","resizeCustomForm","openCenteredWindow","openMaxApp"];
Polaris.Window.__new__();
Base._exportSymbols(this,Polaris.Window);
Polaris.Timer={};
Base.update(Polaris.Timer,{countdownPaused:false,pauseCountdown:function(){
Polaris.Timer.countdownPaused=true;
},refreshCountDown:function(_56){
_56--;
var ri=$("refresh_interval");
if(Polaris.Timer.countdownPaused){
if(ri){
if(ri.options[ri.selectedIndex].text!="paused"){
var _58=document.createElement("option");
}
_58.text="paused";
_58.value="";
try{
ri.add(_58,null);
}
catch(ex){
ri.add(_58);
}
ri.selectedIndex=ri.options.length-1;
}
}else{
if(_56<=0){
window.location.reload();
}else{
if(ri){
ri.options[ri.selectedIndex].text=_56+" sec";
}
setTimeout("Polaris.Timer.refreshCountDown("+_56+")",1000);
}
}
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Timer.EXPORT_OK=[];
Polaris.Timer.EXPORT=["pauseCountdown","refreshCountDown"];
Polaris.Timer.__new__();
Base._exportSymbols(this,Polaris.Timer);
Polaris.Form={};
Base.update(Polaris.Form,{validateLowerCase:function(e){
e=e.target();
if(e){
e.value=e.value.toLowerCase();
}
},validateUpperCase:function(e){
e=e.target();
if(e){
e.value=e.value.toUpperCase();
}
},validateFloat:function(e){
e=e.target();
if(e){
e.value=e.value.replace(",",".");
}
},addLabelFocus:function(){
if(this.getAttribute("for")!=""){
var _5c=$(this.getAttribute("for"));
}
if(_5c){
_5c.focus();
if(_5c.getAttribute("type")=="checkbox"){
_5c["checked"]=!_5c["checked"];
}else{
if(_5c.getAttribute("type")=="radio"){
var _5d=document.getElementsByTagName("input");
var _5e=new Array();
for(i=0;i<_5d.length;i++){
if(_5d[i].getAttribute("name")==_5c.getAttribute("name")){
_5e.push(_5d[i]);
}
}
for(i=0;i<_5e.length;i++){
if(_5e[i]["checked"]&&_5e[i].getAttribute("id")!=_5c.getAttribute("id")){
_5e[i]["checked"]=false;
}
}
_5c["checked"]=true;
}
}
}
},setFocusFirstField:function(_5f){
if(/\/insert\//.test(window.location)){
if(_5f){
fields=_5f.getElementsByTagName("input");
for(var i=0;i<fields.length;i++){
if(fields[i].type=="text"&&fields[i].value==""&&Polaris.Form.checkVisibility(fields[i])){
fields[i].focus();
break;
}
}
}
}
},checkVisibility:function(_61){
if(hasElementClass(_61,"alwayscheckrequired")){
return true;
}else{
var _62=(MochiKit.Style.getStyle(_61,"display")!="none")&&(MochiKit.Style.getStyle(_61,"visibility")!="hidden")&&(getNodeAttribute(_61,"type")!="hidden");
if(!_61.parentNode){
return false;
}
if(_61.parentNode.tagName.toUpperCase()=="BODY"||!_62){
return _62;
}
return this.checkVisibility(_61.parentNode);
}
},adjustLabelWidth:function(_63){
var _64=getElementsByTagAndClassName("label","label",_63);
var max=0;
for(var i=0;i<_64.length;i++){
if(_64[i].clientWidth>max){
max=_64[i].clientWidth;
}
}
max=max-10;
var w=max;
map(function(e){
try{
e.style.width=w+"px";
}
catch(ex){
}
},_64);
},_protectButton:function(_69,_6a){
if((hasElementClass(_69.form,"validate"))||(_69.type=="button")||_6a){
}
},protectButton:function(e){
Polaris.Form._protectButton(e.target(),false);
},protectFormButtons:function(_6c){
var _6d=_6c.getElementsByTagName("input");
for(var i=0;i<_6d.length;i++){
if(_6d[i].type=="submit"||_6d[i].type=="button"||_6d[i].type=="reset"){
Polaris.Form._protectButton(_6d[i],true);
}
}
},showAsPopBox:function(_6f,url,_71,_72){
var _73={caption:_6f,height:_71||screen.availHeight*0.6,width:_72||screen.availWidth*0.6,center_win:true,overlay_click_close:true};
var win=new GB_Window(_73);
return win.show(url);
},closePopup:function(){
if(typeof (window.parent.parent.GB_CURRENT.hide)!="undefined"){
window.parent.parent.GB_CURRENT.hide();
}else{
window.close();
}
},setAutoSuggest:function(e){
var _76=getNodeAttribute(e,"id");
var _77=getNodeAttribute(e,"realname");
if(!_77){
var _77=getNodeAttribute(e,"name");
}
var asg=new Polaris.AutoSuggest.createAutoSuggest(_76,_76+"_AS",{script:_serverroot+"/services/rest"+getNodeAttribute(e,"ajaxurl")+"/?output=json&",varname:"q",valuefield:_77,captionfield:getNodeAttribute(e,"captionflds")});
},selectAutoSuggestRecord:function(e){
if(window.parent.parent){
var _7a=window.parent.parent.document;
var _7b=getNodeAttribute(e,"autosuggestfield");
var _7c=getNodeAttribute(e,"recordid");
var _7d=_7b+":"+_7c;
var _7e=_7a.getElementById(_7b);
if(_7e){
if($(_7d)){
_7e.value=$(_7d).value;
var _7f=getNodeAttribute(_7e,"showfld");
var _80=getNodeAttribute(_7e,"captionflds");
_7a.getElementById(_7f).value=$("_fld"+_80+":"+_7c).value;
}else{
alert(_7b+" was not found in the current form. Please include the field in the form.");
}
}
}else{
alert("Value was not set. Main window was not available");
}
Polaris.Form.closePopup();
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Form.EXPORT_OK=[];
Polaris.Form.EXPORT=["validateLowerCase","validateUpperCase","validateFloat","addLabelFocus","setFocusFirstField","checkVisibility","adjustLabelWidth","protectButton","protectFormButtons","showAsPopBox","setAutoSuggest","selectAutoSuggestRecord"];
Polaris.Form.__new__();
Base._exportSymbols(this,Polaris.Form);
function processRanking(e){
var _82=parseInt(e.target().getAttribute("value"));
var ul=e.target().parentNode.parentNode;
var _84=MochiKit.DOM.getFirstElementByTagAndClassName("li","current-rating",ul);
var _85=MochiKit.DOM.getFirstElementByTagAndClassName("input","",ul);
var _86=(_82*25);
_84.style.width=_86+"px";
_85.value=_82;
}
function setSelectValues(_87){
var _88=window[_87.getAttribute("valuepicklist")];
var _89=_87.options[_87.selectedIndex].value;
if(hasElementClass(_87,"required")){
var _8a=0;
}else{
var _8a=1;
}
for(i=0;i<_88.length;i++){
_87.options[_8a]=new Option(_88[i][1],_88[i][1]);
_8a++;
}
_87.value=_87.getAttribute("currentvalue");
}
function updateCheckboxValue(id){
var _8c=getElementsByTagAndClassName("input","binarycheckbox",$("div_"+id));
var _8d=0;
var _8e=50;
var _8f="";
for(i=0;i<_8c.length;i++){
if(_8c[i].checked==true){
_8d+=parseInt(_8c[i].value);
if($("divtext_"+id)){
_8f+=_8c[i].getAttribute("screenvalue")+", ";
}
}
}
if(_8d==0){
$("binary_"+id).value=null;
}else{
$("binary_"+id).value=_8d;
}
if($("divtext_"+id)){
_8f=_8f.substring(0,_8f.length-2);
if(_8f.length>_8e){
_8f=_8f.substr(0,_8e)+"...";
}
$("divtext_"+id).innerHTML=_8f;
}
}
function cb_selectChange(_90,_91){
var cbs=$(_90).getElementsByTagName("input");
for(i=0;i<cbs.length;i++){
if(cbs[i].type=="checkbox"){
cbs[i].checked=_91;
}
}
}
function syncCheckboxValue(id){
if($(id)){
var _94=parseInt($(id).value);
var _95=getElementsByTagAndClassName("input","binarycheckbox",$("div_"+id));
for(i=0;i<_95.length;i++){
if((_94&parseInt(_95[i].value))==parseInt(_95[i].value)){
_95[i].checked=true;
}
}
}
}
Polaris.Dataview={};
Base.update(Polaris.Dataview,{visibleState:function(_96,_97,_98,_99){
var f=$(_96);
if(f){
f._hdnVisibleField.value=_97;
f._hdnVisibleRecord.value=_98;
f._hdnVisibleValue.value=_99;
f.submit();
}else{
alert("Form extraform could not be found.");
}
},hotRecordUpdate:function(_9b,_9c,_9d,_9e){
var f=$(_9b);
if(f){
f._hdnHotUpdateRecord.value=_9c;
f._hdnHotUpdateFields.value=_9d;
f._hdnHotUpdateValues.value=_9e;
f.submit();
}else{
alert("Form hotupdate could not be found.");
}
},swapRecords:function(_a0,_a1,_a2,_a3){
var f=$(_a0);
if(f){
f._hdnSwapRecord1.value=_a1;
f._hdnSwapRecord2.value=_a2;
f._hdnSwapColumn.value=_a3;
f.submit();
}else{
alert("Form swapform could not be found.");
}
},selectedRows:function(){
var _a5=MochiKit.DOM.getElementsByTagAndClassName("TR","H",$("datalistview"));
for(row in _a5){
_a5[row].rowid=_a5[row].id.substr(4,32);
}
return _a5;
},fadeRow:function(_a6){
if($(_a6)){
if(_a6==$(_a6)){
_a6=$(_a6).Id;
}
Polaris.Visual.yellowFade(_a6);
}
},confirmDelete:function(e){
var c=Polaris.Dataview._countChecked(e.form);
if(c==0){
alert(langres_no_item_selected);
return false;
}else{
var txt;
if(c==1){
txt=langres_confirm_delete_1_item;
}else{
txt=langres_confirm_delete_n_items+" ("+c+")";
}
return confirm(txt);
}
},_countChecked:function(f){
var _ab=0;
try{
for(var i=0;i<f.elements.length;i++){
var e=f.elements[i];
if((e.name!="_hdnAllBox")&&(e.type=="checkbox")&&e.checked){
_ab++;
}
}
}
catch(ex){
}
return _ab;
},rowHighlite:function(row){
var _af=Polaris.Dataview;
var _b0=row.target();
while(_b0&&_b0.tagName.toUpperCase()!="TR"){
_b0=_b0.parentNode;
}
if(_b0){
var _b1=getNodeAttribute(_b0,"id");
var _b2=_b1.replace("row","rec");
if($(_b2)){
$(_b2).checked=!$(_b2).checked;
_af.checkCheckBox($(_b2));
}else{
if(hasElementClass(_b0,"H")){
_af._dL(_b0);
}else{
_af._hL(_b0);
}
}
}
},checkCheckBox:function(row){
var _b4=Polaris.Dataview;
if(row.target){
row=row.target();
}
if(row.checked){
_b4._hL(row);
}else{
_b4._dL(row);
}
_b4.syncCheckboxes(row.form);
},checkAllCheckBoxes:function(e){
var _b6=Polaris.Dataview;
if(e.target){
e=e.target();
}
for(var i=0;i<e.form.elements.length;i++){
var _b8=e.form.elements[i];
if((_b8.name!="_hdnAllBox")&&(_b8.type=="checkbox")){
_b8.checked=e.checked;
if(_b8.checked){
_b6._hL(_b8);
}else{
_b6._dL(_b8);
}
}
}
},syncCheckboxes:function(f){
var _ba=0;
var _bb=0;
if(f){
for(var i=0;i<f.elements.length;i++){
var e=f.elements[i];
if((e.name!="_hdnAllBox")&&(e.type=="checkbox")){
_bb++;
if(e.checked){
_ba++;
}
}
}
if(f._hdnAllBox){
f._hdnAllBox.checked=(_bb==_ba);
}
}
},_hL:function(row){
while(row.tagName!="TR"){
row=row.parentNode;
}
addElementClass(row,"H");
},_dL:function(row){
while(row.tagName!="TR"){
row=row.parentNode;
}
removeElementClass(row,"H");
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Dataview.EXPORT_OK=[];
Polaris.Dataview.EXPORT=["visibleState","hotRecordUpdate","swapRecords","selectedRows","fadeRow","confirmDelete","rowHighlite","checkCheckBox","checkAllCheckBoxes","syncCheckboxes"];
Polaris.Dataview.__new__();
Base._exportSymbols(this,Polaris.Dataview);
Polaris.Ajax={};
Base.update(Polaris.Ajax,{genericResponse:function(_c0){
var res=evalJSONRequest(_c0);
log("generic response "+res);
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Ajax.EXPORT_OK=[];
Polaris.Ajax.EXPORT=["genericResponse"];
Polaris.Ajax.__new__();
Base._exportSymbols(this,Polaris.Ajax);
Polaris.TagBar={};
Base.update(Polaris.TagBar,{urlTagBarProcessor:_serverroot+"/polaris_ajax.php",initialize:function(){
var _c2=Polaris.TagBar;
connect("tag_add","onclick",_c2.toggleTagAdd);
connect("tag_cancel","onclick",_c2.toggleTagAdd);
Polaris.Base.mConnect(getElementsByTagAndClassName("a","tag_delete","tags"),"onclick",_c2.deleteTag);
hideElement("tag_addform");
},toggleTagAdd:function(){
if($("tag_addform").style.display=="inline"){
$("tag_addform").style.display="none";
$("tag_add").style.display="inline";
}else{
$("tag_addform").style.display="inline";
$("tag_value").focus();
$("tag_add").style.display="none";
}
},deleteTag:function(e){
var _c4=Polaris.TagBar;
var _c5=function(){
fade("tag_"+e.target().id,{afterFinish:function(){
removeElement("tag_"+e.target().id);
}});
log("tag_"+e.target().id+" tag removed");
};
var _c6=function(e){
log(e);
alert("Tag kon niet verwijderd worden.");
};
if(confirm(langres_confirm_delete_1_tag.replace("%s",e.target().tag))){
doSimpleXMLHttpRequest(_c4.urlTagBarProcessor,{method:"deletetag",recordid:e.target().id}).addCallbacks(_c5,_c6);
}
},addTag:function(_c8){
var _c9=Polaris.TagBar;
var _ca=function(_cb){
var res=evalJSONRequest(_cb);
if(res.result!=false){
_c9.toggleTagAdd();
$("tag_value").value="";
var li=_c9.addTagElement($("tags"),res.recordid,_serverroot+"/app/"+res.app+"/tags/"+res.tag+"/",res.tag);
}else{
}
};
var _ce=function(_cf){
alert("Could not add the tag.");
};
var _d0=queryString(_c8[0],_c8[1]);
doSimpleXMLHttpRequest(_c9.urlTagBarProcessor+"?"+_d0,{}).addCallbacks(_ca,_ce);
},addTagElement:function(_d1,_d2,url,tag){
var _d5=A({href:"javascript:void(0)","class":"tag_delete",id:_d2,"tag":tag,title:"verwijder"},"[x]");
connect(_d5,"onclick",Polaris.TagBar.deleteTag);
var _d6=LI({id:"tag_"+_d2},A({href:url,title:"klik"},tag)," ",_d5);
appendChildNodes(_d1,_d6);
return _d6;
}});
function ParseQuery(q){
this.q=(q.length>1)?q.substring(1,q.length):null;
this.keyValuePairs=new Array();
if(this.q){
for(var i=0;i<this.q.split("&").length;i++){
this.keyValuePairs[i]=this.q.split("&")[i];
}
}
this.getKeyValuePairs=function(){
return this.keyValuePairs;
};
this.getValue=function(s){
for(var j=0;j<this.keyValuePairs.length;j++){
if(this.keyValuePairs[j].split("=")[0]==s){
return this.keyValuePairs[j].split("=")[1];
}
}
return false;
};
this.getParameters=function(){
var a=new Array(this.getLength());
for(var j=0;j<this.keyValuePairs.length;j++){
a[j]=this.keyValuePairs[j].split("=")[0];
}
return a;
};
this.addParameter=function(key,_de){
var _df=this.removeParameter(key);
if(_df!=""){
_df+="&";
}
_df+=key+"="+_de;
return _df;
};
this.removeParameter=function(key){
var _e1="";
for(var i=0;i<this.getLength();i++){
if(this.keyValuePairs[i].split("=")[0]!=key){
_e1+=this.keyValuePairs[i]+"&";
}
}
if(_e1.length>1){
_e1=_e1.substr(0,_e1.length-1);
}
return _e1;
};
this.getLength=function(){
return this.keyValuePairs.length;
};
}
function getQueryVariable(key,_e4){
var _e5=new ParseQuery(_e4||window.location.search);
return unescape(_e5.getValue(key));
}
function removeQueryVariable(key,_e7){
var _e8=new ParseQuery(_e7||window.location.search);
return window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+_e8.removeParameter(key);
}
function addQueryVariable(key,_ea,_eb){
var _ec=new ParseQuery(_eb||window.location.search);
return window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+_ec.addParameter(key,_ea);
}
String.prototype.ucFirst=function(){
return this.substr(0,1).toUpperCase()+this.substr(1,this.length);
};
function Mod(a,b){
return a-Math.floor(a/b)*b;
}
function HMtoSec(T){
if(T){
var A=T.split(":");
return (A[0]*60*60+A[1]*60)/60;
}
}
function SectoHM(S){
if(S){
var Hrs=Math.floor(S/60);
var _f3=Mod(S,60);
return Hrs+":"+_f3;
}
}
if(typeof (Polaris.Components)=="undefined"){
Polaris.Components={};
}
Polaris.Components.NAME="Polaris.Components";
Polaris.Components.VERSION="1.0";
Polaris.Components.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
Polaris.Components.toString=function(){
return this.__repr__();
};
try{
if(typeof (MochiKit.Base)==="undefined"){
throw "";
}
}
catch(e){
throw "Polaris.Components depends on MochiKit.Base";
}
Base.update(Polaris.Components,{toggleComponent:function(e){
var dur=0.5;
var _f6=getNodeAttribute(this,"value");
_f6=$(_f6);
if(_f6){
var _f7=getNodeAttribute(_f6,"blind");
if(_f7=="up"){
slideDown(_f6,{duration:dur});
setNodeAttribute(_f6,"blind","down");
this.innerHTML="&#8743;";
}else{
slideUp(_f6,{duration:dur});
setNodeAttribute(_f6,"blind","up");
this.innerHTML="&#8744;";
}
}
},GetVisibleCount:function(_f8){
var _f9=0;
for(i=0;i<_f8.childNodes.length;i++){
if((_f8.childNodes[i].tagName=="LI")&&((_f8.childNodes[i].firstChild.value=="replace"||_f8.childNodes[i].firstChild.value=="edit")||((_f8.childNodes[i].firstChild.value=="delete")&&(_f8.childNodes[i].style.display!="none")))){
_f9++;
}
}
return _f9;
},LastFieldEmpty:function(_fa){
var _fb="";
var _fc=getElementsByTagAndClassName(null,"comp_valuefield",_fa);
for(i=0;i<_fc.length;i++){
_fb+=_fc[i].value;
}
return _fb=="";
},UpdateComponentblock:function(_fd){
var _fe=getElementsByTagAndClassName("input","remove_item",_fd);
var _ff=Polaris.Components;
var _100=_ff.GetVisibleCount(_fd);
if(_100==1){
if(_ff.LastFieldEmpty(_fd)){
for(i=0;i<_fe.length;i++){
_fe[i].setAttribute("disabled","disabled");
}
}else{
for(i=0;i<_fe.length;i++){
_fe[i].removeAttribute("disabled");
}
}
}else{
if(_100==0){
if(_fe.length==1){
_fe[0].setAttribute("disabled","disabled");
}
}else{
for(i=0;i<_fe.length;i++){
_fe[i].removeAttribute("disabled");
}
}
}
},UpdateComponentblocks:function(_101){
var self=Polaris.Components;
var _103="componentitems";
var _104=getElementsByTagAndClassName("ul",_103);
for(ci=0;ci<_104.length;ci++){
self.UpdateComponentblock(_104[ci]);
}
},AddComponentItem:function(e){
var _106=e.parentNode.parentNode;
var set=_106.cloneNode(true);
if(set.firstChild.className=="recordstate"){
set.firstChild.value="insert";
}
var _108=getElementsByTagAndClassName("input","recordindex",_106.parentNode);
var _109=1;
for(i=0;i<_108.length;i++){
if(parseInt(_108[i].value)>_109){
_109=parseInt(_108[i].value);
}
}
_109++;
var _10a=getElementsByTagAndClassName("input","recordindex",set);
if(_10a.length==1){
_10a[0].value=_109;
}
if(_106.nextSibling!=null){
_106.parentNode.insertBefore(set,_106.nextSibling);
}else{
_106.parentNode.appendChild(set);
}
fields=getElementsByTagAndClassName(null,"comp_valuefield",set);
for(i=0;i<fields.length;i++){
fields[i].value="";
}
_108=getElementsByTagAndClassName("input","recordorderindex",_106.parentNode);
for(i=0;i<_108.length;i++){
_108[i].value=i+1;
}
Polaris.Components.UpdateComponentblock(_106.parentNode);
},RemoveComponentItem:function(e){
var self=Polaris.Components;
var _10d=e.parentNode.parentNode;
var _10e=_10d.parentNode;
var _10f=self.GetVisibleCount(_10e);
for(i=0;i<_10d.childNodes.length;i++){
if(_10d.childNodes[i].className=="recordorderindex"){
_10d.childNodes[i].className="";
}
if(_10d.childNodes[i].className=="recordstate"){
_10d.childNodes[i].value="delete";
}
}
if(_10f>1){
_10d.style.display="none";
}else{
fields=getElementsByTagAndClassName(null,"comp_valuefield",_10e);
for(i=0;i<fields.length;i++){
fields[i].value="";
}
}
self.UpdateComponentblock(_10e);
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Components.EXPORT_OK=[];
Polaris.Components.EXPORT=["toggleComponent","GetVisibleCount","RemoveComponentItem","LastFieldEmpty","UpdateComponentblock","UpdateComponentblocks","AddComponentItem","RemoveComponentItem",];
Polaris.Components.__new__();
Base._exportSymbols(this,Polaris.Components);
if(typeof (Polaris.Selectsource)=="undefined"){
Polaris.Selectsource={};
}
Polaris.Selectsource.NAME="Polaris.Selectsource";
Polaris.Selectsource.VERSION="1.0";
Polaris.Selectsource.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
Polaris.Selectsource.toString=function(){
return this.__repr__();
};
try{
if(typeof (MochiKit.Base)==="undefined"||typeof (MochiKit.DOM)==="undefined"){
throw "";
}
}
catch(e){
throw "Polaris.Selectsource depends on MochiKit.Base, MochiKit.DOM";
}
var Base=MochiKit.Base;
Base.update(Polaris.Selectsource,{__init__:function(){
var self=Polaris.Selectsource;
var _111=getElementsByTagAndClassName(null,"columnsource_column");
for(var i=0;i<_111.length;i++){
self.setColumnSourceValues(_111[i]);
}
},setColumnSourceValues:function(_113){
var _114=window[_113.getAttribute("arrayname")];
var _115=_113;
while(_115&&_115.tagName.toUpperCase()!="LI"){
_115=_115.parentNode;
}
var _116=getFirstElementByTagAndClassName("select","comp_valuefield",_115);
if(isUndefined(_116)){
alert("no child found");
return;
}
for(var i=_116.length;i>=0;i--){
_116.options[i]=null;
}
var _118=_113.options[_113.selectedIndex].value;
if(_118==""){
if(_113.parentNode.firstChild.className=="recordstate"){
_113.parentNode.firstChild.value="delete";
}
}else{
_116.disabled=false;
if(_113.parentNode.firstChild.className=="recordstate"){
if(window.location.pathname.indexOf("/insert/")>0){
_113.parentNode.firstChild.value="insert";
}else{
_113.parentNode.firstChild.value="edit";
}
}
if(_116.options){
if(hasElementClass(_116,"required")){
var _119=0;
}else{
var _119=1;
}
var id=0;
for(i=0;i<_114.length;i++){
if(_114[i][0]==_118){
if(_114[i][2]!=""){
id=_114[i][2];
}else{
id=_114[i][1];
}
_116.options[_119]=new Option(_114[i][1],id);
_119++;
}
}
}
}
_116.value=_116.getAttribute("currentvalue");
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":this.EXPORT};
Base.nameFunctions(this);
}});
Polaris.Selectsource.EXPORT_OK=[];
Polaris.Selectsource.EXPORT=["setColumnSourceValues"];
Polaris.Selectsource.__new__();
Base._exportSymbols(this,Polaris.Selectsource);
addLoadEvent(Polaris.Selectsource.__init__);
if(typeof (Polaris.Domtab)=="undefined"){
Polaris.Domtab={};
}
Polaris.Domtab.NAME="Polaris.Domtab";
Polaris.Domtab.VERSION="1.0";
Polaris.Domtab.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
Polaris.Domtab.toString=function(){
return this.__repr__();
};
try{
if(typeof (Polaris.Base)==="undefined"){
throw "";
}
}
catch(e){
throw "Polaris.Domtab depends on MochiKit.Base";
}
Base.update(Polaris.Domtab,{currentTab:"",currentLink:"",tabHighlightClass:"tabon",initPageTabs:function(_11b,_11c,func){
var self=Polaris.Domtab;
var _11f="pagetabs";
var _120="pagetabstabbed";
var _121=/#top/;
if(document.getElementById&&document.createTextNode){
var cid=window.location.toString().match(/#(\w.+)/);
if(cid&&cid[1]){
cid=cid[1];
}
var n=$(_11f);
if(!n){
return;
}
n.id=_120;
n=$(_120);
var as=n.getElementsByTagName("a");
for(i=0;i<as.length;i++){
connect(as[i],"onclick",function(){
self.showTab(this);
return false;
});
var id=as[i].href.match(/#(\w.+)/)[1];
if(!cid&&i==0){
self.currentTab=id;
self.currentLink=as[i];
}else{
if(id==cid){
self.currentTab=id;
self.currentLink=as[i];
}
}
if($(id)){
linklength=$(id).getElementsByTagName("a").length;
if(linklength>0){
lastlink=$(id).getElementsByTagName("a")[linklength-1];
if(_121.test(lastlink.href)){
lastlink.parentNode.removeChild(lastlink);
}
}
hideElement(id);
}
}
if($(self.currentTab)){
showElement(self.currentTab);
}
addElementClass(self.currentLink,self.tabHighlightClass);
}
},showTab:function(o){
var self=Polaris.Domtab;
if(self.currentTab){
if($(self.currentTab)){
hideElement(self.currentTab);
}
removeElementClass(self.currentLink,self.tabHighlightClass);
}
var id=o.href.match(/#(\w.+)/)[1];
self.currentTab=id;
self.currentLink=o;
if($(id)){
showElement(id);
adjustLabelWidth(id);
}
addElementClass(self.currentLink,self.tabHighlightClass);
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Domtab.EXPORT_OK=[];
Polaris.Domtab.EXPORT=["initPageTabs"];
Polaris.Domtab.__new__();
Base._exportSymbols(this,Polaris.Domtab);
if(typeof (Polaris.Livesearch)=="undefined"){
Polaris.Livesearch={};
}
Polaris.Livesearch.NAME="Polaris.Livesearch";
Polaris.Livesearch.VERSION="1.0";
Polaris.Livesearch.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
Polaris.Livesearch.toString=function(){
return this.__repr__();
};
try{
if(typeof (MochiKit.Base)==="undefined"||typeof (MochiKit.DOM)==="undefined"){
throw "";
}
}
catch(e){
throw "Polaris.Livesearch depends on MochiKit.Base, MochiKit.DOM";
}
var Base=MochiKit.Base;
Base.update(Polaris.Livesearch,{liveSearchReq:false,t:null,liveSearchLast:"",imageon:_serverroot+"/images/searching.gif",imageoff:_serverroot+"/images/livesearch3.gif",urlPolarisLivesearchProcessor:_serverroot+"/livesearch.php",isIE:false,liveSearchInit:function(){
var self=Polaris.Livesearch;
if($("livesearchimage")){
$("livesearch").setAttribute("autocomplete","off");
connect($("livesearchimage"),"onclick",self.toggleLiveSearchBox);
connect($("livesearch"),"onkeypress",self.liveSearchStart);
connect($("livesearch"),"onsearch",self.liveSearchDoSearch);
}
},liveSearchSearching:function(on){
var self=Polaris.Livesearch;
if(on){
$("livesearchimage").src=self.imageon;
}else{
$("livesearchimage").src=self.imageoff;
}
},closeResults:function(){
hideElement("livesearch");
},toggleLiveSearchBox:function(){
if($("livesearch").style.display=="inline"){
$("livesearch").style.display="none";
}else{
$("livesearch").style.display="inline";
$("livesearch").focus();
}
},liveSearchHideDelayed:function(){
window.setTimeout("Polaris.Livesearch.liveSearchHide()",400);
},liveSearchHide:function(){
Polaris.Livesearch.liveSearchSearching(false);
hideElement("LSResult");
if($("LSHighlight")){
$("LSHighlight").removeAttribute("id");
}
},liveSearchStart:function(){
var self=Polaris.Livesearch;
if(self.t){
window.clearTimeout(self.t);
}
self.t=window.setTimeout("Polaris.Livesearch.liveSearchDoSearch()",200);
},liveSearchDoSearch:function(){
var self=Polaris.Livesearch;
self.liveSearchSearching(true);
if(typeof self.liveSearchRoot=="undefined"){
self.liveSearchRoot="/";
}
if(typeof self.liveSearchRootSubDir=="undefined"){
self.liveSearchRootSubDir="";
}
if(typeof self.liveSearchParams=="undefined"){
self.liveSearchParams2="";
}else{
self.liveSearchParams2="&"+self.liveSearchParams;
}
if(self.liveSearchLast!=document.forms.searchform.q.value){
if(document.forms.searchform.q.value==""){
self.liveSearchHide();
return false;
}
var _12e=location.href.indexOf("/app/");
var _12f=location.href.substring(_12e+5,location.href.indexOf("/",_12e+5));
doSimpleXMLHttpRequest(self.urlPolarisLivesearchProcessor,{app:_12f,q:document.forms.searchform.q.value.replace(/\+/g,"%2B")}).addCallbacks(self.liveSearchProcessReqChange,self.liveSearchProcessReqError);
self.liveSearchLast=document.forms.searchform.q.value;
}
},liveSearchProcessReqError:function(_130){
log(_130);
},liveSearchProcessReqChange:function(_131){
var self=Polaris.Livesearch;
showElement("LSResult");
$("LSShadow").innerHTML=_131.responseText;
self.liveSearchSearching(false);
},liveSearchSubmit:function(){
var self=Polaris.Livesearch;
var _134=$("LSHighlight");
if(_134&&_134.firstChild){
window.location=self.liveSearchRoot+self.liveSearchRootSubDir+_134.firstChild.nextSibling.getAttribute("href");
return false;
}else{
return true;
}
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.Livesearch.EXPORT_OK=[];
Polaris.Livesearch.EXPORT=["liveSearchInit"];
Polaris.Livesearch.__new__();
Base._exportSymbols(this,Polaris.Livesearch);
if(typeof (Polaris.AutoSuggest)=="undefined"){
Polaris.AutoSuggest={};
}
Polaris.AutoSuggest.NAME="Polaris.AutoSuggest";
Polaris.AutoSuggest.VERSION="1.0";
Polaris.AutoSuggest.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
Polaris.AutoSuggest.toString=function(){
return this.__repr__();
};
try{
if(typeof (MochiKit.Base)==="undefined"||typeof (MochiKit.Async)==="undefined"||typeof (MochiKit.DOM)==="undefined"){
throw "";
}
}
catch(e){
throw "Polaris.AutoSuggest depends on MochiKit.Base, MochiKit.Async and MochiKit.DOM";
}
Base.update(Polaris.AutoSuggest,{_CreateAutoSuggest:function(_135,_136,_137){
if(!document.getElementById){
return false;
}
this.valuefld=$(_135);
this.searchfld=$(_136);
if(!this.valuefld||!this.searchfld){
return false;
}
this.nInputChars=0;
this.aSuggestions=[];
this.iHighlighted=0;
this.oP=(_137)?_137:{};
if(!this.oP.minchars){
this.oP.minchars=1;
}
if(!this.oP.method){
this.oP.meth="get";
}
if(!this.oP.varname){
this.oP.varname="input";
}
if(!this.oP.valuefield){
this.oP.valuefield=false;
}
if(!this.oP.captionfield){
this.oP.captionfield=false;
}
if(!this.oP.className){
this.oP.className="autosuggest";
}
if(!this.oP.timeout){
this.oP.timeout=2500;
}
if(!this.oP.delay){
this.oP.delay=500;
}
if(!this.oP.maxheight&&this.oP.maxheight!==0){
this.oP.maxheight=250;
}
if(!this.oP.cache){
this.oP.cache=true;
}
var _138=this;
connect(this.searchfld,"onkeyup",function(e){
if(e.key().string!="KEY_TAB"&&e.key().string!="KEY_UNKNOWN"){
_138._getSuggestions(this.value);
}
});
setNodeAttribute(this.searchfld,"autocomplete","off");
}});
Polaris.AutoSuggest._CreateAutoSuggest.prototype={_getSuggestions:function(val){
addElementClass(this.searchfld,"as_invalid");
this.valuefld.value="";
if(val.length==this.nInputChars){
return false;
}
if(val.length<this.oP.minchars){
this.nInputChars=val.length;
this.aSuggestions=[];
this._clearSuggestions();
return false;
}
if(val.length>this.nInputChars&&this.aSuggestions.length&&this.oP.cache){
var arr=[];
for(var i=0;i<this.aSuggestions.length;i++){
if(this.aSuggestions[i].substr(0,val.length).toLowerCase()==val.toLowerCase()){
arr.push(this.aSuggestions[i]);
}
}
this.nInputChars=val.length;
this.aSuggestions=arr;
this._createList(this.aSuggestions);
return false;
}
this.nInputChars=val.length;
var _13d=this;
clearTimeout(this.ajID);
this.ajID=setTimeout(function(){
_13d._doAjaxRequest();
},this.oP.delay);
return false;
},_doAjaxRequest:function(){
var _13e=this;
var url=this.oP.script+this.oP.varname+"="+this.searchfld.value;
var _140=function(req){
_13e._setSuggestions(req);
};
var _142=function(_143){
alert("AJAX error: "+_143);
};
loadJSONDoc(url).addCallbacks(_140,_142);
},_setSuggestions:function(req){
var _145=req;
this.idAs="as_"+this.searchfld.id;
this._createList(_145);
},_createList:function(_146){
var _147=this.oP.captionfield.split(",");
var _148=new Array();
this._clearSuggestions();
var ul=UL({"id":this.idAs});
setElementClass(ul,this.oP.className);
var _14a=this;
for(var i=0;i<_146.length;i++){
_148=[];
if(isArrayLike(_147)){
for(var c=0;c<_147.length;c++){
_148.push(_146[i][_147[c]]);
}
}else{
_148.push(_146[i][_147]);
}
_148=_148.join(", ");
var _14d=_146[i][this.oP.valuefield];
var a=A({"href":"#","value":_14d},_148);
connect(a,"onclick",bind(_14a._setClickValue,_14a));
var li=LI({},a);
ul.appendChild(li);
}
var pos=getElementPosition(this.searchfld);
ul.style.left=pos.x+"px";
ul.style.top=(pos.y+this.searchfld.offsetHeight)+"px";
ul.style.width=(this.searchfld.offsetWidth<100)?170+"px":this.searchfld.offsetWidth+"px";
connect(ul,"onmouseover",function(){
_14a._killTimeout();
});
connect(ul,"onmouseout",function(){
_14a._resetTimeout();
});
document.getElementsByTagName("body")[0].appendChild(ul);
if(ul.offsetHeight>this.oP.maxheight&&this.oP.maxheight!=0){
ul.style["height"]=this.oP.maxheight;
}
var TAB=9;
var ESC=27;
var _153=38;
var _154=40;
var _155=13;
this.searchfld.onkeydown=function(ev){
var key=(window.event)?window.event.keyCode:ev.keyCode;
switch(key){
case TAB:
_14a._setHighlightedValue();
break;
case ESC:
_14a._clearSuggestions();
break;
case _153:
_14a._changeHighlight(key);
return false;
break;
case _154:
_14a._changeHighlight(key);
return false;
break;
}
};
this.iHighlighted=0;
clearTimeout(this.toID);
var _14a=this;
this.toID=setTimeout(function(){
_14a._clearSuggestions();
},this.oP.timeout);
},_changeHighlight:function(key){
var list=$(this.idAs);
if(!list){
return false;
}
if(this.iHighlighted>0){
list.childNodes[this.iHighlighted-1].className="";
}
if(key==40){
this.iHighlighted++;
}else{
if(key=38){
this.iHighlighted--;
}
}
if(this.iHighlighted>list.childNodes.length){
this.iHighlighted=list.childNodes.length;
}
if(this.iHighlighted<1){
this.iHighlighted=1;
}
list.childNodes[this.iHighlighted-1].className="highlight";
this._killTimeout();
},_killTimeout:function(){
clearTimeout(this.toID);
},_resetTimeout:function(){
clearTimeout(this.toID);
var _15a=this;
this.toID=setTimeout(function(){
_15a._clearSuggestions();
},1000);
},_clearSuggestions:function(){
if($(this.idAs)){
removeElement(this.idAs);
}
this.searchfld.onkeydown=null;
},_setHighlightedValue:function(){
if(this.iHighlighted){
this._setValue($(this.idAs).childNodes[this.iHighlighted-1].firstChild.firstChild.nodeValue,getNodeAttribute($(this.idAs).childNodes[this.iHighlighted-1].firstChild,"value"));
this._killTimeout();
this._clearSuggestions();
}
},_setClickValue:function(e){
this._setValue(e.target().childNodes[0].nodeValue,getNodeAttribute(e.target(),"value"));
this._resetTimeout();
return false;
},_setValue:function(_15c,_15d){
this.searchfld.value=_15c;
this.valuefld.value=_15d;
removeElementClass(this.searchfld,"as_invalid");
}};
Polaris.AutoSuggest.__new__=function(){
Base.nameFunctions(this);
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
};
Polaris.AutoSuggest.createAutoSuggest=function(_15e,_15f,_160){
new Polaris.AutoSuggest._CreateAutoSuggest(_15e,_15f,_160);
};
Polaris.AutoSuggest.EXPORT_OK=[];
Polaris.AutoSuggest.EXPORT=["createAutoSuggest"];
Polaris.AutoSuggest.__new__();
Base._exportSymbols(this,Polaris.AutoSuggest);
if(typeof (Polaris.FormValidator)=="undefined"){
Polaris.FormValidator={};
}
Polaris.FormValidator.NAME="Polaris.FormValidator";
Polaris.FormValidator.VERSION="1.0";
Polaris.FormValidator.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
Polaris.FormValidator.toString=function(){
return this.__repr__();
};
try{
if(typeof (Polaris.Base)==="undefined"){
throw "";
}
}
catch(e){
throw "Polaris.FormValidator depends on Polaris.Base";
}
var Base=MochiKit.Base;
Base.update(Polaris.FormValidator,{classNamePrefix_switch:"switch",className_required:"required",className_validationError_msg:"errMsg",className_validationError_fld:"errFld",classNamePrefix_validation:"validation",idSuffix_fieldHint:"-H",idSuffix_fieldLabel:"-L",idSuffix_fieldError:"-E",showAlertOnError:false,preventSubmissionOnEnter:false,arrErrorMsg:{0:"Dit veld is verplicht.",1:"De tekst kan uitsluitend alfanumerieke tekens bevatten (a-z, A-Z). Cijfers zijn niet toegestaan.",2:"Dit email adres is niet juist.",3:"Voer een geheel getal in.",4:"Voer een getal met cijfers achter de komma in (bijv. 12.34).",5:"Onveilig wachtwoord. Het wachtwoord zou tussen de 4 en 12 karakters lang moeten zijn en gebruik maken van hoofdletters en kleine letters.",6:"Gebruik uitsluitend alfanumerieke karakters [a-z 0-9].",7:"Dit is geen geldige datum.",8:"%% fouten ontdekt. Het formulier is nog niet verzonden.\nControleer a.u.b. de informatie die is ingevoerd."},arrMsg:{0:"Klik om een rij toe te voegen",1:"Voeg een rij toe",2:"Verwijder de rij",3:"Verwijdert het voorgaande veld of veld groep.",4:"Volgende pagina",5:"Vorige pagina"},formValidation:function(e){
var srcE=e.target();
var self=Polaris.FormValidator;
if(self.preventSubmissionOnEnter){
if(!e){
e=window.event;
}
if(srcE.type&&srcE.type.toLowerCase()=="text"){
return stop(e);
}
}
if($("pagetabcontainer")){
map(function(el){
removeElementClass(el,"needsattention");
},$("pagetabcontainer").getElementsByTagName("a"));
}
while(srcE&&srcE.tagName.toUpperCase()!="FORM"){
srcE=srcE.parentNode;
}
var x=self.getElements(srcE);
var _166=0;
var _167=false;
for(var i=0;i<x.length;i++){
var _169=0;
_167=Polaris.Form.checkVisibility(x[i]);
if((" "+x[i].className+" ").indexOf(" "+self.className_required+" ")!=-1){
var v=true;
switch(x[i].tagName.toUpperCase()){
case "INPUT":
switch(x[i].getAttribute("type").toUpperCase()){
case "CHECKBOX":
v=x[i].checked;
break;
case "RADIO":
v=x[i].checked;
break;
default:
v=!self.isEmpty(x[i].value);
}
break;
case "SELECT":
v=!self.isEmpty(x[i].options[x[i].selectedIndex].value);
break;
case "TEXTAREA":
v=!self.isEmpty(x[i].value);
break;
case "FIELDSET":
v=self.checkOneRequired(x[i]);
break;
case "DIV":
v=self.checkOneRequired(x[i]);
break;
case "SPAN":
v=self.checkOneRequired(x[i]);
break;
}
if(!v){
self.showError(x[i],self.arrErrorMsg[0]);
_169++;
var page=getFirstParentByTagAndClassName(x[i],"div","pagecontents");
if(page){
var _16c="tab_"+page.id;
addElementClass(_16c,"needsattention");
}
}else{
var _16d=new RegExp(self.className_validationError_fld,"gi");
x[i].className=x[i].className.replace(_16d,"");
var fe=$(x[i].id+self.idSuffix_fieldError);
if(fe){
fe.parentNode.removeChild(fe);
}
}
}
if(x[i].className.indexOf(self.classNamePrefix_validation)!=-1){
if(!_167){
_167=Polaris.Form.checkVisibility(x[i]);
}
if(_167){
var _16f=x[i].className.split(" ");
for(j=0;j<_16f.length;j++){
switch(_16f[j]){
case "validation-alpha":
if(!self.isAlpha(x[i].value)){
self.showError(x[i],self.arrErrorMsg[1]);
_169++;
}
break;
case "validation-alphanum":
if(!self.isAlphaNum(x[i].value)){
self.showError(x[i],self.arrErrorMsg[6]);
_169++;
}
break;
case "validation-allchars":
if(!self.isAllChars(x[i].value)){
self.showError(x[i],self.arrErrorMsg[6]);
_169++;
}
break;
case "validation-date":
if(!self.isDate(x[i].value)){
self.showError(x[i],self.arrErrorMsg[7]);
_169++;
}
break;
case "validation-time":
break;
case "validation-email":
if(!self.isEmail(x[i].value)){
self.showError(x[i],self.arrErrorMsg[2]);
_169++;
}
break;
case "validation-integer":
if(!self.isInteger(x[i].value)){
self.showError(x[i],self.arrErrorMsg[3]);
_169++;
}
break;
case "validation-float":
if(!self.isFloat(x[i].value)){
self.showError(x[i],self.arrErrorMsg[4]);
_169++;
}
break;
case "validation-strongpassword":
if(!self.isPassword(x[i].value)){
self.showError(x[i],self.arrErrorMsg[5]);
_169++;
}
break;
}
}
}else{
}
}
if(_169>0){
_166+=_169;
}else{
var _16d=new RegExp(self.className_validationError_fld,"gi");
x[i].className=x[i].className.replace(_16d,"");
var fe=$(x[i].id+self.idSuffix_fieldError);
if(fe){
fe.parentNode.removeChild(fe);
}
}
}
if(_166>0){
if(self.showAlertOnError){
self.showAlert(_166);
}
return e.stop();
}
return true;
},isEmpty:function(s){
var _171=/^\s+$/;
return ((s==null)||(s.length==0)||_171.test(s));
},isAlpha:function(s){
var reg=/^[\u0041-\u007A\u00C0-\u00FF\u0100–\u017F]+$/;
return Polaris.FormValidator.isEmpty(s)||reg.test(s);
},isAlphaNum:function(s){
var reg=/^[\u0030-\u0039\u0041-\u007A\u00C0-\u00FF\u0100–\u017F]+$/;
return Polaris.FormValidator.isEmpty(s)||reg.test(s);
},isAllChars:function(s){
return true;
},isDate:function(s){
var _178=new Date(s);
return Polaris.FormValidator.isEmpty(s)||!isNaN(_178);
},isEmail:function(s){
var _17a=/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/;
return Polaris.FormValidator.isEmpty(s)||_17a.test(s);
},isInteger:function(s){
return Polaris.FormValidator.isEmpty(s)||(parseInt(s)==parseFloat(s));
},isFloat:function(s){
return Polaris.FormValidator.isEmpty(s)||!isNaN(parseFloat(s));
},isPassword:function(s){
return Polaris.FormValidator.isEmpty(s);
},showError:function(n,_17f){
var self=Polaris.FormValidator;
if(n.className.indexOf(self.className_validationError_fld)!=-1){
return;
}
if(!n.id){
n.id=self.randomId();
}
n.className+=" "+self.className_validationError_fld;
var _181=document.createTextNode(" "+_17f);
var fe=$(n.id+self.idSuffix_fieldError);
if(!fe){
fe=document.createElement("div");
fe.setAttribute("id",n.id+self.idSuffix_fieldError);
var fl=$(n.id+self.idSuffix_fieldLabel);
if(fl){
fl.parentNode.insertBefore(fe,fl.nextSibling);
}else{
n.parentNode.insertBefore(fe,n.nextSibling);
}
}
fe.appendChild(_181);
fe.className+=" "+self.className_validationError_msg;
},showAlert:function(_184){
alert(Polaris.FormValidator.arrErrorMsg[8].replace("%%",_184));
},checkOneRequired:function(n){
var v=null;
var self=Polaris.FormValidator;
if(n.nodeType!=1){
return false;
}
if(n.tagName.toUpperCase()=="INPUT"){
switch(n.type.toLowerCase()){
case "checkbox":
v=n.checked;
break;
case "radio":
v=n.checked;
break;
default:
v=n.getAttribute("value");
}
}else{
v=n.getAttribute("value");
}
if(v&&!self.isEmpty(v)){
return true;
}
for(var i=0;i<n.childNodes.length;i++){
if(self.checkOneRequired(n.childNodes[i])){
return true;
}
}
return false;
},onLoadHandler:function(){
for(var i=0;i<document.forms.length;i++){
if(hasElementClass(document.forms[i],"validate")){
if(!document.forms[i].id){
document.forms[i].id=Polaris.FormValidator.randomId();
}
Polaris.FormValidator.addBehaviors(document.forms[i].id);
}
}
},addBehaviors:function(fId){
var f=$(fId);
if(!f){
return;
}
var _18c;
var x=Polaris.FormValidator.getElements(f);
for(var i=0;i<x.length;i++){
if(x[i].tagName.toUpperCase()=="FORM"&&hasElementClass(x[i],"validate")){
connect(x[i],"onsubmit",Polaris.FormValidator.formValidation);
_18c=x[i];
}
}
},randomId:function(){
var rId="";
for(var i=0;i<6;i++){
rId+=String.fromCharCode(97+Math.floor((Math.random()*24)));
}
return rId;
},getElements:function(n,list){
if(!list){
list=new Array();
}
if(n.nodeType==1){
list[list.length]=n;
for(var i=0;i<n.childNodes.length;i++){
Polaris.FormValidator.getElements(n.childNodes[i],list);
}
return list;
}
},__new__:function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":Base.concat(this.EXPORT,this.EXPORT_OK)};
Base.nameFunctions(this);
}});
Polaris.FormValidator.EXPORT_OK=[];
Polaris.FormValidator.EXPORT=["formValidation"];
Polaris.FormValidator.__new__();
Base._exportSymbols(this,Polaris.FormValidator);
if(typeof (Polaris.Initialize)=="undefined"){
Polaris.Initialize={};
}
Polaris.Initialize.NAME="Polaris.Initialize";
Polaris.Initialize.VERSION="1.0";
Polaris.Initialize.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
Polaris.Initialize.toString=function(){
return this.__repr__();
};
try{
if(typeof (MochiKit.Base)==="undefined"){
throw "";
}
}
catch(e){
throw "Polaris.Initialize depends on MochiKit.Base";
}
Base.update(Polaris.Initialize,{generalMethods:function(){
var P=Polaris;
var W=Polaris.Window;
var B=Polaris.Base;
log("Polaris.Initialize.generalMethods");
P.Visual.buildHorizontalSubmenus(["constructs"]);
if(typeof (P.Domtab.initPageTabs)!="undefined"&&$("pagetabcontainer")){
P.Domtab.initPageTabs();
}
if($("app_select")){
connect("app_select","onchange",function(){
window.location.href=_serverroot+"/app/"+this.value+"/";
});
}
if($("toggleMaximize")&&$("headercomplete")){
connect($("toggleMaximize"),"onclick",W.maximizeForm);
connect(document,"onkeydown",function(e){
if(e.keyCode==27&&$("headercomplete").style.height=="0px"){
W.maximizeForm();
}
});
}
if($("separateForm")){
var w=630,h=440;
var _19a=75;
w=screen.width*_19a/100;
h=screen.height*_19a/100;
connect($("separateForm"),"onclick",function(){
turl=window.location.href;
if(turl.indexOf("?")==-1){
turl=turl+"?";
}else{
turl=turl+"&";
}
turl=turl+"maximize=true";
W.openCenteredWindow(turl,h,w,"","status=no,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no");
});
}
if($("refresh_interval")){
setTimeout("refreshCountDown("+$("refresh_interval").options[$("refresh_interval").selectedIndex].value+")",1000);
B.mConnect(getElementsByTagAndClassName(null,"pause_countdown"),"onclick",P.Timer.pauseCountdown);
}
if($("customform_iframe")&&($("customform_iframe").getAttribute("autosize")=="true")){
W.resizeCustomForm();
connect(window,"onresize",W.resizeCustomForm);
}
if(P.Livesearch.liveSearchInit&&$("livesearchimage")){
P.Livesearch.liveSearchInit();
}
map(function(a){
connect(a,"onclick",function(e){
P.Form.showAsPopBox("",a.href);
e.preventDefault();
return false;
});
},getElementsByTagAndClassName("a","popbox"));
map(function(a){
connect(a,"onclick",function(e){
P.Base.linkPopup(a);
e.preventDefault();
return false;
});
},getElementsByTagAndClassName("a","popup"));
for(var i=0;i<_loadevents_.length;i++){
_loadevents_[i]();
}
},listViewMethods:function(){
var D=Polaris.Dataview;
var B=Polaris.Base;
var dv=$("datalistview");
log("Polaris.Initialize.listViewMethods");
Polaris.Visual.stripeTables();
B.mConnect(getElementsByTagAndClassName("tr","dr",dv),"onclick",D.rowHighlite);
B.mConnect(getElementsByTagAndClassName("input","rowselect",dv),"onclick",D.checkCheckBox);
if($("_hdnAllBox")){
connect($("_hdnAllBox"),"onclick",D.checkAllCheckBoxes);
}
B.mConnect(getElementsByTagAndClassName("input","cancelbubble",dv),"onclick",function(e){
e.stopPropagation();
});
B.mConnect(getElementsByTagAndClassName("a","cancelbubble",dv),"onclick",function(e){
e.stopPropagation();
});
map(setSelectValues,getElementsByTagAndClassName("select","hotedit_lookuppicklist",dv));
},formViewMethods:function(){
var F=Polaris.Form;
var B=Polaris.Base;
log("Polaris.Initialize.formViewMethods");
B.mConnect(getElementsByTagAndClassName("input","validation-lowercase"),"onchange",F.validateLowerCase);
B.mConnect(getElementsByTagAndClassName("input","validation-uppercase"),"onchange",F.validateUpperCase);
B.mConnect(getElementsByTagAndClassName("input","validation-float"),"onchange",F.validateFloat);
if(navigator.userAgent.indexOf("Safari")>0){
B.mConnect(document.getElementsByTagName("label"),"onclick",F.addLabelFocus);
}
B.mConnect(getElementsByTagAndClassName("ul","star-rating","formview"),"onclick",processRanking);
map(F.setAutoSuggest,getElementsByTagAndClassName("input","fastsearch","formview"));
if(hasMochiKitEffects){
roundClass("div","componentblock",{corners:"all",bgColor:"#FFF",color:"#bcd7fc"});
roundClass("div","componentblockhilight",{corners:"all",bgColor:"#FFF",color:"#F7BAB4"});
}
F.adjustLabelWidth($("formview"));
F.setFocusFirstField($("formview"));
B.mConnect(getElementsByTagAndClassName("div","comptoggler","formview"),"onclick",Polaris.Components.toggleComponent);
Polaris.FormValidator.onLoadHandler();
},searchViewMethods:function(){
var F=Polaris.Form;
log("Polaris.Initialize.searchViewMethods");
F.adjustLabelWidth($("searchview"));
F.setFocusFirstField($("searchview"));
},designerMethods:function(){
log("Polaris.Initialize.designerMethods");
if(hasMochiKitEffects){
roundClass("div","actionbutton",{corners:"all",bgColor:"#FFF"});
}
}});
addLoadEvent(function(){
Polaris.Initialize.generalMethods();
if($("datalistview")){
Polaris.Initialize.listViewMethods();
}
if($("formview")){
Polaris.Initialize.formViewMethods();
}
if($("searchview")){
Polaris.Initialize.searchViewMethods();
}
if($("plrdesigner")){
Polaris.Initialize.designerMethods();
}
});
if(typeof (Polaris)=="undefined"){
Polaris={};
}
if(typeof (Polaris.Polaris)=="undefined"){
Polaris.Polaris={};
}
Polaris.Polaris.NAME="Polaris.Polaris";
Polaris.Polaris.VERSION="1.0";
Polaris.Polaris.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
Polaris.Polaris.toString=function(){
return this.__repr__();
};
Polaris.Polaris.SUBMODULES=["Base","Components","Selectsource","Domtab","Livesearch","AutoSuggest","FormValidator","Initialize"];
if(typeof (JSAN)!="undefined"||typeof (dojo)!="undefined"){
if(typeof (dojo)!="undefined"){
dojo.provide("Polaris.Polaris");
dojo.require("Polaris.*");
}
if(typeof (JSAN)!="undefined"){
(function(lst){
for(var i=0;i<lst.length;i++){
JSAN.use("Polaris."+lst[i],[]);
}
})(Polaris.Polaris.SUBMODULES);
}
(function(){
var _1aa=MochiKit.Base.extend;
var self=Polaris.Polaris;
var _1ac=self.SUBMODULES;
var _1ad=[];
var _1ae=[];
var _1af={};
var i,k,m,all;
for(i=0;i<_1ac.length;i++){
m=Polaris[_1ac[i]];
_1aa(_1ad,m.EXPORT);
_1aa(_1ae,m.EXPORT_OK);
for(k in m.EXPORT_TAGS){
_1af[k]=_1aa(_1af[k],m.EXPORT_TAGS[k]);
}
all=m.EXPORT_TAGS[":all"];
if(!all){
all=_1aa(null,m.EXPORT,m.EXPORT_OK);
}
var j;
for(j=0;j<all.length;j++){
k=all[j];
self[k]=m[k];
}
}
self.EXPORT=_1ad;
self.EXPORT_OK=_1ae;
self.EXPORT_TAGS=_1af;
}());
}else{
if(typeof (Polaris.__compat__)=="undefined"){
Polaris.__compat__=true;
}
(function(){
if(typeof (document)=="undefined"){
return;
}
var _1b5=document.getElementsByTagName("script");
var _1b6="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var base=null;
var _1b8=null;
var _1b9={};
var i;
for(i=0;i<_1b5.length;i++){
var src=_1b5[i].getAttribute("src");
if(!src){
continue;
}
_1b9[src]=true;
if(src.match(/Polaris.js$/)){
base=src.substring(0,src.lastIndexOf("Polaris.js"));
_1b8=_1b5[i];
}
}
if(base===null){
return;
}
var _1bc=Polaris.Polaris.SUBMODULES;
for(var i=0;i<_1bc.length;i++){
if(Polaris[_1bc[i]]){
continue;
}
var uri=base+_1bc[i]+".js";
if(uri in _1b9){
continue;
}
if(document.documentElement&&document.documentElement.namespaceURI==_1b6){
var s=document.createElementNS(_1b6,"script");
s.setAttribute("id","Polaris_"+base+_1bc[i]);
s.setAttribute("src",uri);
s.setAttribute("type","application/x-javascript");
_1b8.parentNode.appendChild(s);
}else{
document.write("<script src=\""+uri+"\" type=\"text/javascript\"></script>");
}
}
})();
}



