
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
if(typeof vp=="undefined"){var vp={};}vp.ui=function(){};vp.ui.addClass=function(vElement,sClass){vElement=vp.ui._checkForElement(vElement,"hasClass");if(!vp.ui.hasClass(vElement,sClass)){var aClasses=vElement.className.split(/\s+/g);aClasses[aClasses.length]=sClass;vElement.className=aClasses.join(" ");}};vp.ui._checkForElement=function(vElement,sFunc){if(typeof vElement=="string"){vElement=vp.ui.get(vElement);}if(!vElement){throw new Error("Call to "+sFunc+"() with a null element reference.");}return vElement;};vp.ui.collapse=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.collapse");vElement.style.display="none";};vp.ui.expand=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.expand");vElement.style.display="";};vp.ui.expandToBlock=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.expand");vElement.style.display="block";};vp.ui.toggleDisplay=function(vElement,bDisplayBlock){var objElem=vp.ui._checkForElement(vElement,"vp.ui.expand");if(objElem){if(objElem.style.display=="none"){if(bDisplayBlock){objElem.style.display="block";}else{objElem.style.display="";}}else{objElem.style.display="none";}}};vp.ui.expandAndCollapse=function(vElementToExpand,vElementToCollapse){vp.ui.collapse(vElementToCollapse);vp.ui.expand(vElementToExpand);};vp.ui.expandToBlockAndCollapse=function(vElementToExpand,vElementToCollapse){vp.ui.collapse(vElementToCollapse);vp.ui.expandToBlock(vElementToExpand);};vp.ui.get=function(sId){if(typeof sId!="string"){throw new Error("Call to vp.ui.get() with a non-string identifier.");}return(document.getElementById?document.getElementById(sId):document.all[sId]);};vp.ui.setStyleValue=function(vElement,sProperty,sValue){vElement=vp.ui._checkForElement(vElement,"vp.ui.setStyle");switch(sProperty.toLowerCase()){case "float":case "cssfloat":case "stylefloat":vElement.style.cssFloat=sValue;vElement.style.styleFloat=sValue;break;case "cursor":var sParsedValue=sValue.toLowerCase();if(sParsedValue=="pointer"||sParsedValue=="hand"){vElement.style.cursor=document.all?"hand":"pointer";}else{vElement.style.cursor=sValue;}break;default:vElement.style[sProperty]=sValue;break;}};vp.ui.getCurrentStyle=function(vElement,sProperty){vElement=vp.ui._checkForElement(vElement,"vp.ui.getCurrentStyle");var value=null;var dv=document.defaultView;if(sProperty=='opacity'&&vElement.filters){value=1;try{value=vElement.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;}catch(e){try{value=vElement.filters.item('alpha').opacity/100;}catch(e){}}}else if(vElement.style[sProperty]){value=vElement.style[sProperty];}else if(vElement.currentStyle&&vElement.currentStyle[sProperty]){value=vElement.currentStyle[sProperty];}else if(dv&&dv.getComputedStyle){var converted='';for(var i=0,len=sProperty.length;i<len;++i){if(sProperty.charAt(i)==sProperty.charAt(i).toUpperCase()){converted=converted+'-'+sProperty.charAt(i).toLowerCase();}else{converted=converted+sProperty.charAt(i);}}if(dv.getComputedStyle(vElement,'')&&dv.getComputedStyle(vElement,'').getPropertyValue(converted)){value=dv.getComputedStyle(vElement,'').getPropertyValue(converted);}}return value;};vp.ui.getClientHeight=function(){if(typeof window.innerHeight!="undefined"){return window.innerHeight;}else if(document.documentElement&&typeof document.documentElement.clientHeight!="undefined"&&document.documentElement.clientHeight>0){return document.documentElement.clientHeight;}else if(document.body&&typeof document.body.clientHeight!="undefined"){return document.body.clientHeight;}else{return-1;}};vp.ui.getClientWidth=function(){if(typeof window.innerWidth!="undefined"){return window.innerWidth;}else if(document.documentElement&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!==0){return document.documentElement.clientWidth;}else if(document.body&&typeof document.body.clientWidth!="undefined"){return document.body.clientWidth;}else{return-1;}};vp.ui.getRect=function(vElement,bFixIEOverflowBug){vElement=vp.ui._checkForElement(vElement,"vp.ui.getRect");this.element=vElement;var oRect={};oRect.top=0;oRect.left=0;oRect.bottom=0;oRect.right=0;var oBox;if(vElement.getBoundingClientRect){oBox=vElement.getBoundingClientRect();var iScrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop);var iScrollLeft=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);if(bFixIEOverflowBug&&iScrollTop===0){oRect.top=vp.ui._getTopAux(vElement);}else{oRect.top=Math.max(oBox.top+iScrollTop-2,0);}if(bFixIEOverflowBug&&iScrollLeft===0){oRect.left=vp.ui._getLeftAux(vElement);}else{oRect.left=Math.max(oBox.left+iScrollLeft-2,0);}oRect.bottom=oRect.top-(oBox.top-oBox.bottom);oRect.right=oRect.left+(oBox.right-oBox.left);}else if(document.getBoxObjectFor){oBox=document.getBoxObjectFor(vElement);var iBorderLeft=parseInt(vp.ui.getCurrentStyle(vElement,'borderLeftWidth'));var iBorderTop=parseInt(vp.ui.getCurrentStyle(vElement,'borderTopWidth'));oRect.left=oBox.x-iBorderLeft;oRect.top=oBox.y-iBorderTop;oRect.bottom=oRect.top+oBox.height;oRect.right=oRect.left+oBox.width;}else{var oTemp=vElement;var fZoom;while(oTemp!==null){fZoom=vp.ui._getZoom(oTemp);oRect.top*=fZoom;oRect.left*=fZoom;oRect.top+=oTemp.offsetTop;oRect.left+=oTemp.offsetLeft;if(oTemp.tagName!="BODY"){oRect.top-=oTemp.scrollTop;oRect.left-=oTemp.scrollLeft;}oTemp=oTemp.offsetParent;}fZoom=vp.ui._getZoom(vElement);oRect.right=Math.round(vElement.offsetWidth*fZoom)+oRect.left;oRect.bottom=Math.round(vElement.offsetHeight*fZoom)+oRect.top;}oRect.width=oRect.right-oRect.left;oRect.height=oRect.bottom-oRect.top;return oRect;};vp.ui._getZoom=function(oObj){var val=parseFloat(oObj.style.zoom);return isNaN(val)?1:val;};vp.ui.getTop=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.getTop");return vp.ui.getRect(vElement).top;};vp.ui._getTopAux=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui._getTopAux");var iTop=0;if(vElement.offsetParent){while(vElement.offsetParent){iTop+=vElement.offsetTop;vElement=vElement.offsetParent;}}else if(vElement.y){iTop+=vElement.y;}return iTop;};vp.ui.getLeft=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.getLeft");return vp.ui.getRect(vElement).left;};vp.ui._getLeftAux=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui._getLeftAux");var iLeft=0;if(vElement.offsetParent){while(vElement.offsetParent){iLeft+=vElement.offsetLeft;vElement=vElement.offsetParent;}}else if(vElement.x){iLeft+=vElement.x;}return iLeft;};vp.ui.getHeight=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.getHeight");return vElement.offsetHeight;};vp.ui.getWidth=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.getWidth");return vElement.offsetWidth;};vp.ui.hasClass=function(vElement,sClass){vElement=vp.ui._checkForElement(vElement,"vp.ui.hasClass");var aClasses=vElement.className.split(/\s+/g);;for(var i=0;i<aClasses.length;i++){if(aClasses[i]==sClass){return true;}}return false;};vp.ui.hide=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.hide");vElement.style.visibility="hidden";};vp.ui.ifExists=function(vElement,fnAction){try{vElement=vp.ui._checkForElement(vElement,"vp.ui.ifExists");fnAction(vElement);}catch(ex){}};vp.ui.isPointInRect=function(iX,iY,oRect){if(typeof iX!="number"){throw new Error("vp.ui.isPointInRect(): The x-coordinate must be a number.");}else if(typeof iY!="number"){throw new Error("vp.ui.isPointInRect(): The y-coordinate must be a number.");}else if(!oRect||typeof oRect.left!="number"||typeof oRect.top!="number"){throw new Error("vp.ui.isPointInRect(): Invalid rectangle passed in.");}return((iX>=oRect.left)&&(iX<=oRect.right)&&(iY>=oRect.top)&&(iY<=oRect.bottom));};vp.ui.isVisible=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.isVisible");return vp.ui.getCurrentStyle(vElement,"visibility")!="hidden";};vp.ui.moveTo=function(vElement,iLeft,iTop){vElement=vp.ui._checkForElement(vElement,"vp.ui.moveTo");if(typeof iLeft!="number"){throw new Error("Call to vp.ui.moveTo() with an invalid X coordinate.");}else if(typeof iTop!="number"){throw new Error("Call to vp.ui.moveTo() with an invalid Y coordinate.");}if(vp.ui.getCurrentStyle(vElement,"position")!="absolute"){throw new Error("vp.ui.moveTo(): Can't move an element that isn't absolutely positioned.");}vElement.style.top=iTop+"px";vElement.style.left=iLeft+"px";};vp.ui.removeClass=function(vElement,sClass){vElement=vp.ui._checkForElement(vElement,"vp.ui.removeClass");var aClasses=vElement.className.split(/\s+/g);;for(var i=0;i<aClasses.length;i++){if(aClasses[i]==sClass){aClasses[i]="";}}vElement.className=aClasses.join(" ");};vp.ui.resizeTo=function(vElement,iWidth,iHeight){vElement=vp.ui._checkForElement(vElement,"vp.ui.resizeTo");if(typeof iWidth!="number"){throw new Error("Call to vp.ui.resizeTo() with an invalid width.");}else if(typeof iHeight!="number"){throw new Error("Call to vp.ui.resizeTo() with an invalid height/");}vElement.style.width=iWidth+"px";vElement.style.height=iHeight+"px";};vp.ui.setHeight=function(vElement,iHeight){vElement=vp.ui._checkForElement(vElement,"vp.ui.setHeight");if(typeof iHeight!="number"){throw new Error("Call to vp.ui.setHeight() with an invalid height parameter.");}vElement.style.height=iHeight+"px";};vp.ui.setStyle=function(vElement,sCssText){vElement=vp.ui._checkForElement(vElement,"vp.ui.setStyle");vElement.style.cssText=sCssText;};vp.ui.setWidth=function(vElement,iWidth){vElement=vp.ui._checkForElement(vElement,"setWidth");if(typeof iWidth!="number"){throw new Error("Call to vp.ui.setWidth() with an invalid width parameter.");}vElement.style.width=iWidth+"px";};vp.ui.show=function(vElement){vElement=vp.ui._checkForElement(vElement,"show");vElement.style.visibility="visible";vElement.style.display="";};vp.ui.insertFirstElement=function(oTarget,oElement){var oFirstElement=oTarget.childNodes[0];oTarget.insertBefore(oElement,oFirstElement);};vp.ui.moveToRoot=function(vElement,bAddToDocumentStart){vElement=vp.ui._checkForElement(vElement,"vp.ui.moveToRoot");if(vElement.parentNode!=document.body){var oParent=vElement.parentNode;oParent.removeChild(vElement);if(bAddToDocumentStart){vp.ui.insertFirstElement(top.document.body,vElement);}else{document.body.appendChild(vElement);}}};vp.ui.scrollTo=function(vElement){vElement=vp.ui._checkForElement(vElement,"vp.ui.scrollTo");var oRec=vp.ui.getRect(vElement);var iTopDif=oRec.top-document.body.scrollTop;if(iTopDif<0){if(window.scrollBy){window.scrollBy(0,iTopDif);}else{vElement.scrollIntoView();}}var iBottomDif=oRec.bottom-(document.body.scrollTop+vp.ui.getClientHeight());if(iBottomDif>0){if(window.scrollBy){window.scrollBy(0,iBottomDif);}else{vElement.scrollIntoView();}}};vp.ui.setCoord=function(oObj,sCoord,iValue){oObj=oObj.style?oObj.style:oObj;if(sCoord=="top"||sCoord=="left"||sCoord=="width"||sCoord=="height"){oObj[sCoord]=iValue;}else if(sCoord=="right"){oObj.left=oObj.left+oObj.width+iValue;}else if(sCoord=="bottom"){oObj.top=oObj.top+oObj.height+iValue;}};vp.ui.getCoord=function(oObj,sCoord){oObj=oObj.style?oObj.style:oObj;if(sCoord=="top"||sCoord=="left"){return parseInt(oObj[sCoord]);}else if(sCoord=="right"){return parseInt(oObj.left)+parseInt(oObj.width);}else if(sCoord=="bottom"){return parseInt(oObj.top)+parseInt(oObj.height);}};vp.ui.getLocalRect=function(oObj){var oRect={};vp.ui.applyPosition(oObj,oRect);oRect.right=oRect.left+oRect.width;oRect.bottom=oRect.top+oRect.height;return oRect;};vp.ui.applyPosition=function(oObj1,oObj2){oObj1=oObj1.style?oObj1.style:oObj1;oObj2=oObj2.style?oObj2.style:oObj2;oObj2.top=parseInt(oObj1.top);oObj2.left=parseInt(oObj1.left);oObj2.height=parseInt(oObj1.height);oObj2.width=parseInt(oObj1.width);};vp.ui._getImageButtonATag=function(oButton){if(oButton.tagName=="A"&&oButton.childNodes[0]&&oButton.childNodes[0].tagName=="IMG"){return oButton;}else if(oButton.tagName=="IMG"&&oButton.parentNode&&oButton.parentNode.tagName=="A"){return oButton.parentNode;}throw Error("The image selected to disable is not contained in an A tag");};vp.ui.disableImageButton=function(oImage){var oATag=vp.ui._getImageButtonATag(oImage);oATag._onclickdisabled=oATag.onclick;oATag.onclick=vp.events.cancel;oATag.style.cursor="default";oATag.hideFocus=true;vp.ui.setOpacity(oATag.childNodes[0],0.5);};vp.ui.enableImageButton=function(oImage){var oATag=vp.ui._getImageButtonATag(oImage);if(oATag._onclickdisabled){oATag.onclick=oATag._onclickdisabled;oATag._onclickdisabled=null;}vp.ui.setStyleValue(oATag,"cursor","pointer");oATag.hideFocus=false;vp.ui.setOpacity(oATag.childNodes[0],1);};vp.ui.setOpacity=function(oObj,fOpacity){if(typeof oObj.style.opacity!="undefined"){if(fOpacity==1){oObj.style.opacity="";return;}oObj.style.opacity=fOpacity;}else{if(fOpacity==1){oObj.style.filter="";return;}var bHasFilters=false;try{bHasFilters=oObj.filters?true:false;}catch(e){}var iOpacity=fOpacity*100;oObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+iOpacity+")";}};vp.ui.reactivateClickableButton=function(sElementNamespaceId){vp.ui.expandAndCollapse('imgEnabledButton'+sElementNamespaceId,'imgDisabledButton'+sElementNamespaceId);};vp.ui.centerElement=function(sElementId){var oElement=vp.ui.get(sElementId);if(!oElement){throw new Error("vp.ui.centerElement: no such element");}vp.ui.moveTo(oElement,(vp.ui.getClientWidth()-vp.ui.getHeight(oElement)) / 2, (vp.ui.getClientHeight() - vp.ui.getHeight(oElement)) / 2+150);};vp.ui.preloadImages=function(aImages){for(var i=0;i<aImages.length;i++){var oImg=new Image();oImg.src=aImages[i];};};
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
