var WidgetRootNodeQuery="CollectionWidgetQuery";var NoSwitchForSystemFields=true;AdvancedSearch={xeHTMLForm:null,DEBUG:false,initPage:function(){autoTextInputSize(20);this.updateCount();},updateCount:function(){if($("resultsCount")){var formElems=d.advSearchForm.elements;var xeHTMLForm=new XMLElement("HTMLForm");for(var i=0;i<formElems.length;i++){var value=formElems[i].value;var name=formElems[i].name;var isRadio=/^radio_/.test(name);if(value&&value!=""&&name&&name!=""&&((isRadio&&formElems[i].checked&&value!="null")||!isRadio)){var xeHTMLElement=new XMLElement("HTMLElement");xeHTMLElement.setAttribute("name",formElems[i].name);xeHTMLElement.setAttribute("value",value);xeHTMLForm.appendChild(xeHTMLElement);}}if(!xeHTMLForm.equals(this.xeHTMLForm)){var xeCollectionQuery=new XMLElement("CollectionQuery");xeCollectionQuery.setAttribute("collectionName",COLLECTION_NAME);var xeGetResultsCount=new XMLElement("GetResultsCount",xeCollectionQuery);xeGetResultsCount.appendChild(xeHTMLForm);var xdCollectionQuery=ProgramShop.getQueryXMLDoc(xeCollectionQuery);var space=location.pathname.split("/")[2];HTTP.sendRequest(ProgramShop.getQueryHref("CollectionQuery",space),this.displayCount,"POST",HTTP.getXMLContentType("UTF-8"),false,xeCollectionQuery.toXML(),this.DEBUG);this.xeHTMLForm=xeHTMLForm;}if($("resultsCount")){setTimeout("AdvancedSearch.updateCount()",500);}}},displayCount:function(xmlCollectionResult){var xeResult=new ParsedXMLElement(xmlCollectionResult);var xeCount=xeResult.getChild("CollectionResultsCount");$("btSubmit").disabled=(xeCount&&xeCount.getAttribute("value")=="0");$("resultsCount").innerHTML=(xeCount)?xeCount.getAttribute("label"):"";},submit:function(){Manager.setAgentFocus();if(Manager.isStable()){d.advSearchForm.submit();}else{setTimeout("AdvancedSearch.submit()",500);}}};Fiche={imgIndex:0,showFullSizeImage:function(){var src=IMAGES[this.imgIndex].srcLrg;if(src){openPopup(src,null,"scrollbars=0,resizable,width="+INIT_POPUP_SIZE.w+",height="+INIT_POPUP_SIZE.h);}},setFSImgLink:function(imgIndex){var img=IMAGES[imgIndex];var oImg=$("mainImg");if(img&&oImg){oImg.style.cursor=(img.srcLrg)?"pointer":"";oImg.alt=(img.srcLrg)?LABEL_ZOOM:"";}},showImage:function(imgIndex){var img=IMAGES[imgIndex];var oImg=$("mainImg");var oLinkImg=$("mainLink");var oLinkThumbImg=$("thumbnail_"+imgIndex);if(img&&oImg){oImg.src=img.src;oLinkImg.href=img.srcFullSize;oLinkImg.title=img.name;var elements=$j("a[id *= 'thumbnail']");for(var i=0;i<elements.length;i++){var element=elements[i];$j(element).attr("rel","slideshow");}oLinkThumbImg.rel="";this.setFSImgLink(imgIndex);var fc=$("mainImgName").firstChild;if(fc){fc.data=(img.name)?img.name:"";}this.imgIndex=imgIndex;}}};AgentPCB={onLogin:function(){if(this.isInstanceOf("AlphaListAgent")||this.isInstanceOf("LKTableAgent")){Manager.openPanel($(this.id),$("typeName_"+this.fieldId).innerHTML);}},update:function(xeWidgetResult){if(this.isInstanceOf("TextInputAgent")){$(this.id.replace(/^[^_]+/,"input")).value=this.getResultLabel(xeWidgetResult);}else{if(this.isInstanceOf("AlphaListAgent")||this.isInstanceOf("LKTableAgent")){if(this.fieldType=="FKey"||this.fieldType=="FKeySet"){var fkey=this.getResultValue(xeWidgetResult);$("input_"+this.fieldRef).value=(fkey)?fkey.getAttribute("recId"):"";$("label_"+this.fieldRef).value=this.getResultLabel(xeWidgetResult);}else{$(this.id.replace(/^[^_]+/,"input")).value=this.getResultLabel(xeWidgetResult);}$(this.id).focus();}}},updatePanel:function(xeWidgetResult){$(this.id.replace(/^[^_]+/,"input")).value=this.getResultLabel(xeWidgetResult);$(this.id).focus();}};View={rowToHighlight:null,highlightedRow:null,gotoItem:function(index){location.href=HREF_GOTO_ITEM+index;},highlightRow:function(tr){this.rowToHighlight=(tr)?tr:null;},refreshHightlightedRow:function(){if(this.highlightedRow!=this.rowToHighlight){if(this.highlightedRow!=null){this.highlightedRow.className=this.highlightedRow.className.split("_")[0];}if(this.rowToHighlight!=null){this.rowToHighlight.className+="_mouseOver";}this.highlightedRow=this.rowToHighlight;}setTimeout("View.refreshHightlightedRow()",50);}};ConfClick={ccDivId:"conf",goDivId:"greyOut",ccWidth:200,ccOffset:{left:-2,top:-2},display:function(obj,e,fieldName){var docWidth=document.documentElement.scrollWidth;var goDiv=$(this.goDivId);if(!goDiv){goDiv=d.createElement("DIV");goDiv.id=this.goDivId;goDiv.className="greyOut";goDiv.onclick=this.hide;goDiv.style.width=docWidth+"px";var pageHeight=d.body.scrollHeight;if(d.body.clientHeight>pageHeight){pageHeight=d.body.clientHeight;}if(d.documentElement&&d.documentElement.clientHeight>pageHeight){pageHeight=d.documentElement.clientHeight;}goDiv.style.height=pageHeight+"px";d.body.appendChild(goDiv);goDiv.innerHTML='<img src="/rsrc/img/tx.gif" width="'+(docWidth-20)+'" height="1"/>';}var ccDiv=$(this.ccDivId);if(!ccDiv){ccDiv=d.createElement("DIV");ccDiv.id=this.ccDivId;ccDiv.className="conf";ccDiv.style.top=(getAbsPos(obj,"Top")+this.ccOffset.top)+"px";var x=getAbsPos(obj,"Left")+this.ccOffset.left;if(x+this.ccWidth>docWidth-16){x=docWidth-16-this.ccWidth;}if(x<10){x=10;}ccDiv.style.left=x+"px";ccDiv.style.width=this.ccWidth+"px";d.body.appendChild(ccDiv);var ccLink=d.createElement("A");ccLink.href=obj.href;ccLink.tabIndex="1";ccLink.onclick=this.hide;ccDiv.appendChild(ccLink);ccLink.innerHTML=LABEL_CONF_CLICK.replace(/#1/g,obj.innerHTML).replace(/#2/g,fieldName);}cancelBubble(e);},hide:function(){var ccDiv=$(ConfClick.ccDivId);if(ccDiv){d.body.removeChild(ccDiv);}var goDiv=$(ConfClick.goDivId);if(goDiv){d.body.removeChild(goDiv);}}};