function jstrprintf(){len=arguments.length;if(len==0){return;}if(len==1){return arguments[0];}var result;var regexstr;var replstr;var formatstr;var re;result="";regexstr="";replstr="";formatstr=arguments[0];for(var i=1;i';var rifPopup;var popContext=jstrprintf('
'+' $1
',textLoad);var popTitle=''+''+''+'
'+''+''+''+''+''+''+''+''+''+''+''+'
$1
'+strResize+'
'; if(rifPop){rifPopup=rifPop;var newdiv=document.getElementById("dragTitle"+rifPop);var elem=document.getElementById("dragContent"+rifPop);var img=document.getElementById("dragButton"+rifPop);if(elem){ newdiv.innerHTML=jstrprintf(popTitle,caption,rifPopup);; elem.innerHTML=popContext; newdiv.style.display="block"; elem.style.display="block"; if(img)img.src="/pretorio/images/buttonPupTop.gif"; return'dragContent'+rifPopup;}}else{nextID++;rifPopup=String(nextID);} var cord=getAnchorPosition(idIcon);startX=cord.x+24;startY=cord.y;newdiv=document.createElement("div");newdiv.id="dragTitle"+rifPopup;newdiv.className="divDragTitle";newdiv.style.width=width;newdiv.style.left=AddPx(startX);newdiv.style.top=AddPx(startY);newdiv.style.zIndex=topZ;newdiv.innerHTML=jstrprintf(popTitle,caption,rifPopup);; if(canMove){ if(newdiv.addEventListener){ newdiv.addEventListener("mousemove",function(e){return mouseMove(e)},true);newdiv.addEventListener("mousedown",function(e){return mouseDown(e)},true);newdiv.addEventListener("mouseup",function(e){return mouseUp(e)},true);}else{ newdiv.attachEvent("onmousemove",function(e){return mouseMove(e)});newdiv.attachEvent("onmousedown",function(e){return mouseDown(e)});newdiv.attachEvent("onmouseup",function(e){return mouseUp(e)});}}document.body.appendChild(newdiv);var newdiv2;newdiv2=document.createElement("div");newdiv2.id="dragContent"+rifPopup;newdiv2.className="divDragContent";newdiv2.style.width=width;if(height)newdiv2.style.height=height;newdiv2.style.left=AddPx(startX);newdiv2.style.top=AddPx(startY+24);newdiv2.style.zIndex=topZ;newdiv2.innerHTML=popContext;if(canMove){if(newdiv2.addEventListener){ newdiv2.addEventListener("mousedown",function(e){return contentMouseDown(e)},true);}else{ newdiv2.attachEvent("onmousedown",function(e){return contentMouseDown(e)});}}document.body.appendChild(newdiv2); newdiv.content=newdiv2;newdiv2.titlediv=newdiv;topZ+=1;startX+=25;startY+=25; return'dragContent'+rifPopup;}function toggleContentWin(id){var elem=document.getElementById("dragContent"+id);var img=document.getElementById("dragButton"+id);if(elem.style.display=="none"){ elem.style.display="block"; if(img)img.src="/pretorio/images/buttonPupTop.gif";}else{ elem.style.display="none"; if(img)img.src="/pretorio/images/buttonPupBottom.gif";}}function toggleWin(id){var newdiv=document.getElementById("dragTitle"+id);var elem=document.getElementById("dragContent"+id);var img=document.getElementById("dragButton"+id);if(newdiv.style.display=="none"){ newdiv.style.display="block"; elem.style.display="block"; if(img)img.src="/pretorio/images/buttonPupTop.gif";}else{ newdiv.style.display="none"; elem.style.display="none"; if(img)img.src="/pretorio/images/buttonPupBottom.gif";}}var dragObjTitle=null;var dragOffsetX=0;var dragOffsetY=0;function contentMouseDown(e){ var dragContent=e.srcElement || e.currentTarget;if(! dragContent.id.match("dragContent")){dragContent=findParentTagById(dragContent,"dragContent");}if(dragContent){dragContent.style.zIndex=topZ;dragContent.titlediv.style.zIndex=topZ;topZ++;}}function mouseDown(e){ var curElem=e.srcElement || e.target;var dragTitle=e.currentTarget || findParentDiv(curElem);if(dragTitle){if(dragTitle.className !='divDragTitle'){return;}} if(curElem && dragTitle){ addDocumentHandlers(true); dragTitle.style.zIndex=topZ;dragTitle.content.style.zIndex=topZ;topZ++; if(curElem.className !="divTitleButton"){ dragObjTitle=dragTitle; dragOffsetX=e.clientX - dragTitle.offsetLeft;dragOffsetY=e.clientY - dragTitle.offsetTop; if(e.preventDefault){e.preventDefault();}else{document.onselectstart=function(){return false;};e.cancelBubble=true;return false;}}}}function mouseMove(e){ if(dragObjTitle){if(!e.preventDefault){ if(e.button==0){finishDrag(e);return;}}dragObjTitle.style.left=AddPx(e.clientX - dragOffsetX);dragObjTitle.style.top=AddPx(e.clientY - dragOffsetY);dragObjTitle.content.style.left=AddPx(e.clientX - dragOffsetX);dragObjTitle.content.style.top=AddPx(e.clientY - dragOffsetY+24);if(e.preventDefault){e.preventDefault();}else{e.cancelBubble=true;return false;}}}function mouseUp(e){if(dragObjTitle){finishDrag(e);}}function finishDrag(e){var finalX=e.clientX - dragOffsetX;var finalY=e.clientY - dragOffsetY;if(finalX < 0){finalX=0};if(finalY < 0){finalY=0};dragObjTitle.style.left=AddPx(finalX);dragObjTitle.style.top=AddPx(finalY);dragObjTitle.content.style.left=AddPx(finalX);dragObjTitle.content.style.top=AddPx(finalY+24); dragObjTitle=null;addDocumentHandlers(false);if(e.preventDefault){e.preventDefault();}else{document.onselectstart=null;e.cancelBubble=true;return false;}}function addDocumentHandlers(addOrRemove){if(addOrRemove){if(document.body.addEventListener){ document.addEventListener("mousedown",function(e){return mouseDown(e)},true);document.addEventListener("mousemove",function(e){return mouseMove(e)},true);document.addEventListener("mouseup",function(e){return mouseUp(e)},true);}else{ document.onmousedown=function(){mouseDown(window.event)};document.onmousemove=function(){mouseMove(window.event)};document.onmouseup=function(){mouseUp(window.event)};}}else{if(document.body.addEventListener){ document.removeEventListener("mousedown",function(e){return mouseDown(e)},true);document.removeEventListener("mousemove",function(e){return mouseMove(e)},true);document.removeEventListener("mouseup",function(e){return mouseUp(e)},true);}else{ document.onmousedown=null;document.onmousemove=null;document.onmouseup=null;}}}function getAnchorPosition(anchorname){var useWindow=false;var coordinates=new Object();var x=0,y=0;var use_gebi=false,use_css=false,use_layers=false;if(document.getElementById){use_gebi=true;}else if(document.all){use_css=true;}if(use_gebi && document.all){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else if(use_gebi){var o=document.getElementById(anchorname);x=AnchorPosition_getPageOffsetLeft(o);y=AnchorPosition_getPageOffsetTop(o);}else if(use_css){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else{coordinates.x=0;coordinates.y=0;return coordinates;}coordinates.x=x;coordinates.y=y;return coordinates;}function AnchorPosition_getPageOffsetLeft(el){var ol=el.offsetLeft;while((el=el.offsetParent)!=null){ol+=el.offsetLeft;}return ol;}function AnchorPosition_getPageOffsetTop(el){var ot=el.offsetTop;while((el=el.offsetParent)!=null){ot+=el.offsetTop;}return ot;}function arkImpButPopAjx(caption,width,height,rifPop,canMove,canResize,idIcon,textLoad,formId,act,buttons){ var rifPopup=crtArkPopup(caption,width,height,rifPop,canMove,canResize,idIcon,textLoad); arkImpButAjx(formId,rifPopup,act,buttons);}