LightboxOptions=Object.extend({fileLoadingImage:'/includes/images/lightbox/loading.gif',fileBottomNavCloseImage:'/includes/images/lightbox/closelabel.gif',overlayOpacity:0.8,animate:true,resizeSpeed:10,borderSize:10,labelImage:"Image",labelOf:"of"},window.LightboxOptions||{});var Lightbox=Class.create();Lightbox.prototype={imageArray:[],activeImage:undefined,initialize:function(){this.updateImageList();this.keyboardAction=this.keyboardAction.bindAsEventListener(this);if(LightboxOptions.resizeSpeed>10)LightboxOptions.resizeSpeed=10;if(LightboxOptions.resizeSpeed<1)LightboxOptions.resizeSpeed=1;this.resizeDuration=LightboxOptions.animate?((11-LightboxOptions.resizeSpeed)*0.15):0;this.overlayDuration=LightboxOptions.animate?0.2:0;var size=(LightboxOptions.animate?250:1)+'px';var objBody=$$('body')[0];objBody.appendChild(Builder.node('div',{id:'overlay'}));objBody.appendChild(Builder.node('div',{id:'lightbox'},[Builder.node('div',{id:'outerImageContainer'},Builder.node('div',{id:'imageContainer'},[Builder.node('img',{id:'lightboxImage'}),Builder.node('div',{id:'hoverNav'},[Builder.node('a',{id:'prevLink',href:'#'}),Builder.node('a',{id:'nextLink',href:'#'})]),Builder.node('div',{id:'loading'},Builder.node('a',{id:'loadingLink',href:'#'},Builder.node('img',{src:LightboxOptions.fileLoadingImage})))])),Builder.node('div',{id:'imageDataContainer'},Builder.node('div',{id:'imageData'},[Builder.node('div',{id:'imageDetails'},[Builder.node('span',{id:'caption'}),Builder.node('span',{id:'numberDisplay'})]),Builder.node('div',{id:'bottomNav'},Builder.node('a',{id:'bottomNavClose',href:'#'},Builder.node('img',{src:LightboxOptions.fileBottomNavCloseImage})))]))]));$('overlay').hide().observe('click',(function(){this.end();}).bind(this));$('lightbox').hide().observe('click',(function(event){if(event.element().id=='lightbox')this.end();}).bind(this));$('outerImageContainer').setStyle({width:size,height:size});$('prevLink').observe('click',(function(event){event.stop();this.changeImage(this.activeImage-1);}).bindAsEventListener(this));$('nextLink').observe('click',(function(event){event.stop();this.changeImage(this.activeImage+1);}).bindAsEventListener(this));$('loadingLink').observe('click',(function(event){event.stop();this.end();}).bind(this));$('bottomNavClose').observe('click',(function(event){event.stop();this.end();}).bind(this));var th=this;(function(){var ids='overlay lightbox outerImageContainer imageContainer lightboxImage hoverNav prevLink nextLink loading loadingLink '+'imageDataContainer imageData imageDetails caption numberDisplay bottomNav bottomNavClose';$w(ids).each(function(id){th[id]=$(id);});}).defer();},updateImageList:function(){this.updateImageList=Prototype.emptyFunction;document.observe('click',(function(event){var target=event.findElement('a[rel^=lightbox]')||event.findElement('area[rel^=lightbox]');if(target){event.stop();this.start(target);}}).bind(this));},start:function(imageLink){$$('select','object','embed').each(function(node){node.style.visibility='hidden'});var arrayPageSize=this.getPageSize();$('overlay').setStyle({width:arrayPageSize[0]+'px',height:arrayPageSize[1]+'px'});new Effect.Appear(this.overlay,{duration:this.overlayDuration,from:0.0,to:LightboxOptions.overlayOpacity});this.imageArray=[];var imageNum=0;if((imageLink.rel=='lightbox')){this.imageArray.push([imageLink.href,imageLink.title]);}else{this.imageArray=$$(imageLink.tagName+'[href][rel="'+imageLink.rel+'"]').collect(function(anchor){return[anchor.href,anchor.title];}).uniq();while(this.imageArray[imageNum]&&this.imageArray[imageNum][0]!=imageLink.href){imageNum++;}}
var arrayPageScroll=document.viewport.getScrollOffsets();var lightboxTop=arrayPageScroll[1]+(document.viewport.getHeight()/10);var lightboxLeft=arrayPageScroll[0];this.lightbox.setStyle({top:lightboxTop+'px',left:lightboxLeft+'px'}).show();this.changeImage(imageNum);},changeImage:function(imageNum){if(imageNum<0)
this.activeImage=this.imageArray.length-1;else if(imageNum>this.imageArray.length-1)
this.activeImage=0;else
this.activeImage=imageNum;if(LightboxOptions.animate)this.loading.show();this.lightboxImage.hide();this.hoverNav.hide();this.prevLink.hide();this.nextLink.hide();this.imageDataContainer.setStyle({opacity:.0001});this.numberDisplay.hide();var imgPreloader=new Image();imgPreloader.onload=(function(){this.lightboxImage.src=this.imageArray[this.activeImage][0];this.resizeImageContainer(imgPreloader.width,imgPreloader.height);}).bind(this);imgPreloader.src=this.imageArray[this.activeImage][0];},resizeImageContainer:function(imgWidth,imgHeight){var widthCurrent=this.outerImageContainer.getWidth();var heightCurrent=this.outerImageContainer.getHeight();var widthNew=(imgWidth+LightboxOptions.borderSize*2);var heightNew=(imgHeight+LightboxOptions.borderSize*2);var xScale=(widthNew/widthCurrent)*100;var yScale=(heightNew/heightCurrent)*100;var wDiff=widthCurrent-widthNew;var hDiff=heightCurrent-heightNew;if(hDiff!=0)new Effect.Scale(this.outerImageContainer,yScale,{scaleX:false,duration:this.resizeDuration,queue:'front'});if(wDiff!=0)new Effect.Scale(this.outerImageContainer,xScale,{scaleY:false,duration:this.resizeDuration,delay:this.resizeDuration});var timeout=0;if((hDiff==0)&&(wDiff==0)){timeout=100;if(Prototype.Browser.IE)timeout=250;}
(function(){this.prevLink.setStyle({height:imgHeight+'px'});this.nextLink.setStyle({height:imgHeight+'px'});this.imageDataContainer.setStyle({width:widthNew+'px'});this.showImage();}).bind(this).delay(timeout/1000);},showImage:function(){this.loading.hide();new Effect.Appear(this.lightboxImage,{duration:this.resizeDuration,queue:'end',afterFinish:(function(){this.updateDetails();}).bind(this)});this.preloadNeighborImages();},updateDetails:function(){if(this.imageArray[this.activeImage][1]!=""){this.caption.update(this.imageArray[this.activeImage][1]).show();}
if(this.imageArray.length>1){this.numberDisplay.update(LightboxOptions.labelImage+' '+(this.activeImage+1)+' '+LightboxOptions.labelOf+'  '+this.imageArray.length).show();}
new Effect.Parallel([new Effect.SlideDown(this.imageDataContainer,{sync:true,duration:this.resizeDuration,from:0.0,to:1.0}),new Effect.Appear(this.imageDataContainer,{sync:true,duration:this.resizeDuration})],{duration:this.resizeDuration,afterFinish:(function(){var arrayPageSize=this.getPageSize();this.overlay.setStyle({height:arrayPageSize[1]+'px'});this.updateNav();}).bind(this)});},updateNav:function(){this.hoverNav.show();this.prevLink.show();this.nextLink.show();this.enableKeyboardNav();},enableKeyboardNav:function(){document.observe('keydown',this.keyboardAction);},disableKeyboardNav:function(){document.stopObserving('keydown',this.keyboardAction);},keyboardAction:function(event){var keycode=event.keyCode;var escapeKey;if(event.DOM_VK_ESCAPE){escapeKey=event.DOM_VK_ESCAPE;}else{escapeKey=27;}
var key=String.fromCharCode(keycode).toLowerCase();if(key.match(/x|o|c/)||(keycode==escapeKey)){this.end();}else if((key=='p')||(keycode==37)){if(this.activeImage!=0){this.disableKeyboardNav();this.changeImage(this.activeImage-1);}}else if((key=='n')||(keycode==39)){if(this.activeImage!=(this.imageArray.length-1)){this.disableKeyboardNav();this.changeImage(this.activeImage+1);}}},preloadNeighborImages:function(){var preloadNextImage,preloadPrevImage;if(this.imageArray.length>this.activeImage+1){preloadNextImage=new Image();preloadNextImage.src=this.imageArray[this.activeImage+1][0];}
if(this.activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=this.imageArray[this.activeImage-1][0];}},end:function(){this.disableKeyboardNav();this.lightbox.hide();new Effect.Fade(this.overlay,{duration:this.overlayDuration});$$('select','object','embed').each(function(node){node.style.visibility='visible'});},getPageSize:function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
return[pageWidth,pageHeight];}}
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",_7);this.setAttribute("doExpressInstall",false);var _d=(_9)?_9:window.location;this.setAttribute("xiRedirectUrl",_d);this.setAttribute("redirectUrl","");if(_a){this.setAttribute("redirectUrl",_a);}};deconcept.SWFObject.prototype={setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};deconcept.PlayerVersion=function(_27){this.major=_27[0]!=null?parseInt(_27[0]):0;this.minor=_27[1]!=null?parseInt(_27[1]):0;this.rev=_27[2]!=null?parseInt(_27[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_29){var q=document.location.search||document.location.hash;if(q){var _2b=q.substring(1).split("&");for(var i=0;i<_2b.length;i++){if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};if(typeof window.onunload=="function"){var _30=window.onunload;window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();_30();};}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};if(typeof window.onbeforeunload=="function"){var oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){deconcept.SWFObjectUtil.prepUnload();oldBeforeUnload();};}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){Array.prototype.push=function(_31){this[this.length]=_31;return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var MapIconMaker={};MapIconMaker.createMarkerIcon=function(opts){var width=opts.width||32;var height=opts.height||32;var primaryColor=opts.primaryColor||"#ff0000";var strokeColor=opts.strokeColor||"#000000";var cornerColor=opts.cornerColor||"#ffffff";var baseUrl="http://chart.apis.google.com/chart?cht=mm";var iconUrl=baseUrl+"&chs="+width+"x"+height+"&chco="+cornerColor.replace("#","")+","+
primaryColor.replace("#","")+","+
strokeColor.replace("#","")+"&ext=.png";var icon=new GIcon(G_DEFAULT_ICON);icon.image=iconUrl;icon.iconSize=new GSize(width,height);icon.shadowSize=new GSize(Math.floor(width*1.6),height);icon.iconAnchor=new GPoint(width/2,height);icon.infoWindowAnchor=new GPoint(width/2,Math.floor(height/12));icon.printImage=iconUrl+"&chof=gif";icon.mozPrintImage=iconUrl+"&chf=bg,s,ECECD8"+"&chof=gif";iconUrl=baseUrl+"&chs="+width+"x"+height+"&chco="+cornerColor.replace("#","")+","+
primaryColor.replace("#","")+","+
strokeColor.replace("#","");icon.transparent=iconUrl+"&chf=a,s,ffffff11&ext=.png";icon.imageMap=[width/2,height,(7/16)*width,(5/8)*height,(5/16)*width,(7/16)*height,(7/32)*width,(5/16)*height,(5/16)*width,(1/8)*height,(1/2)*width,0,(11/16)*width,(1/8)*height,(25/32)*width,(5/16)*height,(11/16)*width,(7/16)*height,(9/16)*width,(5/8)*height];for(var i=0;i<icon.imageMap.length;i++){icon.imageMap[i]=parseInt(icon.imageMap[i]);}
return icon;};MapIconMaker.createFlatIcon=function(opts){var width=opts.width||32;var height=opts.height||32;var primaryColor=opts.primaryColor||"#ff0000";var shadowColor=opts.shadowColor||"#000000";var shadow=opts.noShadow?'01':'ff';var label=MapIconMaker.escapeUserText_(opts.label)||"";var labelColor=opts.labelColor||"#000000";var labelSize=opts.labelSize||0;var shape=opts.shape||"circle";var shapeCode=(shape==="circle")?"it":"itr";var baseUrl="http://chart.apis.google.com/chart?cht="+shapeCode;var iconUrl=baseUrl+"&chs="+width+"x"+height+"&chco="+primaryColor.replace("#","")+","+
shadowColor.replace("#","")+shadow+",ffffff01"+"&chl="+label+"&chx="+labelColor.replace("#","")+","+labelSize;var icon=new GIcon(G_DEFAULT_ICON);icon.image=iconUrl+"&chf=bg,s,00000000"+"&ext=.png";icon.iconSize=new GSize(width,height);icon.shadowSize=new GSize(0,0);icon.iconAnchor=new GPoint(width/2,height/2);icon.infoWindowAnchor=new GPoint(width/2,height/2);icon.printImage=iconUrl+"&chof=gif";icon.mozPrintImage=iconUrl+"&chf=bg,s,ECECD8"+"&chof=gif";icon.transparent=iconUrl+"&chf=a,s,ffffff01&ext=.png";icon.imageMap=[];if(shapeCode==="roundrect"){icon.imageMap=[0,0,width,0,width,height,0,height];}else{var polyNumSides=8;var polySideLength=360/polyNumSides;var polyRadius=Math.min(width,height)/2;for(var a=0;a<(polyNumSides+1);a++){var aRad=polySideLength*a*(Math.PI/180);var pixelX=polyRadius+polyRadius*Math.cos(aRad);var pixelY=polyRadius+polyRadius*Math.sin(aRad);icon.imageMap.push(parseInt(pixelX),parseInt(pixelY));}}
return icon;};MapIconMaker.createLabeledMarkerIcon=function(opts){var primaryColor=opts.primaryColor||"#DA7187";var strokeColor=opts.strokeColor||"#000000";var starPrimaryColor=opts.starPrimaryColor||"#FFFF00";var starStrokeColor=opts.starStrokeColor||"#0000FF";var label=MapIconMaker.escapeUserText_(opts.label)||"";var labelColor=opts.labelColor||"#000000";var addStar=opts.addStar||false;var pinProgram=(addStar)?"pin_star":"pin";var baseUrl="http://chart.apis.google.com/chart?cht=d&chdp=mapsapi&chl=";var iconUrl=baseUrl+pinProgram+"'i\\"+"'["+label+"'-2'f\\"+"hv'a\\]"+"h\\]o\\"+
primaryColor.replace("#","")+"'fC\\"+
labelColor.replace("#","")+"'tC\\"+
strokeColor.replace("#","")+"'eC\\";if(addStar){iconUrl+=starPrimaryColor.replace("#","")+"'1C\\"+
starStrokeColor.replace("#","")+"'0C\\";}
iconUrl+="Lauto'f\\";var icon=new GIcon(G_DEFAULT_ICON);icon.image=iconUrl+"&ext=.png";icon.iconSize=(addStar)?new GSize(23,39):new GSize(21,34);return icon;};MapIconMaker.escapeUserText_=function(text){if(text===undefined){return null;}
text=text.replace(/@/,"@@");text=text.replace(/\\/,"@\\");text=text.replace(/'/,"@'");text=text.replace(/\[/,"@[");text=text.replace(/\]/,"@]");return encodeURIComponent(text);};function ClusterMarker($map,$options){this._map=$map;this._mapMarkers=[];this._iconBounds=[];this._clusterMarkers=[];this._eventListeners=[];this._pointHistory=[];this._pointForwardHistory=[];this.clusterMarkerIcon=[];if(typeof($options)==='undefined')
{$options={};}
this._options=$options;this.borderPadding=($options.borderPadding)?$options.borderPadding:256;this.clusteringEnabled=($options.clusteringEnabled===false)?false:true;if($options.clusterMarkerClick)
{this.clusterMarkerClick=$options.clusterMarkerClick;}
if($options.clusterMarkerIcon)
{this.clusterMarkerIcon=$options.clusterMarkerIcon;}
else if($options.clusterMarkerCustomIcons)
{this.clusterMarkerIcon=null;this.clusterMarkerIconColor=$options.clusterMarkerIconColor||"#FF0000";this.clusterMarkerIconTextColor=$options.clusterMarkerIconTextColor||"#FFFFFF";}
else
{this.clusterMarkerIcon=new GIcon(G_DEFAULT_ICON);}
this.clusterMarkerTitle=($options.clusterMarkerTitle)?$options.clusterMarkerTitle:'Click to zoom in and see %count markers';if($options.fitMapMaxZoom)
{this.fitMapMaxZoom=$options.fitMapMaxZoom;}
if($options.maxZoomClusterMarkerClickCallback)
{this.maxZoomClusterMarkerClickCallback=$options.maxZoomClusterMarkerClickCallback;}
this.intersectPadding=($options.intersectPadding)?$options.intersectPadding:0;if($options.markers)
{this.addMarkers($options.markers);}
GEvent.bind(this._map,'moveend',this,this._moveEnd);GEvent.bind(this._map,'zoomend',this,this._zoomEnd);GEvent.bind(this._map,'maptypechanged',this,this._mapTypeChanged);}
ClusterMarker.prototype.addMarkers=function($markers)
{var i;if(!$markers[0])
{var $numArray=[];for(i in $markers)
{if(i<$markers.length)
{$numArray.push($markers[i]);}}
$markers=$numArray;}
for(i=$markers.length-1;i>=0;i--)
{$markers[i]._isVisible=false;$markers[i]._isActive=false;$markers[i]._makeVisible=false;}
this._mapMarkers=this._mapMarkers.concat($markers);};ClusterMarker.prototype._clusterMarker=function($clusterGroupIndexes)
{function $newClusterMarker($location,$icon,$title)
{return new GMarker($location,{icon:$icon,title:$title});}
var $clusterGroupBounds=new GLatLngBounds(),i,$clusterMarker,$clusteredMarkers=[],$marker,$this=this;for(i=$clusterGroupIndexes.length-1;i>=0;i--)
{$marker=this._mapMarkers[$clusterGroupIndexes[i]];$marker.index=$clusterGroupIndexes[i];$clusterGroupBounds.extend($marker.getLatLng());$clusteredMarkers.push($marker);}
var icon=null;if(this.clusterMarkerIcon===null)
{var xDimen=this._map.fromLatLngToContainerPixel($clusterGroupBounds.getNorthEast()).x-this._map.fromLatLngToContainerPixel($clusterGroupBounds.getSouthWest()).x;var yDimen=this._map.fromLatLngToContainerPixel($clusterGroupBounds.getSouthWest()).y-this._map.fromLatLngToContainerPixel($clusterGroupBounds.getNorthEast()).y;var dimen=xDimen>yDimen?xDimen:yDimen;if($clusteredMarkers.length>99&&dimen<22)
{dimen=22;}
else if($clusteredMarkers.length>10&&dimen<18)
{dimen=18;}
else if(dimen<16)
{dimen=16;}
var opac='CC';var iconOptions={};iconOptions.width=dimen;iconOptions.height=dimen;iconOptions.primaryColor=this.clusterMarkerIconColor+opac;iconOptions.label=($clusteredMarkers.length).toString();iconOptions.labelSize=($clusteredMarkers.length==2)?12:0;iconOptions.labelColor=this.clusterMarkerIconTextColor;iconOptions.shape="circle";icon=MapIconMaker.createFlatIcon(iconOptions);}
else
{icon=this.clusterMarkerIcon;}
$clusterMarker=$newClusterMarker($clusterGroupBounds.getCenter(),icon,this.clusterMarkerTitle.replace(/%count/gi,$clusterGroupIndexes.length));$clusterMarker.clusterGroupBounds=$clusterGroupBounds;this._eventListeners.push(GEvent.addListener($clusterMarker,'click',function()
{$this.clusterMarkerClick({clusterMarker:$clusterMarker,clusteredMarkers:$clusteredMarkers});}));return $clusterMarker;};ClusterMarker.prototype.clusterMarkerClick=function($args)
{if(this.maxZoomClusterMarkerClickCallback&&this._map.getZoom()>=this._map.getCurrentMapType().getMaximumResolution())
{this.maxZoomClusterMarkerClickCallback($args.clusterMarker);}
else
{this.addPointHistory();this._map.setCenter($args.clusterMarker.getLatLng(),this._map.getBoundsZoomLevel($args.clusterMarker.clusterGroupBounds));}};ClusterMarker.prototype.addPointHistory=function(latlng,zoom)
{latlng=latlng||this._map.getCenter();zoom=zoom||this._map.getZoom();this._pointForwardHistory=[];if(this._pointHistory.length>0&&this._pointHistory.last().latlng.equals(latlng)&&this._pointHistory.last().zoom==zoom)
{return;}
this._pointHistory.push({latlng:latlng,zoom:zoom});};ClusterMarker.prototype.backHistory=function()
{if(this._pointHistory.length>0)
{var history=this._pointHistory.pop();if(history&&(this._pointForwardHistory.length===0||!(this._pointForwardHistory.last().latlng.equals(history.latlng)&&this._pointForwardHistory.last().zoom==history.zoom)))
{this._pointForwardHistory.push({latlng:this._map.getCenter(),zoom:this._map.getZoom()});}
this._map.setCenter(history.latlng,history.zoom);}
return(this._pointHistory.length>0);};ClusterMarker.prototype.forwardHistory=function()
{if(this._pointForwardHistory.length>0)
{var history=this._pointForwardHistory.pop();if(history&&(this._pointHistory.length===0||!(this._pointHistory.last().latlng.equals(history.latlng)&&this._pointHistory.last().zoom==history.zoom)))
{this._pointHistory.push({latlng:this._map.getCenter(),zoom:this._map.getZoom()});}
this._map.setCenter(history.latlng,history.zoom);}
return(this._pointForwardHistory.length>0);};ClusterMarker.prototype.hasBackHistory=function()
{return(this._pointHistory.length>0);};ClusterMarker.prototype.hasForwardHistory=function()
{return(this._pointForwardHistory.length>0);};ClusterMarker.prototype._filterActiveMapMarkers=function()
{var $borderPadding=this.borderPadding,$mapZoomLevel=this._map.getZoom(),$mapProjection=this._map.getCurrentMapType().getProjection(),$mapPointSw,$activeAreaPointSw,$activeAreaLatLngSw,$mapPointNe,$activeAreaPointNe,$activeAreaLatLngNe,$activeAreaBounds=this._map.getBounds(),i,$marker,$uncachedIconBoundsIndexes=[],$oldState;if($borderPadding)
{$mapPointSw=$mapProjection.fromLatLngToPixel($activeAreaBounds.getSouthWest(),$mapZoomLevel);$activeAreaPointSw=new GPoint($mapPointSw.x-$borderPadding,$mapPointSw.y+$borderPadding);$activeAreaLatLngSw=$mapProjection.fromPixelToLatLng($activeAreaPointSw,$mapZoomLevel);$mapPointNe=$mapProjection.fromLatLngToPixel($activeAreaBounds.getNorthEast(),$mapZoomLevel);$activeAreaPointNe=new GPoint($mapPointNe.x+$borderPadding,$mapPointNe.y-$borderPadding);$activeAreaLatLngNe=$mapProjection.fromPixelToLatLng($activeAreaPointNe,$mapZoomLevel);$activeAreaBounds.extend($activeAreaLatLngSw);$activeAreaBounds.extend($activeAreaLatLngNe);}
this._activeMarkersChanged=false;if(typeof(this._iconBounds[$mapZoomLevel])==='undefined')
{this._iconBounds[$mapZoomLevel]=[];this._activeMarkersChanged=true;for(i=this._mapMarkers.length-1;i>=0;i--)
{$marker=this._mapMarkers[i];$marker._isActive=($marker.getLatLng&&$activeAreaBounds.containsLatLng($marker.getLatLng()))?true:false;$marker._makeVisible=$marker._isActive;if($marker._isActive)
{$uncachedIconBoundsIndexes.push(i);}}}else
{for(i=this._mapMarkers.length-1;i>=0;i--)
{$marker=this._mapMarkers[i];$oldState=$marker._isActive;$marker._isActive=$activeAreaBounds.containsLatLng($marker.getLatLng())?true:false;$marker._makeVisible=$marker._isActive;if(!this._activeMarkersChanged&&$oldState!==$marker._isActive)
{this._activeMarkersChanged=true;}
if($marker._isActive&&typeof(this._iconBounds[$mapZoomLevel][i])==='undefined')
{$uncachedIconBoundsIndexes.push(i);}}}
return $uncachedIconBoundsIndexes;};ClusterMarker.prototype._filterIntersectingMapMarkers=function()
{var $clusterGroup,i,j,$mapZoomLevel=this._map.getZoom();for(i=this._mapMarkers.length-1;i>0;i--)
{if(this._mapMarkers[i]._makeVisible)
{$clusterGroup=[];for(j=i-1;j>=0;j--)
{if(this._mapMarkers[j]._makeVisible&&this._iconBounds[$mapZoomLevel][i].intersects(this._iconBounds[$mapZoomLevel][j]))
{$clusterGroup.push(j);}}
if($clusterGroup.length!==0)
{$clusterGroup.push(i);for(j=$clusterGroup.length-1;j>=0;j--)
{this._mapMarkers[$clusterGroup[j]]._makeVisible=false;}
this._clusterMarkers.push(this._clusterMarker($clusterGroup));}}}};ClusterMarker.prototype.fitMapToMarkers=function(){var $markers=this._mapMarkers,$markersBounds=new GLatLngBounds(),i;for(i=$markers.length-1;i>=0;i--)
{$markersBounds.extend($markers[i].getLatLng());}
var $fitMapToMarkersZoom=this._map.getBoundsZoomLevel($markersBounds);if(this.fitMapMaxZoom&&$fitMapToMarkersZoom>this.fitMapMaxZoom)
{$fitMapToMarkersZoom=this.fitMapMaxZoom;}
this._map.setCenter($markersBounds.getCenter(),$fitMapToMarkersZoom);this.refresh();};ClusterMarker.prototype._mapTypeChanged=function(){this.refresh(true);};ClusterMarker.prototype._moveEnd=function()
{if(!this._cancelMoveEnd)
{this.refresh();}
else
{this._cancelMoveEnd=false;}};ClusterMarker.prototype._preCacheIconBounds=function($indexes){var $mapProjection=this._map.getCurrentMapType().getProjection(),$mapZoomLevel=this._map.getZoom(),i,$marker,$iconSize,$iconAnchorPoint,$iconAnchorPointOffset,$iconBoundsPointSw,$iconBoundsPointNe,$iconBoundsLatLngSw,$iconBoundsLatLngNe,$intersectPadding=this.intersectPadding;for(i=$indexes.length-1;i>=0;i--){$marker=this._mapMarkers[$indexes[i]];$iconSize=$marker.getIcon().iconSize;$iconAnchorPoint=$mapProjection.fromLatLngToPixel($marker.getLatLng(),$mapZoomLevel);$iconAnchorPointOffset=$marker.getIcon().iconAnchor;$iconBoundsPointSw=new GPoint($iconAnchorPoint.x-$iconAnchorPointOffset.x-$intersectPadding,$iconAnchorPoint.y-$iconAnchorPointOffset.y+$iconSize.height+$intersectPadding);$iconBoundsPointNe=new GPoint($iconAnchorPoint.x-$iconAnchorPointOffset.x+$iconSize.width+$intersectPadding,$iconAnchorPoint.y-$iconAnchorPointOffset.y-$intersectPadding);$iconBoundsLatLngSw=$mapProjection.fromPixelToLatLng($iconBoundsPointSw,$mapZoomLevel);$iconBoundsLatLngNe=$mapProjection.fromPixelToLatLng($iconBoundsPointNe,$mapZoomLevel);this._iconBounds[$mapZoomLevel][$indexes[i]]=new GLatLngBounds($iconBoundsLatLngSw,$iconBoundsLatLngNe);}};ClusterMarker.prototype.refresh=function($forceFullRefresh)
{var i,$marker,$uncachedIconBoundsIndexes=this._filterActiveMapMarkers();if(this._activeMarkersChanged||$forceFullRefresh)
{this._removeClusterMarkers();if(this.clusteringEnabled)
{if($uncachedIconBoundsIndexes.length>0)
{this._preCacheIconBounds($uncachedIconBoundsIndexes);}
this._filterIntersectingMapMarkers();}
for(i=this._clusterMarkers.length-1;i>=0;i--)
{this._map.addOverlay(this._clusterMarkers[i]);}
for(i=this._mapMarkers.length-1;i>=0;i--)
{$marker=this._mapMarkers[i];if(!$marker._isVisible&&$marker._makeVisible)
{this._map.addOverlay($marker);$marker._isVisible=true;}
if($marker._isVisible&&!$marker._makeVisible)
{this._map.removeOverlay($marker);$marker._isVisible=false;}}}};ClusterMarker.prototype._removeClusterMarkers=function()
{for(var i=this._clusterMarkers.length-1;i>=0;i--)
{this._map.removeOverlay(this._clusterMarkers[i]);}
for(i=this._eventListeners.length-1;i>=0;i--)
{GEvent.removeListener(this._eventListeners[i]);}
this._clusterMarkers=[];this._eventListeners=[];};ClusterMarker.prototype.removeMarkers=function()
{for(var i=this._mapMarkers.length-1;i>=0;i--)
{if(this._mapMarkers[i]._isVisible)
{this._map.removeOverlay(this._mapMarkers[i]);}
delete this._mapMarkers[i]._isVisible;delete this._mapMarkers[i]._isActive;delete this._mapMarkers[i]._makeVisible;}
this._removeClusterMarkers();this._mapMarkers=[];this._iconBounds=[];};ClusterMarker.prototype.triggerClick=function($index)
{var $marker=this._mapMarkers[$index];if($marker._isVisible)
{GEvent.trigger($marker,'click');}
else if($marker._isActive)
{this._map.setCenter($marker.getLatLng());this._map.zoomIn();this.triggerClick($index);}
else
{this._map.setCenter($marker.getLatLng());this.triggerClick($index);}};ClusterMarker.prototype._zoomEnd=function(){this._cancelMoveEnd=true;this.refresh(true);};function EInsert(point,image,size,basezoom,zindex,minzoom,maxzoom){this.point=point;this.image=image;this.size=size;this.basezoom=basezoom;this.minzoom=minzoom||-1;this.maxzoom=maxzoom||999;this.zindex=zindex||0;var agent=navigator.userAgent.toLowerCase();if((agent.indexOf("msie")>-1)&&(agent.indexOf("opera")<1)){this.ie=true}else{this.ie=false}}
window.setupEInsertControl=function()
{if(!window.GOverlay)return;EInsert.prototype=new GOverlay();EInsert.prototype.initialize=function(map){var div=document.createElement("div");div.style.position="absolute";div.style.zIndex=this.zindex;if(this.zindex<0){map.getPane(G_MAP_MAP_PANE).appendChild(div);}else{map.getPane(1).appendChild(div);}
this.map_=$(map);this.div_=$(div);};EInsert.prototype.makeDraggable=function(){this.dragZoom_=map.getZoom();this.dragObject=new GDraggableObject(this.div_);this.dragObject.parent=this;GEvent.addListener(this.dragObject,"dragstart",function(){this.parent.left=this.left;this.parent.top=this.top;});GEvent.addListener(this.dragObject,"dragend",function(){var pixels=this.parent.map_.fromLatLngToDivPixel(this.parent.point);var newpixels=new GPoint(pixels.x+this.left-this.parent.left,pixels.y+this.top-this.parent.top);this.parent.point=this.parent.map_.fromDivPixelToLatLng(newpixels);this.parent.redraw(true);GEvent.trigger(this.parent,"dragend",this.parent.point);});};EInsert.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_);};EInsert.prototype.copy=function(){return new EInsert(this.point,this.image,this.size,this.basezoom);};EInsert.prototype.redraw=function(force){if(force){var z=this.map_.getZoom();if(z<this.minzoom||z>this.maxzoom)
{this.div_.hide();return;}
this.div_.show();var scale=Math.pow(2,(z-this.basezoom));var p=this.map_.fromLatLngToDivPixel(this.point);var h=this.size.height*scale;var w=this.size.width*scale;this.div_.style.left=(p.x-w/2)+"px";this.div_.style.top=(p.y-h/2)+"px";if(this.ie){var loader="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.image+"', sizingMethod='scale');";this.div_.innerHTML='<div style="height:'+h+'px; width:'+w+'px; '+loader+'" ></div>';}else{this.div_.innerHTML='<img src="'+this.image+'"  width='+w+' height='+h+' >';}
if(this.dragObject){if(z!=this.dragZoom_){this.dragObject.disable();}}}};EInsert.prototype.show=function(){this.div_.style.display="";};EInsert.prototype.hide=function(){this.div_.style.display="none";};};if(window.google)
google.setOnLoadCallback(setupEInsertControl);var Scroller=Class.create();Scroller.ids=new Object();Scroller.i=0;Scroller.prototype={initialize:function(el){this.outerBox=el;this.decorate();},decorate:function(){$(this.outerBox).makePositioned();Scroller.i=Scroller.i+1;this.myIndex=Scroller.i;this.innerBox=document.createElement("DIV");this.innerBox.className="scroll-innerBox";$(this.innerBox).makePositioned();this.innerBox.style.cssFloat=this.innerBox.style.styleFloat='left';this.innerBox.id="scroll-innerBox-"+Scroller.i;this.innerBox.style.top="0px";while(this.outerBox.hasChildNodes()){this.innerBox.appendChild(this.outerBox.firstChild);}
this.innerBox.style.overflow="hidden";this.outerBox.style.overflow="hidden";this.track=document.createElement('div');this.track.className="scroll-track";$(this.track).makePositioned();this.track.style.cssFloat=this.track.style.styleFloat='left';this.track.id="scroll-track-"+Scroller.i;this.track.appendChild(document.createComment(''));this.tracktop=document.createElement('div');this.tracktop.className="scroll-track-top";$(this.tracktop).makePositioned();this.tracktop.style.cssFloat=this.tracktop.style.styleFloat='left';this.tracktop.id="scroll-track-top-"+Scroller.i;this.tracktop.appendChild(document.createComment(''));this.trackbot=document.createElement('div');this.trackbot.className="scroll-track-bot";$(this.trackbot).makePositioned();this.trackbot.style.cssFloat=this.trackbot.style.styleFloat='left';this.trackbot.id="scroll-track-bot-"+Scroller.i;this.trackbot.appendChild(document.createComment(''));this.handle=document.createElement('div');this.handle.className="scroll-handle-container";this.handle.id="scroll-handle-container"+Scroller.i;this.handle_middle=document.createElement('div');this.handle_middle.className="scroll-handle";$(this.handle_middle).makePositioned();this.handle_middle.id="scroll-handle-"+Scroller.i;this.handle_middle.appendChild(document.createComment(''));this.handletop=document.createElement('div');this.handletop.className="scroll-handle-top";$(this.handletop).makePositioned();this.handletop.id="scroll-handle-top-"+Scroller.i;this.handletop.appendChild(document.createComment(''));this.handlebot=document.createElement('div');this.handlebot.className="scroll-handle-bot";$(this.handlebot).makePositioned();this.handlebot.id="scroll-handle-bot-"+Scroller.i;this.handlebot.appendChild(document.createComment(''));this.track.hide();this.tracktop.hide();this.trackbot.hide();this.outerBox.appendChild(this.innerBox);this.outerBox.appendChild(this.tracktop);this.handle.appendChild(this.handletop);this.handle.appendChild(this.handle_middle);this.handle.appendChild(this.handlebot);this.track.appendChild(this.handle);this.outerBox.appendChild(this.track);this.outerBox.appendChild(this.trackbot);this.slider=new Control.Slider($(this.handle).id,$(this.track).id,{axis:'vertical',minimum:0,maximum:$(this.outerBox).clientHeight});this.slider.options.onSlide=this.slider.options.onChange=this.onChange.bind(this);setTimeout(this.resetScrollbar.bind(this,false),10);this.domMouseCB=this.MouseWheelEvent.bindAsEventListener(this,this.slider);this.mouseWheelCB=this.MouseWheelEvent.bindAsEventListener(this,this.slider);this.trackTopCB=this.tracktopEvent.bindAsEventListener(this,this.slider);this.trackBotCB=this.trackbotEvent.bindAsEventListener(this,this.slider);$(this.outerBox).observe('DOMMouseScroll',this.domMouseCB);$(this.outerBox).observe('mousewheel',this.mouseWheelCB);$(this.tracktop).observe('mousedown',this.trackTopCB);$(this.trackbot).observe('mousedown',this.trackBotCB);},release:function(){$(this.outerBox).stopObserving('DOMMouseScroll',this.domMouseCB);$(this.outerBox).stopObserving('mousewheel',this.mouseWheelCB);$(this.tracktop).stopObserving('mousedown',this.trackTopCB);$(this.trackbot).stopObserving('mousedown',this.trackBotCB);},resetScrollbar:function(repeat){this.track.hide();this.tracktop.hide();this.trackbot.hide();this.enableScroll=false;this.innerHeight=$(this.outerBox).clientHeight;this.innerBox.style.height=this.innerHeight+"px";var newWidth=$(this.outerBox).clientWidth;var tth=Element.getStyle(this.tracktop,"height");if(tth)
tth=tth.replace("px","");else
tth=0;var hth=Element.getStyle(this.handletop,"height");if(hth)
hth=hth.replace("px","");else
hth=0;if(this.innerHeight<this.innerBox.scrollHeight){this.viewportHeight=this.innerHeight-tth*2;this.slider.trackLength=this.viewportHeight;this.track.style.height=this.viewportHeight+"px";this.handleHeight=Math.round(this.viewportHeight*this.innerHeight/this.innerBox.scrollHeight);if(this.handleHeight<(hth*2))
this.handleHeight=(hth*2);if(this.handleHeight<10)
this.handleHeight=10;this.handle.style.height=this.handleHeight+"px";this.handle_middle.style.height=this.handleHeight-hth*2+"px";this.handletop.style.height=hth+"px";this.slider.handleLength=this.handleHeight;this.track.style.display='inline';this.tracktop.style.display='inline';this.trackbot.style.display='inline';this.ieDecreaseBy=1;if(this.outerBox.currentStyle){var borderWidth=this.outerBox.currentStyle["borderWidth"].replace("px","");if(!isNaN(borderWidth)){this.ieDecreaseBy=(borderWidth)*2;}}
newWidth=($(this.outerBox).clientWidth-$(this.track).clientWidth-this.ieDecreaseBy);this.enableScroll=true;}
this.innerBox.style.width=newWidth+"px";if(repeat){setTimeout(this.resetScrollbar.bind(this,false),10);}},MouseWheelEvent:function(event,slider){var delta=0;if(!event)
event=window.event;if(event.wheelDelta){delta=event.wheelDelta/120;}else if(event.detail){delta=-event.detail/3;}
if(delta)
slider.setValueBy(-delta/10);Event.stop(event);},trackbotEvent:function(event,slider){if(Event.isLeftClick(event)){slider.setValueBy(0.2);Event.stop(event);}},tracktopEvent:function(event,slider){if(Event.isLeftClick(event)){slider.setValueBy(-0.2);Event.stop(event);}},onChange:function(val){if(this.enableScroll)
this.innerBox.scrollTop=Math.round(val*(this.innerBox.scrollHeight-this.innerBox.offsetHeight));}}
Scroller.setAll=function(){$$('.makeScroll').each(function(item){Scroller.ids[item.id]=new Scroller(item);});}
Scroller.reset=function(body_id){if($(body_id).className.match(new RegExp("(^|\\s)makeScroll(\\s|$)"))){if(Scroller.ids[body_id])
Scroller.ids[body_id].release();Scroller.ids[body_id]=new Scroller($(body_id));}}
Scroller.updateAll=function(){$H(Scroller.ids).each(function(pair){Scroller.ids[pair.key].resetScrollbar(true);});}
Event.observe(window,"load",Scroller.setAll);Event.observe(window,"resize",Scroller.updateAll);if(!Control)var Control={};Control.Slider=Class.create();Control.Slider.prototype={initialize:function(handle,track,options){var slider=this;if(handle instanceof Array){this.handles=handle.collect(function(e){return $(e)});}else{this.handles=[$(handle)];}
this.track=$(track);this.options=options||{};this.axis=this.options.axis||'horizontal';this.increment=this.options.increment||1;this.step=parseInt(this.options.step||'1');this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(s){return $(s)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||'0');this.alignY=parseInt(this.options.alignY||'0');this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled)this.setDisabled();this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max();}
this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(h,i){i=slider.handles.length-1-i;slider.setValue(parseFloat((slider.options.sliderValue instanceof Array?slider.options.sliderValue[i]:slider.options.sliderValue)||slider.range.start),i);Element.makePositioned(h);Event.observe(h,"mousedown",slider.eventMouseDown);});Event.observe(this.track,"mousedown",this.eventMouseDown);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);this.initialized=true;},dispose:function(){var slider=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(h){Event.stopObserving(h,"mousedown",slider.eventMouseDown);});},setDisabled:function(){this.disabled=true;},setEnabled:function(){this.disabled=false;},getNearestValue:function(value){if(this.allowedValues){if(value>=this.allowedValues.max())return(this.allowedValues.max());if(value<=this.allowedValues.min())return(this.allowedValues.min());var offset=Math.abs(this.allowedValues[0]-value);var newValue=this.allowedValues[0];this.allowedValues.each(function(v){var currentOffset=Math.abs(v-value);if(currentOffset<=offset){newValue=v;offset=currentOffset;}});return newValue;}
if(value>this.range.end)return this.range.end;if(value<this.range.start)return this.range.start;return value;},setValue:function(sliderValue,handleIdx){if(!this.active){this.activeHandleIdx=handleIdx||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles();}
handleIdx=handleIdx||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((handleIdx>0)&&(sliderValue<this.values[handleIdx-1]))
sliderValue=this.values[handleIdx-1];if((handleIdx<(this.handles.length-1))&&(sliderValue>this.values[handleIdx+1]))
sliderValue=this.values[handleIdx+1];}
sliderValue=this.getNearestValue(sliderValue);this.values[handleIdx]=sliderValue;this.value=this.values[0];this.handles[handleIdx].style[this.isVertical()?'top':'left']=this.translateToPx(sliderValue);this.drawSpans();if(!this.dragging||!this.event)this.updateFinished();},setValueBy:function(delta,handleIdx){this.setValue(this.values[handleIdx||this.activeHandleIdx||0]+delta,handleIdx||this.activeHandleIdx||0);},translateToPx:function(value){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(value-this.range.start))+"px";},translateToValue:function(offset){return((offset/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start);},getRange:function(range){var v=this.values.sortBy(Prototype.K);range=range||0;return $R(v[range],v[range+1]);},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX);},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignY);},isVertical:function(){return(this.axis=='vertical');},drawSpans:function(){var slider=this;if(this.spans)
$R(0,this.spans.length-1).each(function(r){slider.setSpan(slider.spans[r],slider.getRange(r))});if(this.options.startSpan)
this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value));if(this.options.endSpan)
this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum));},setSpan:function(span,range){if(this.isVertical()){span.style.top=this.translateToPx(range.start);span.style.height=this.translateToPx(range.end-range.start+this.range.start);}else{span.style.left=this.translateToPx(range.start);span.style.width=this.translateToPx(range.end-range.start+this.range.start);}},updateStyles:function(){this.handles.each(function(h){Element.removeClassName(h,'selected')});Element.addClassName(this.activeHandle,'selected');},startDrag:function(event){if(Event.isLeftClick(event)){if(!this.disabled){this.active=true;var handle=Event.element(event);var pointer=[Event.pointerX(event),Event.pointerY(event)];var track=handle;if(track==this.track){var offsets=Position.cumulativeOffset(this.track);this.event=event;this.setValue(this.translateToValue((this.isVertical()?pointer[1]-offsets[1]:pointer[0]-offsets[0])-(this.handleLength/2)));var offsets=Position.cumulativeOffset(this.activeHandle);this.offsetX=(pointer[0]-offsets[0]);this.offsetY=(pointer[1]-offsets[1]);}else{while((this.handles.indexOf(handle)==-1)&&handle.parentNode)
handle=handle.parentNode;this.activeHandle=handle;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var offsets=Position.cumulativeOffset(this.activeHandle);this.offsetX=(pointer[0]-offsets[0]);this.offsetY=(pointer[1]-offsets[1]);}}
Event.stop(event);}},update:function(event){if(this.active){if(!this.dragging)this.dragging=true;this.draw(event);if(navigator.appVersion.indexOf('AppleWebKit')>0)window.scrollBy(0,0);Event.stop(event);}},draw:function(event){var pointer=[Event.pointerX(event),Event.pointerY(event)];var offsets=Position.cumulativeOffset(this.track);pointer[0]-=this.offsetX+offsets[0];pointer[1]-=this.offsetY+offsets[1];this.event=event;this.setValue(this.translateToValue(this.isVertical()?pointer[1]:pointer[0]));if(this.initialized&&this.options.onSlide)
this.options.onSlide(this.values.length>1?this.values:this.value,this);},endDrag:function(event){if(this.active&&this.dragging){this.finishDrag(event,true);Event.stop(event);}
this.active=false;this.dragging=false;},finishDrag:function(event,success){this.active=false;this.dragging=false;this.updateFinished();},updateFinished:function(){if(this.initialized&&this.options.onChange)
this.options.onChange(this.values.length>1?this.values:this.value,this);this.event=null;}}
if(!window.euEnv)
var euEnv=new Array();euEnv.Kost=new Array();euEnv.Kost.num=0;euEnv.Kost.next=function(){return this.num++;}
euEnv.euDockArray=new Array();euEnv.refreshTime=35;euEnv.exeThread=true;euEnv.exeThreadWhiteLoop=0;euEnv.x=0;euEnv.y=0;euEnv.mouseMoved=false;var euUP=1;var euDOWN=2;var euLEFT=3;var euRIGHT=4;var euICON=5;var euMOUSE=6;var euSCREEN=7;var euOBJECT=8;var euABSOLUTE=9;var euRELATIVE=10;var euHORIZONTAL=11;var euVERTICAL=12;var euCENTER=13;var euTRANSPARENT=14;var euFIXED=15;var euOPAQUE=16;function euIdObjTop(euObj){var ret=euObj.offsetTop;while((euObj=euObj.offsetParent)!=null)
ret+=euObj.offsetTop;return ret;};function euIdObjLeft(euObj){var ret=euObj.offsetLeft;while((euObj=euObj.offsetParent)!=null)
ret+=euObj.offsetLeft;return ret;};function isEuInside(euObj,x,y){var euTop=euIdObjTop(euObj);var euLeft=euIdObjLeft(euObj);return((euTop<=y&&(euTop+euObj.offsetHeight)>=y)&&(euLeft<=x&&(euLeft+euObj.offsetWidth)>=x));};function euDimensioni(){if(typeof(window.innerWidth)=='number'){euEnv.euFrameWidth=window.innerWidth-16;euEnv.euFrameHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){euEnv.euFrameWidth=document.documentElement.clientWidth-16;euEnv.euFrameHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){euEnv.euFrameWidth=document.body.clientWidth;euEnv.euFrameHeight=document.body.clientHeight;}};function offsEut(){euEnv.euScrOfY=0;euEnv.euScrOfX=0;if(typeof(window.pageYoffsEut)=='number'){euEnv.euScrOfY=window.pageYoffsEut;euEnv.euScrOfX=window.pageXoffsEut;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){euEnv.euScrOfY=document.body.scrollTop;euEnv.euScrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){euEnv.euScrOfY=document.documentElement.scrollTop;euEnv.euScrOfX=document.documentElement.scrollLeft;}};function euKostFunc30(x){return 0.3;};function euKostFunc100(x){return 1;};function euLinear(x){return x;};function euLinear30(x){return 1*(x+(1-x)*0.3);};function euLinear20(x){return x+(1-x)*0.2;};function euExp30(x){return euLinear30(x*x*x);};function euLinear50(x){return x+(1-x)*0.5;};function euHarmonic(x){return euLinear30((1-Math.cos(Math.PI*x))/2);};function euSemiHarmonic(x){return euLinear30(Math.cos(Math.PI*(1-x)/2));};function euDock(){this.id='euDock_'+euEnv.Kost.next();document.write("<div id='"+this.id+"_bar' style='z-index:1000;position:absolute;border:0px solid black;'></div>");document.write("<div onMouseOut='euEnv.euDockArray."+this.id+".mouseOut();' onMouseOver='euEnv.euDockArray."+this.id+".mouseOver();' id='"+this.id+"' style='z-index:1000;position:absolute;border:0px solid black; cursor: pointer;'></div>");this.div=document.getElementById(this.id);this.divBar=document.getElementById(this.id+"_bar");this.iconsArray=new Array();this.isInside=false;euEnv.euDockArray[this.id]=this;this.bar=null;this.mouseX=0;this.mouseY=0;this.centerPosX=0;this.centerPosY=0;this.offset=0;this.iconOffset=0;this.venusHillSize=3;this.venusHillTrans=euLinear;this.position=euUP;this.align=euSCREEN;this.objectAlign=euDOWN;this.idObjectHook;this.animaition=euICON;this.animFading=euABSOLUTE;this.setIconsOffset=function(offset){this.iconOffset=offset;};this.setAnimation=function(anim,size){this.animaition=anim;this.venusHillSize=size;};this.setPointAlign=function(x,y,pos){this.offset=0;this.align=euABSOLUTE;this.position=pos;this.setCenterPos(x,y);}
this.setObjectAlign=function(idObj,align,offset,pos){this.offset=offset;this.align=euOBJECT;this.objectAlign=align;this.position=pos;this.idObjectHook=document.getElementById(idObj);this.setObjectCoord();};this.setObjectCoord=function(){if(this.objectAlign==euDOWN)
this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2),euIdObjTop(this.idObjectHook)+this.idObjectHook.offsetHeight+this.offset);else if(this.objectAlign==euUP)
this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2),euIdObjTop(this.idObjectHook)-this.offset);else if(this.objectAlign==euLEFT)
this.setCenterPos(euIdObjLeft(this.idObjectHook)-this.offset,euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2));else if(this.objectAlign==euRIGHT)
this.setCenterPos(euIdObjLeft(this.idObjectHook)+this.idObjectHook.offsetWidth+this.offset,euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2));else if(this.objectAlign==euCENTER){if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL)
this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2),euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2)-this.offset);else
this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2)+this.offset,euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2));}};this.setScreenAlign=function(align,offset){this.offset=offset;this.align=euSCREEN;if(align==euUP)
this.position=euDOWN;else if(align==euDOWN)
this.position=euUP;else if(align==euLEFT)
this.position=euRIGHT;else if(align==euRIGHT)
this.position=euLEFT;this.setScreenCoord();};this.setScreenCoord=function(){euDimensioni();offsEut();if(this.position==euDOWN)
this.setCenterPos(euEnv.euScrOfX+euEnv.euFrameWidth/2,euEnv.euScrOfY+this.offset);else if(this.position==euUP)
this.setCenterPos(euEnv.euScrOfX+euEnv.euFrameWidth/2,euEnv.euScrOfY+euEnv.euFrameHeight-this.offset);else if(this.position==euRIGHT)
this.setCenterPos(euEnv.euScrOfX+this.offset,euEnv.euScrOfY+euEnv.euFrameHeight/2);else if(this.position==euLEFT)
this.setCenterPos(euEnv.euScrOfX+euEnv.euFrameWidth-this.offset,euEnv.euScrOfY+euEnv.euFrameHeight/2);};this.refreshDiv=function(){if(this.position==euDOWN){this.setPos(this.centerPosX-this.getWidth()/2,this.centerPosY+this.iconOffset);}else if(this.position==euUP){this.setPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.getHeight()-this.iconOffset);}else if(this.position==euRIGHT){this.setPos(this.centerPosX+this.iconOffset,this.centerPosY-this.getHeight()/2);}else if(this.position==euLEFT){this.setPos(this.centerPosX-this.getWidth()-this.iconOffset,this.centerPosY-this.getHeight()/2);}else if(this.position==euHORIZONTAL){this.setPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.getHeight()/2+this.iconOffset);}else if(this.position==euVERTICAL){this.setPos(this.centerPosX-this.getWidth()/2+this.iconOffset,this.centerPosY-this.getHeight()/2);}
if(this.bar){if(this.position==euDOWN){this.setBarPos(this.centerPosX-this.getWidth()/2,this.centerPosY);}else if(this.position==euUP){this.setBarPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.bar.getSize());}else if(this.position==euRIGHT){this.setBarPos(this.centerPosX,this.centerPosY-this.getHeight()/2);}else if(this.position==euLEFT){this.setBarPos(this.centerPosX-this.bar.getSize(),this.centerPosY-this.getHeight()/2);}else if(this.position==euHORIZONTAL){this.setBarPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.bar.getSize()/2);}else if(this.position==euVERTICAL){this.setBarPos(this.centerPosX-this.bar.getSize()/2,this.centerPosY-this.getHeight()/2);}}}
this.riposition=function(){if(this.align==euSCREEN)
this.setScreenCoord();else if(this.align==euOBJECT)
this.setObjectCoord();};this.setCenterPos=function(x,y){this.centerPosX=x;this.centerPosY=y;this.refreshDiv();};this.setPos=function(x,y){this.setPosX(x);this.setPosY(y);};this.setBarPos=function(x,y){this.setBarPosX(x);this.setBarPosY(y);};this.setDim=function(w,h){this.setWidth(w);this.setHeight(h);};this.setBarPosX=function(x){document.getElementById(this.id+"_bar").style.left=x+'px';};this.setBarPosY=function(y){document.getElementById(this.id+"_bar").style.top=y+'px';};this.getPosX=function(){return document.getElementById(this.id).style.left.replace(/[^0-9]/g,"");};this.setPosX=function(x){document.getElementById(this.id).style.left=x+'px';};this.getPosY=function(){return document.getElementById(this.id).style.top.replace(/[^0-9]/g,"");};this.setPosY=function(y){document.getElementById(this.id).style.top=y+'px';};this.getWidth=function(){return document.getElementById(this.id).style.width.replace(/[^0-9]/g,"");};this.setWidth=function(w){document.getElementById(this.id).style.width=Math.round(w)+'px';};this.getHeight=function(){return document.getElementById(this.id).style.height.replace(/[^0-9]/g,"");};this.setHeight=function(h){document.getElementById(this.id).style.height=Math.round(h)+'px';};this.getVenusWidth=function(){return this.venusHillSize*this.getWidth();};this.getVenusHeight=function(){return this.venusHillSize*this.getHeight();};this.getMouseRelativeX=function(){return this.mouseX-euIdObjLeft(this.div);};this.getMouseRelativeY=function(){return this.mouseY-euIdObjTop(this.div);};this.updateDims=function(){var bakWidth=0;var bakHeight=0;for(var i in this.iconsArray)if(this.iconsArray[i].id){if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL){bakWidth+=this.iconsArray[i].getWidth();bakHeight=(this.iconsArray[i].getHeight()>bakHeight)?this.iconsArray[i].getHeight():bakHeight;bakHeight=Math.round(bakHeight);}else{bakHeight+=this.iconsArray[i].getHeight();bakWidth=(this.iconsArray[i].getWidth()>bakWidth)?this.iconsArray[i].getWidth():bakWidth;bakWidth=Math.round(bakWidth);}}
if(this.bar){if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL)
this.bar.setProperties(bakWidth,this.position)
else
this.bar.setProperties(bakHeight,this.position)
this.bar.refresh();}
var posx=0;var posy=0;var updPosX=0;var updPosY=0;for(var i in this.iconsArray)if(this.iconsArray[i].id){if(this.position==euDOWN){updPosX=posx;updPosY=posy;posx+=this.iconsArray[i].getWidth();}else if(this.position==euUP){updPosX=posx;updPosY=bakHeight-this.iconsArray[i].getHeight();posx+=this.iconsArray[i].getWidth();}else if(this.position==euRIGHT){updPosX=posx;updPosY=posy;posy+=this.iconsArray[i].getHeight();}else if(this.position==euLEFT){updPosX=bakWidth-this.iconsArray[i].getWidth();updPosY=posy;posy+=this.iconsArray[i].getHeight();}else if(this.position==euHORIZONTAL){updPosX=posx;updPosY=(bakHeight-this.iconsArray[i].getHeight())/2;posx+=this.iconsArray[i].getWidth();}else if(this.position==euVERTICAL){updPosX=(bakWidth-this.iconsArray[i].getWidth())/2;updPosY=posy;posy+=this.iconsArray[i].getHeight();}
this.iconsArray[i].setPos(updPosX,updPosY);this.iconsArray[i].refresh();}
this.setDim(bakWidth,bakHeight);this.refreshDiv();};this.kernel=function(){if(this.isInside)
return this.kernelMouseOver();else
return this.kernelMouseOut();};this.kernelMouseOver=function(){var ret=false;var overI=-1;var mouseRelX=this.getMouseRelativeX();var mouseRelY=this.getMouseRelativeY();var mediana;var border;var frameTo;var venusWidth;var venusHeight;var overIcon;if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL){venusWidth=this.getVenusWidth();for(var i in this.iconsArray)if(this.iconsArray[i].id)
if(this.iconsArray[i].isInsideX(mouseRelX)){overIcon=i;border=this.iconsArray[i].getWidth()/2;if(this.animaition==euICON){mouseRelX=this.iconsArray[i].posX+border;border=0;}}
for(var i in this.iconsArray)if(this.iconsArray[i].id){mediana=this.iconsArray[i].posX+this.iconsArray[i].getWidth()/2;if(Math.abs(mediana-mouseRelX)<=border)
mediana=mouseRelX;else if(mediana<mouseRelX)
mediana+=this.iconsArray[i].getWidth()/2;else if(mediana>mouseRelX)
mediana-=this.iconsArray[i].getWidth()/2;if(this.animaition==euICON&&Math.abs(i-overIcon)<=this.venusHillSize)
frameTo=this.venusHillTrans(1-Math.abs(i-overIcon)/this.venusHillSize);else if(this.animaition==euMOUSE&&Math.abs(mediana-mouseRelX)<=venusWidth)
frameTo=this.venusHillTrans(1-Math.abs(mediana-mouseRelX)/venusWidth);else
frameTo=0;if(frameTo==0||frameTo==1||Math.abs(frameTo-this.iconsArray[i].frame)>0.01)
ret|=this.iconsArray[i].setFrameTo(frameTo);if(this.animFading==euABSOLUTE)
if(this.iconsArray[i].isInsideX(mouseRelX))
ret|=this.iconsArray[i].setFadingTo(1);else
ret|=this.iconsArray[i].setFadingTo(0);else
ret|=this.iconsArray[i].setFadingTo(frameTo);}}else{venusHeight=this.getVenusHeight();for(var i in this.iconsArray)if(this.iconsArray[i].id)
if(this.iconsArray[i].isInsideY(mouseRelY)){overIcon=i;border=this.iconsArray[i].getHeight()/2;if(this.animaition==euICON){mouseRelY=this.iconsArray[i].posY+border;border=0;}}
for(var i in this.iconsArray)if(this.iconsArray[i].id){mediana=this.iconsArray[i].posY+this.iconsArray[i].getHeight()/2;if(Math.abs(mediana-mouseRelY)<=border)
mediana=mouseRelY;else if(mediana<mouseRelY)
mediana+=this.iconsArray[i].getHeight()/2;else if(mediana>mouseRelY)
mediana-=this.iconsArray[i].getHeight()/2;if(this.animaition==euICON&&Math.abs(i-overIcon)<=this.venusHillSize)
frameTo=this.venusHillTrans(1-Math.abs(i-overIcon)/this.venusHillSize);else if(this.animaition==euMOUSE&&Math.abs(mediana-mouseRelY)<=venusHeight)
frameTo=this.venusHillTrans(1-Math.abs(mediana-mouseRelY)/venusHeight);else
frameTo=0;if(frameTo==0||frameTo==1||Math.abs(frameTo-this.iconsArray[i].frame)>0.01)
ret|=this.iconsArray[i].setFrameTo(frameTo);if(this.animFading==euABSOLUTE)
if(this.iconsArray[i].isInsideY(mouseRelY))
ret|=this.iconsArray[i].setFadingTo(1);else
ret|=this.iconsArray[i].setFadingTo(0);else
ret|=this.iconsArray[i].setFadingTo(frameTo);}}
if(ret)
this.updateDims();return ret;};this.kernelMouseOut=function(){var ret=false;for(var i in this.iconsArray)if(this.iconsArray[i].id)
ret|=this.iconsArray[i].setAllFrameTo(0);if(ret)
this.updateDims();return ret;};this.mouseOut=function(){this.isInside=false;euEnv.exeThreadWhiteLoop=5;};this.mouseOver=function(){this.isInside=true;euEnv.exeThreadWhiteLoop=5;};this.mouseMove=function(x,y){var inside=isEuInside(this.div,x,y);var ret=(this.mouseX!=x||this.mouseY!=y)&&inside;this.mouseX=x;this.mouseY=y;if(inside!=this.isInside){this.isInside=inside;ret=true;}
for(var i in this.iconsArray)if(this.iconsArray[i].id)
ret|=this.iconsArray[i].isRunning();return ret;};this.iconParams=new Array();this.setAllFrameStep=function(step){this.iconParams.frameStep=step;for(var i in this.iconsArray)if(this.iconsArray[i].id)
this.iconsArray[i].frameStep=step;};this.setAllZoomFunc=function(func){this.setAllZoomFuncW(func);this.setAllZoomFuncH(func);};this.setAllZoomFuncW=function(func){this.iconParams.zoomFuncW=func;for(var i in this.iconsArray)if(this.iconsArray[i].id)
this.iconsArray[i].zoomFuncW=func;};this.setAllZoomFuncH=function(func){this.iconParams.zoomFuncH=func;for(var i in this.iconsArray)if(this.iconsArray[i].id)
this.iconsArray[i].zoomFuncH=func;};this.setBar=function(args){var id='euDock_bar_'+euEnv.Kost.next();euEnv.euDockArray[id]=new euDockBar(id,this);euEnv.euDockArray[id].setElements(args);this.bar=euEnv.euDockArray[id];return euEnv.euDockArray[id];};this.addIcon=function(args,params){var id='euDock_icon_'+euEnv.Kost.next();euEnv.euDockArray[id]=new euDockIcon(id,this);euEnv.euDockArray[id].addElement(args);this.iconsArray.push(euEnv.euDockArray[id]);for(i in this.iconParams)
euEnv.euDockArray[id][i]=this.iconParams[i];for(i in params)
euEnv.euDockArray[id][i]=params[i];return euEnv.euDockArray[id];};this.delIcon=function(elem){euEnv.euDockArray.splice(elem);euEnv.euDockArray[elem.id]=0;for(var i in this.iconsArray)if(this.iconsArray[i]==elem)
this.iconsArray.splice(i,1);for(var i=0;i<elem.elementsArray.length;i++)
{euEnv.euDockArray[elem.elementsArray[i].id]=0;if(elem.elementsArray[i].object)
{$(elem.elementsArray[i].object.id).remove();}
$(elem.elementsArray[i].id).remove();}
elem=null;this.updateDims();};};function euDockIcon(id,dock){this.id=id;this.parentDock=dock;this.elementsArray;this.zoomFuncW=euLinear30;this.zoomFuncH=euLinear30;this.posX=0;this.posY=0;this.width=0;this.height=0;this.frame=0;this.frameStep=0.5;this.fadingFrame=0;this.fadingStep=1;this.fadingType=euTRANSPARENT;this.loaded=false;this.runningFrame=false;this.runningFading=false;this.updateDims=function(){if(!this.loaded)return;for(var i=0;i<this.elementsArray.length;i++)
this.elementsArray[i].setProperties(this.posX,this.posY,this.getWidth(),this.getHeight());};this.updateFading=function(){if(!this.loaded)return;var stato=this.fadingFrame*(this.elementsArray.length-1);var prev=Math.floor(stato);var next=Math.ceil(stato);var fading=0;for(var i=0;i<this.elementsArray.length;i++){if(this.fadingType==euFIXED){if(i==next)
fading=100-100*(i-stato);else if(i<next)
fading=100;else
fading=0;}else{if(i==next)
fading=100-100*(i-stato);else if(i==prev){if(this.fadingType==euTRANSPARENT)
fading=100-100*(stato-i);else
fading=100;}else
fading=0;}
this.elementsArray[i].setFading(fading);}};this.refresh=function(){this.updateDims();this.updateFading();};this.isAbsoluteInside=function(x,y){x-=this.getAbsolutePosX();y-=this.getAbsolutePosY();return x>0&&y>0&&x<this.getWidth()&&y<this.getHeight();};this.isInside=function(x,y){return this.isInsideX(x)&&this.isInsideY(y);};this.isInsideX=function(x){return(this.loaded&&(this.posX<=x)&&((this.posX+this.getWidth())>=x));};this.isInsideY=function(y){return(this.loaded&&(this.posY<=y)&&((this.posY+this.getHeight())>=y));};this.retrieveLoadingDims=function(elem,num){if(elem.onLoadPrev)
elem.onLoadPrev();if(num==0&&!this.loaded)
{var h=elem.getHeight();var w=elem.getWidth();if(h==0)h=80;if(w==0)w=100;this.setDim(w,h);}
elem.loaded=true;var ret=true;for(var i in this.elementsArray)if(this.elementsArray[i].id)
ret&=this.elementsArray[i].loaded
this.loaded=ret;if(this.loaded){this.parentDock.updateDims();for(var i in this.elementsArray)if(this.elementsArray[i].id)
this.elementsArray[i].show();}
if(elem.onLoadNext)
elem.onLoadNext();};this.setPos=function(x,y){this.posX=x;this.posY=y;};this.setDim=function(w,h){if(this.width==0)
this.width=w;if(this.height==0)
this.height=h;};this.getAbsolutePosX=function(){return euIdObjLeft(this.parentDock.div)+this.posX;};this.getAbsolutePosY=function(){return euIdObjTop(this.parentDock.div)+this.posY;};this.setPosX=function(x){this.posX=x;};this.setPosY=function(y){this.posY=y;};this.getWidth=function(){if(!this.loaded)return 0;return this.width*this.zoomFuncW(this.frame);};this.getHeight=function(){if(!this.loaded)return 0;return this.height*this.zoomFuncH(this.frame);};this.isRunning=function(){return this.runningFrame||this.runningFading;};this.setAllFrameTo=function(to){this.setFadingTo(to);this.setFrameTo(to);return this.isRunning();};this.setFadingTo=function(fadingTo){if(this.fadingFrame==fadingTo)
this.runningFading=false;else{if(this.fadingFrame>fadingTo)
this.fadingFrame-=this.fadingStep;else
this.fadingFrame+=this.fadingStep;this.runningFading=true;if(Math.abs(this.fadingFrame-fadingTo)<this.fadingStep)
this.fadingFrame=fadingTo;if(this.fadingFrame<0)
this.fadingFrame=0;if(this.fadingFrame>1)
this.fadingFrame=1;}
return this.runningFading;};this.setFrameTo=function(frameTo){if(this.frame==frameTo)
this.runningFrame=false;else{this.runningFrame=true;this.frame+=(frameTo-this.frame)*this.frameStep;if(Math.abs(this.frame-frameTo)<0.01)
this.frame=frameTo;if(this.frame<0)
this.frame=0;if(this.frame>1)
this.frame=1;}
return this.runningFrame;};this.addElement=function(args){if(typeof(args)!="undefined"&&args!=null){this.elementsArray=new Array();this.fadingStep=0.5/args.length;for(var i=0;i<args.length;i++)
for(var ii in args[i]){var id="euDock_"+ii+"_"+euEnv.Kost.next();euEnv.euDockArray[id]=new window[ii](id,args[i][ii],this.parentDock.div,"euEnv.euDockArray."+this.id+".retrieveLoadingDims(euEnv.euDockArray."+id+","+i+");");this.elementsArray.push(euEnv.euDockArray[id]);euEnv.euDockArray[id].loaded=false;}}};this.destroy=function(){for(var i in this.elementsArray)if(this.elementsArray[i].id){euEnv.euDockArray[this.elementsArray[i].id]=0;euEnv.euDockArray.splice(this.elementsArray[i],1);if(this.elementsArray[i].destroy)
this.elementsArray[i].destroy();}
this.elementsArray.splice(0,this.elementsArray.length);};this.mouseClick=function(x,y){if(this.isAbsoluteInside(x,y)){if(this.link)
if(this.target){if(top.frames[this.target])
top.frames[this.target].location.href=this.link;else
top.frames[this.target]=window.open(this.link,this.target,"");}
else
{var foundLabel=false;for(elIdx=0;elIdx<this.elementsArray.length;elIdx++)
{if(this.elementsArray[elIdx].id.indexOf('Label')!=-1)
{var lblEl=$(this.elementsArray[elIdx].id);var offset=lblEl.cumulativeOffset();var dimensions=lblEl.getDimensions();if(y>=offset[1]&&y<offset[1]+dimensions.height&&x>=offset[0]&&x<offset[0]+dimensions.width)
{window.handled=true;eval(this.elementsArray[elIdx].jsCall);foundLabel=true;break;}}}
if(!foundLabel)
{window.handled=true;document.location.href=this.link;}}
else if(this.mouseInsideClick)
this.mouseInsideClick(x,y);}};};function euDockBar(id,dock){this.id=id;this.parentDock=dock;this.elementsArray=new Array();this.len=0;this.align=euUP;this.loaded=false;this.getSize=function(){if(!this.loaded)
return 0;if(this.align==euUP||this.align==euDOWN||this.align==euHORIZONTAL)
return this.elementsArray.left.getHeight();else
return this.elementsArray.top.getWidth();};this.refresh=function(){if(!this.loaded)
return;if(this.align==euUP||this.align==euDOWN||this.align==euHORIZONTAL){this.elementsArray.left.setPos(-this.elementsArray.left.getWidth(),0);this.elementsArray.horizontal.setProperties(0,0,Math.round(this.len),this.getSize());this.elementsArray.right.setPos(Math.round(this.len),0);this.elementsArray.left.show();this.elementsArray.horizontal.show();this.elementsArray.right.show();if(this.elementsArray.top)
this.elementsArray.top.hide();if(this.elementsArray.bottom)
this.elementsArray.bottom.hide();if(this.elementsArray.vertical){this.elementsArray.vertical.setProperties(0,0,0,0);this.elementsArray.vertical.hide();}}else{this.elementsArray.top.setPos(0,-this.elementsArray.top.getHeight());this.elementsArray.vertical.setProperties(0,0,this.getSize(),Math.round(this.len));this.elementsArray.bottom.setPos(0,Math.round(this.len));this.elementsArray.top.show();this.elementsArray.vertical.show();this.elementsArray.bottom.show();if(this.elementsArray.left)
this.elementsArray.left.hide();if(this.elementsArray.right)
this.elementsArray.right.hide();if(this.elementsArray.horizontal){this.elementsArray.horizontal.setProperties(0,0,0,0);this.elementsArray.horizontal.hide();}}};this.setProperties=function(len,align){this.len=len+1;this.align=align;this.refresh();};this.retrieveLoadingDims=function(elem){if(elem.onLoadPrev)
elem.onLoadPrev();elem.loaded=true;var ret=true;for(var i in this.elementsArray)if(this.elementsArray[i].id)
ret&=this.elementsArray[i].loaded
this.loaded=ret;if(this.loaded){this.parentDock.updateDims();for(var i in this.elementsArray)if(this.elementsArray[i].id)
this.elementsArray[i].show();}
if(elem.onLoadNext)
elem.onLoadNext();};this.setElements=function(args){if(typeof(args)!="undefined"&&args!=null){for(var i in args)
for(var ii in args[i]){var id="euDock_"+ii+"_"+euEnv.Kost.next();euEnv.euDockArray[id]=new window[ii](id,args[i][ii],this.parentDock.divBar,"euEnv.euDockArray."+this.id+".retrieveLoadingDims(euEnv.euDockArray."+id+");");this.elementsArray[i]=euEnv.euDockArray[id];euEnv.euDockArray[id].loaded=false;}}};};function euThread(){euDimensioni();offsEut();euEnv.timeout=window.setTimeout("euThread();",euEnv.refreshTime);euEnv.exeThread=false;if(euEnv.mouseMoved)
for(var i in euEnv.euDockArray)
if(euEnv.euDockArray[i].mouseMove)
euEnv.exeThread|=euEnv.euDockArray[i].mouseMove(euEnv.euScrOfX+euEnv.x,euEnv.euScrOfY+euEnv.y);euEnv.mouseMoved=false;if(euEnv.exeThread)
euEnv.exeThreadWhiteLoop=5;if(euEnv.exeThreadWhiteLoop>0)
euKernel();for(var i in euEnv.euDockArray)
if(euEnv.euDockArray[i].riposition)
euEnv.euDockArray[i].riposition();};function euKernel(){euEnv.exeThread=false;for(var i in euEnv.euDockArray)
if(euEnv.euDockArray[i].kernel)
euEnv.exeThread|=euEnv.euDockArray[i].kernel();if(euEnv.exeThread)
euEnv.exeThreadWhiteLoop=5;else
euEnv.exeThreadWhiteLoop--;};function on_MouseMove(e){if(!e)var e=window.event;euEnv.x=e.clientX;euEnv.y=e.clientY;euEnv.mouseMoved=true;if(euEnv.onmousemoveBK)
return euEnv.onmousemoveBK(e);return true;};function on_MouseDown(e){if(!e)var e=window.event;for(var i in euEnv.euDockArray)
if(euEnv.euDockArray[i].mouseDown)
euEnv.exeThread|=euEnv.euDockArray[i].mouseDown(euEnv.euScrOfX+e.clientX,euEnv.euScrOfY+e.clientY);if(euEnv.onmousedownBK)
return euEnv.onmousedownBK(e);return true;};function on_MouseUp(e){if(!e)var e=window.event;for(var i in euEnv.euDockArray)
if(euEnv.euDockArray[i].mouseUp)
euEnv.exeThread|=euEnv.euDockArray[i].mouseUp(euEnv.euScrOfX+e.clientX,euEnv.euScrOfY+e.clientY);if(euEnv.onmouseupBK)
return euEnv.onmouseupBK(e);return true;};function on_MouseClick(e){if(!e)var e=window.event;window.handled=false;for(var i in euEnv.euDockArray)
{if(window.handled==false&&euEnv.euDockArray[i].mouseClick)
euEnv.exeThread|=euEnv.euDockArray[i].mouseClick(euEnv.euScrOfX+e.clientX,euEnv.euScrOfY+e.clientY);}
if(euEnv.onclickBK)
return euEnv.onclickBK(e);return true;};if(document.onmousemove)
euEnv.onmousemoveBK=document.onmousemove;document.onmousemove=on_MouseMove;if(document.onmousedown)
euEnv.onmousedownBK=document.onmousedown;document.onmousedown=on_MouseDown;if(document.onmouseup)
euEnv.onmouseupBK=document.onmouseup;document.onmouseup=on_MouseUp;if(document.onclick)
euEnv.onclickBK=document.onclick;document.onclick=on_MouseClick;euDimensioni();offsEut();euThread();function euPreloadImage(a,b){var d=document;if(d.images){if(!d.p)d.p=new Array();d.p.push(new Image());d.p[d.p.length-1].src=a;d.p[d.p.length-1].title=b;}};if(!euEnv.imageBasePath)
euEnv.imageBasePath="./";function euImage(id,args,container,onLoadFunc){if(!args.PngObjIE)
args.PngObjIE=euImageIE_PNG;if(typeof(window.innerWidth)!='number'&&args.image.toLowerCase().indexOf("png")!=-1)
return new args.PngObjIE(id,args,container,onLoadFunc);this.id=id;this.container=container;euPreloadImage(args.image,args.title);this.setProperties=function(x,y,w,h){this.setPos(x,y);this.setDim(w,h);};this.setPos=function(x,y){this.setPosX(x);this.setPosY(y);};this.setDim=function(w,h){this.setWidth(w);this.setHeight(h);};this.getPosX=function(){return document.getElementById(this.id).style.left.replace(/[^0-9]/g,"");};this.setPosX=function(x){document.getElementById(this.id).style.left=x+'px';};this.getPosY=function(){return document.getElementById(this.id).style.top.replace(/[^0-9]/g,"");};this.setPosY=function(y){document.getElementById(this.id).style.top=y+'px';};this.getWidth=function(){return document.getElementById(this.id).width;};this.setWidth=function(w){document.getElementById(this.id).width=Math.round(w);};this.getHeight=function(){return document.getElementById(this.id).height;};this.setHeight=function(h){document.getElementById(this.id).height=Math.round(h);};this.hide=function(){document.getElementById(this.id).style.visibility='hidden';};this.show=function(){document.getElementById(this.id).style.visibility='visible';};this.setFading=function(fad){fad=Math.round(fad);if(fad<0)
fad=0;if(fad>100)
fad=100;document.getElementById(this.id).style.opacity=(fad/100);document.getElementById(this.id).style.filter="alpha(opacity="+(fad)+");";};this.container.innerHTML+="<img onLoad='"+onLoadFunc+";' title='"+args.title+"' id='"+this.id+"' src='"+args.image+"' style='position:absolute;visibility:hidden;'>";this.destroy=function(){this.container.removeChild(document.getElementById(this.id));};};function euImageIE_PNG(id,args,container,onLoadFunc){this.id=id;this.container=container;euPreloadImage(args.image);this.setProperties=function(x,y,w,h){this.setPos(x,y);this.setDim(w,h);};this.setPos=function(x,y){this.setPosX(x);this.setPosY(y);};this.setDim=function(w,h){this.setWidth(w);this.setHeight(h);};this.getPosX=function(){return document.getElementById(this.id).style.left.replace(/[^0-9]/g,"");};this.setPosX=function(x){document.getElementById(this.id).style.left=x+'px';};this.getPosY=function(){return document.getElementById(this.id).style.top.replace(/[^0-9]/g,"");};this.setPosY=function(y){document.getElementById(this.id).style.top=y+'px';};this.getWidth=function(){if(!this.width)return 0;return this.width;};this.setWidth=function(w){if(!this.width)return;this.width=Math.round(w);document.getElementById(this.id).style.width=Math.round(w)+'px';document.getElementById(this.id+"_IMG").style.width=Math.round(w)+'px';};this.getHeight=function(){if(!this.height)return 0;return this.height;};this.setHeight=function(h){if(!this.height)return;this.height=Math.round(h);document.getElementById(this.id).style.height=Math.round(h)+'px';document.getElementById(this.id+"_IMG").style.height=Math.round(h)+'px';};this.onLoadPrev=function(){if(this.width&&this.height)return;this.width=document.getElementById(this.id+"_IMG_BAK").width;this.height=document.getElementById(this.id+"_IMG_BAK").height;document.getElementById(this.id+"_IMG_BAK").width=0;document.getElementById(this.id+"_IMG_BAK").height=0;this.setDim(this.width,this.height);};this.hide=function(){document.getElementById(this.id).style.visibility='hidden';};this.show=function(){document.getElementById(this.id).style.visibility='visible';if(this.width&&this.height)this.setDim(this.width,this.height);};this.setFading=function(fad){fad=Math.round(fad);if(fad<0)
fad=0;if(fad>100)
fad=100;document.getElementById(this.id).style.opacity=(fad/100);document.getElementById(this.id).style.filter="alpha(opacity="+(fad)+");";};this.container.innerHTML+="<div id='"+this.id+"' style='position:absolute;'></div>";document.getElementById(this.id).innerHTML="<img src='"+euEnv.imageBasePath+"blank.gif' id='"+this.id+"_IMG' style=\"top:0px;left:0px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+args.image+"',sizingMethod='scale');position:absolute;\">";this.container.innerHTML+="<img onLoad='"+onLoadFunc+";' id='"+this.id+"_IMG_BAK' src='"+args.image+"' style='position:absolute;'>";this.destroy=function(){this.container.removeChild(document.getElementById(this.id));this.container.removeChild(document.getElementById(this.id+"_IMG_BAK"));};};function euImageNoFadingIE_PNG(id,args,container,onLoadFunc){this.id=id;this.container=container;euPreloadImage(args.image);this.setProperties=function(x,y,w,h){this.setPos(x,y);this.setDim(w,h);};this.setPos=function(x,y){this.setPosX(x);this.setPosY(y);};this.setDim=function(w,h){this.setWidth(w);this.setHeight(h);};this.getPosX=function(){return document.getElementById(this.id).style.left.replace(/[^0-9]/g,"");};this.setPosX=function(x){document.getElementById(this.id).style.left=x+'px';};this.getPosY=function(){return document.getElementById(this.id).style.top.replace(/[^0-9]/g,"");};this.setPosY=function(y){document.getElementById(this.id).style.top=y+'px';};this.getWidth=function(){if(!this.width)return 0;return this.width;};this.setWidth=function(w){if(!this.width)return;this.width=Math.round(w);document.getElementById(this.id).style.width=Math.round(w)+'px';};this.getHeight=function(){if(!this.height)return 0;return this.height;};this.setHeight=function(h){if(!this.height)return;this.height=Math.round(h);document.getElementById(this.id).style.height=Math.round(h)+'px';};this.hide=function(){document.getElementById(this.id).style.visibility='hidden';};this.show=function(){document.getElementById(this.id).style.visibility='visible';};this.onLoadPrev=function(){if(this.width&&this.height)return;this.width=document.getElementById(this.id+"_IMG_BAK").width;this.height=document.getElementById(this.id+"_IMG_BAK").height;document.getElementById(this.id+"_IMG_BAK").width=0;document.getElementById(this.id+"_IMG_BAK").height=0;this.setDim(this.width,this.height);};this.setFading=function(fad){};this.container.innerHTML+="<img src='"+euEnv.imageBasePath+"blank.gif' id='"+this.id+"' style='position:absolute;visibility:hidden;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+args.image+"\",sizingMethod=\"scale\");' >";this.container.innerHTML+="<img onLoad='"+onLoadFunc+";' id='"+this.id+"_IMG_BAK' src='"+args.image+"' style='position:absolute;visibility:hidden;'>";this.destroy=function(){this.container.removeChild(document.getElementById(this.id));this.container.removeChild(document.getElementById(this.id+"_IMG_BAK"));};};function euLabel(id,args,container,onLoadFunc){this.id=id;this.anchor=euDOWN;this.offsetX=0;this.offsetY=0;this.setProperties=function(x,y,w,h){this.setPos(x,y);this.setDim(w,h);};this.setPos=function(x,y){this.setPosX(x);this.setPosY(y);};this.setDim=function(w,h){this.setWidth(w);this.setHeight(h);};this.width=0;this.height=0;this.posX=0;this.posY=0;this.getPosX=function(){return this.object.getPosX();};this.setPosX=function(x){this.posX=x;this.object.setPosX(x);};this.getPosY=function(){return this.object.getPosY();};this.setPosY=function(y){this.posY=y;this.object.setPosY(y);};this.getWidth=function(){return this.object.getWidth();};this.setWidth=function(w){this.width=w;this.object.setWidth(w);};this.getHeight=function(){return this.object.getHeight();};this.setHeight=function(h){this.height=h;this.object.setHeight(h);};this.hide=function(){this.object.hide();document.getElementById(this.id).style.visibility='hidden';};this.show=function(){this.object.show();document.getElementById(this.id).style.visibility='visible';};this.setFading=function(fad){fad=Math.round(fad);if(fad<0)
fad=0;if(fad>100)
fad=100;document.getElementById(this.id).style.opacity=(fad/100);document.getElementById(this.id).style.filter="alpha(opacity="+(fad)+");";this.object.setFading(fad);};this.onLoadPrev=function(){if(this.object.onLoadPrev)
this.object.onLoadPrev();};this.onLoadNext=function(){if(this.object.onLoadNext)
this.object.onLoadNext();};this.mouseMove=function(x,y){if(this.object.mouseMove)
this.object.mouseMove(x,y);return false;};this.riposition=function(){if(this.object.riposition)
this.object.riposition();if(this.anchor==euDOWN){document.getElementById(this.id).style.left=(this.posX+this.offsetX+(this.width-document.getElementById(this.id).offsetWidth)/2)+'px';document.getElementById(this.id).style.top=(this.posY+this.height+this.offsetY)+'px';}else if(this.anchor==euUP){document.getElementById(this.id).style.left=(this.posX+this.offsetX+(this.width-document.getElementById(this.id).offsetWidth)/2)+'px';document.getElementById(this.id).style.top=(this.posY+this.offsetY)+'px';}else if(this.anchor==euLEFT){document.getElementById(this.id).style.left=(this.posX+this.offsetX)+'px';document.getElementById(this.id).style.top=(this.posY+this.offsetY+(this.height-document.getElementById(this.id).offsetHeight)/2)+'px';}else{document.getElementById(this.id).style.left=(this.posX+this.width+this.offsetX)+'px';document.getElementById(this.id).style.top=(this.posY+this.offsetY+(this.height-document.getElementById(this.id).offsetHeight)/2)+'px';}};if(args.anchor)
this.anchor=args.anchor;if(args.offsetX)
this.offsetX=args.offsetX;if(args.jsCall)
this.jsCall=args.jsCall;if(args.offsetY)
this.offsetY=args.offsetY;var style="";if(args.style)
style=args.style;for(var i in args.object)
this.object=new window[i](this.id+"_LABEL_OBJECT",args.object[i],container,onLoadFunc);container.innerHTML+="<span id='"+this.id+"' src='"+args.image+"' style='position:absolute;visibility:hidden;"+style+";'>"+args.txt+"</span>";};ProtoCheck=Class.create({initialize:function(options){this.options={checkClass:'pc_checkbox',radioClass:'pc_radiobutton',checkOnClass:'pc_check_checked',checkOffClass:'pc_check_unchecked',radioOnClass:'pc_radio_checked',radioOffClass:'pc_radio_unchecked',checkOnDisabledClass:'pc_check_checked_disabled',checkOffDisabledClass:'pc_check_unchecked_disabled',radioOnDisabledClass:'pc_radio_checked_disabled',radioOffDisabledClass:'pc_radio_unchecked_disabled',focusClass:'pc_focus'};Object.extend(this.options,options||{});this.classez=[];this.disClassez=[];this.classez.checkbox={"on":this.options.checkOnClass,"off":this.options.checkOffClass};this.disClassez.checkbox={"on":this.options.checkOnDisabledClass,"off":this.options.checkOffDisabledClass};this.classez.radio={"on":this.options.radioOnClass,"off":this.options.radioOffClass};this.disClassez.radio={"on":this.options.radioOnDisabledClass,"off":this.options.radioOffDisabledClass};var elements=$$("label."+this.options.checkClass).concat($$("label."+this.options.radioClass));elements.each(function(label){var element=label.down();element.setStyle({position:'absolute',left:'-9999px'});if(element.checked){this.check(element,label);}else{this.uncheck(element,label);}
if(!element.disabled){element.observe("click",function(ev){this.click(ev);}.bind(this));element.observe("focus",function(ev){this.focus(ev);}.bind(this));element.observe("blur",function(ev){this.blur(ev);}.bind(this));if(this.fixIE){label.observe("click",function(ev){this.clickIE6(ev);}.bind(this));}}}.bind(this));},fixIE:(function(agent){var version=new RegExp('MSIE ([\\d.]+)').exec(agent);return version?(parseFloat(version[1])<=6):false;})(navigator.userAgent),check:function(element,label){var css=element.disabled?this.disClassez[element.type]:this.classez[element.type];label.addClassName(css.on).removeClassName(css.off);},uncheck:function(element,label){var css=element.disabled?this.disClassez[element.type]:this.classez[element.type];label.addClassName(css.off).removeClassName(css.on);},focus:function(ev){var label=ev.element().up();label.addClassName(this.options.focusClass);},blur:function(ev){var label=ev.element().up();label.removeClassName(this.options.focusClass);},click:function(ev){var element=ev.element();var label=element.up();this.update(ev,element,label);},clickIE6:function(ev){var label=ev.element();if(label.nodeName=="LABEL"){var element=label.down();element.click();}},update:function(ev,element,label){if(label.hasClassName(this.options.checkClass)){if(element.checked){this.check(element,label);}else{this.uncheck(element,label);}}
if(label.hasClassName(this.options.radioClass)){$$("input[name="+element.name+"]").each(function(but){if(element!=but){this.uncheck(but,but.up());}}.bind(this));this.check(element,label);}
element.focus();}});var CropDraggable=Class.create(Draggable,{initialize:function(a){this.options=Object.extend({drawMethod:function(){}},arguments[1]||{});this.element=$(a);this.handle=this.element;this.delta=this.currentDelta();this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this);},draw:function(a){var e=Element.cumulativeOffset(this.element),c=this.currentDelta();e[0]-=c[0];e[1]-=c[1];var b=[0,1].map(function(d){return(a[d]-e[d]-this.offset[d]);}.bind(this));this.options.drawMethod(b);}});var Cropper={};Cropper.Img=Class.create({initialize:function(c,a){this.options=Object.extend({ratioDim:{x:0,y:0},minWidth:0,minHeight:0,displayOnInit:false,onEndCrop:Prototype.emptyFunction,captureKeys:true,onloadCoords:null,maxWidth:0,maxHeight:0,autoIncludeCSS:true},a||{});this.img=$(c);this.clickCoords={x:0,y:0};this.dragging=false;this.resizing=false;this.isWebKit=/Konqueror|Safari|KHTML/.test(navigator.userAgent);this.isIE=/MSIE/.test(navigator.userAgent);this.isOpera8=/Opera\s[1-8]/.test(navigator.userAgent);this.ratioX=0;this.ratioY=0;this.attached=false;this.fixedWidth=(this.options.maxWidth>0&&(this.options.minWidth>=this.options.maxWidth));this.fixedHeight=(this.options.maxHeight>0&&(this.options.minHeight>=this.options.maxHeight));if(typeof this.img=="undefined"){return;}if(this.options.autoIncludeCSS){$$("script").each(function(e){if(e.src.match(/\/cropper([^\/]*)\.js/)){var f=e.src.replace(/\/cropper([^\/]*)\.js.*/,""),d=document.createElement("link");d.rel="stylesheet";d.type="text/css";d.href=f+"/cropper.css";d.media="screen";document.getElementsByTagName("head")[0].appendChild(d);}});}if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){var b=this.getGCD(this.options.ratioDim.x,this.options.ratioDim.y);this.ratioX=this.options.ratioDim.x/b;this.ratioY=this.options.ratioDim.y/b;}this.subInitialize();if(this.img.complete||this.isWebKit){this.onLoad();}else{Event.observe(this.img,"load",this.onLoad.bindAsEventListener(this));}},getGCD:function(d,c){if(c===0){return d;}return this.getGCD(c,d%c);},onLoad:function(){var c="imgCrop_";var e=this.img.parentNode;var b="";if(this.isOpera8){b=" opera8";}this.imgWrap=new Element("div",{"class":c+"wrap"+b});this.north=new Element("div",{"class":c+"overlay "+c+"north"}).insert(new Element("span"));this.east=new Element("div",{"class":c+"overlay "+c+"east"}).insert(new Element("span"));this.south=new Element("div",{"class":c+"overlay "+c+"south"}).insert(new Element("span"));this.west=new Element("div",{"class":c+"overlay "+c+"west"}).insert(new Element("span"));var d=[this.north,this.east,this.south,this.west];this.dragArea=new Element("div",{"class":c+"dragArea"});d.each(function(f){this.dragArea.insert(f);},this);this.handleN=new Element("div",{"class":c+"handle "+c+"handleN"});this.handleNE=new Element("div",{"class":c+"handle "+c+"handleNE"});this.handleE=new Element("div",{"class":c+"handle "+c+"handleE"});this.handleSE=new Element("div",{"class":c+"handle "+c+"handleSE"});this.handleS=new Element("div",{"class":c+"handle "+c+"handleS"});this.handleSW=new Element("div",{"class":c+"handle "+c+"handleSW"});this.handleW=new Element("div",{"class":c+"handle "+c+"handleW"});this.handleNW=new Element("div",{"class":c+"handle "+c+"handleNW"});this.selArea=new Element("div",{"class":c+"selArea"});[new Element("div",{"class":c+"marqueeHoriz "+c+"marqueeNorth"}).insert(new Element("span")),new Element("div",{"class":c+"marqueeVert "+c+"marqueeEast"}).insert(new Element("span")),new Element("div",{"class":c+"marqueeHoriz "+c+"marqueeSouth"}).insert(new Element("span")),new Element("div",{"class":c+"marqueeVert "+c+"marqueeWest"}).insert(new Element("span")),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,new Element("div",{"class":c+"clickArea"})].each(function(f){this.selArea.insert(f);},this);this.imgWrap.appendChild(this.img);this.imgWrap.appendChild(this.dragArea);this.dragArea.appendChild(this.selArea);this.dragArea.appendChild(new Element("div",{"class":c+"clickArea"}));e.appendChild(this.imgWrap);this.startDragBind=this.startDrag.bindAsEventListener(this);Event.observe(this.dragArea,"mousedown",this.startDragBind);this.onDragBind=this.onDrag.bindAsEventListener(this);Event.observe(document,"mousemove",this.onDragBind);this.endCropBind=this.endCrop.bindAsEventListener(this);Event.observe(document,"mouseup",this.endCropBind);this.resizeBind=this.startResize.bindAsEventListener(this);this.handles=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW];this.registerHandles(true);if(this.options.captureKeys){this.keysBind=this.handleKeys.bindAsEventListener(this);Event.observe(document,"keypress",this.keysBind);}var a=new CropDraggable(this.selArea,{drawMethod:this.moveArea.bindAsEventListener(this)});this.setParams();},registerHandles:function(b){for(var d=0;d<this.handles.length;d++){var g=$(this.handles[d]);if(b){var a=false;if(this.fixedWidth&&this.fixedHeight){a=true;}else{if(this.fixedWidth||this.fixedHeight){var c=g.className.match(/([S|N][E|W])$/),f=g.className.match(/(E|W)$/),e=g.className.match(/(N|S)$/);if(c||(this.fixedWidth&&f)||(this.fixedHeight&&e)){a=true;}}}if(a){g.hide();}else{Event.observe(g,"mousedown",this.resizeBind);}}else{g.show();Event.stopObserving(g,"mousedown",this.resizeBind);}}},setParams:function(){this.imgW=this.img.width;this.imgH=this.img.height;$(this.north).setStyle({height:0});$(this.east).setStyle({width:0,height:0});$(this.south).setStyle({height:0});$(this.west).setStyle({width:0,height:0});$(this.imgWrap).setStyle({width:this.imgW+"px",height:this.imgH+"px"});$(this.selArea).hide();var b={x1:0,y1:0,x2:0,y2:0},a=false;if(this.options.onloadCoords!==null){b=this.cloneCoords(this.options.onloadCoords);a=true;}else{if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){b.x1=Math.ceil((this.imgW-this.options.ratioDim.x)/2);b.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2);b.x2=b.x1+this.options.ratioDim.x;b.y2=b.y1+this.options.ratioDim.y;a=true;}}this.setAreaCoords(b,false,false,1);if(this.options.displayOnInit&&a){this.selArea.show();this.drawArea();this.endCrop();}this.attached=true;},remove:function(){if(this.attached){this.attached=false;this.imgWrap.parentNode.insertBefore(this.img,this.imgWrap);this.imgWrap.parentNode.removeChild(this.imgWrap);Event.stopObserving(this.dragArea,"mousedown",this.startDragBind);Event.stopObserving(document,"mousemove",this.onDragBind);Event.stopObserving(document,"mouseup",this.endCropBind);this.registerHandles(false);if(this.options.captureKeys){Event.stopObserving(document,"keypress",this.keysBind);}}},reset:function(){if(!this.attached){this.onLoad();}else{this.setParams();}this.endCrop();},handleKeys:function(b){var a={x:0,y:0};if(!this.dragging){switch(b.keyCode){case(37):a.x=-1;break;case(38):a.y=-1;break;case(39):a.x=1;break;case(40):a.y=1;break;}if(a.x!==0||a.y!==0){if(b.shiftKey){a.x*=10;a.y*=10;}this.moveArea([this.areaCoords.x1+a.x,this.areaCoords.y1+a.y]);this.endCrop();Event.stop(b);}}},calcW:function(){return(this.areaCoords.x2-this.areaCoords.x1);},calcH:function(){return(this.areaCoords.y2-this.areaCoords.y1);},moveArea:function(a){this.setAreaCoords({x1:a[0],y1:a[1],x2:a[0]+this.calcW(),y2:a[1]+this.calcH()},true,false);this.drawArea();},cloneCoords:function(a){return{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2};},setAreaCoords:function(i,a,m,h,k){if(a){var j=i.x2-i.x1,f=i.y2-i.y1;if(i.x1<0){i.x1=0;i.x2=j;}if(i.y1<0){i.y1=0;i.y2=f;}if(i.x2>this.imgW){i.x2=this.imgW;i.x1=this.imgW-j;}if(i.y2>this.imgH){i.y2=this.imgH;i.y1=this.imgH-f;}}else{if(i.x1<0){i.x1=0;}if(i.y1<0){i.y1=0;}if(i.x2>this.imgW){i.x2=this.imgW;}if(i.y2>this.imgH){i.y2=this.imgH;}if(h!==null){if(this.ratioX>0){this.applyRatio(i,{x:this.ratioX,y:this.ratioY},h,k);}else{if(m){this.applyRatio(i,{x:1,y:1},h,k);}}var b=[this.options.minWidth,this.options.minHeight],l=[this.options.maxWidth,this.options.maxHeight];if(b[0]>0||b[1]>0||l[0]>0||l[1]>0){var g={a1:i.x1,a2:i.x2},e={a1:i.y1,a2:i.y2},d={min:0,max:this.imgW},c={min:0,max:this.imgH};if((b[0]!==0||b[1]!==0)&&m){if(b[0]>0){b[1]=b[0];}else{if(b[1]>0){b[0]=b[1];}}}if((l[0]!==0||l[0]!==0)&&m){if(l[0]>0&&l[0]<=l[1]){l[1]=l[0];}else{if(l[1]>0&&l[1]<=l[0]){l[0]=l[1];}}}if(b[0]>0){this.applyDimRestriction(g,b[0],h.x,d,"min");}if(b[1]>1){this.applyDimRestriction(e,b[1],h.y,c,"min");}if(l[0]>0){this.applyDimRestriction(g,l[0],h.x,d,"max");}if(l[1]>1){this.applyDimRestriction(e,l[1],h.y,c,"max");}i={x1:g.a1,y1:e.a1,x2:g.a2,y2:e.a2};}}}this.areaCoords=i;},applyDimRestriction:function(d,f,e,c,b){var a;if(b=="min"){a=((d.a2-d.a1)<f);}else{a=((d.a2-d.a1)>f);}if(a){if(e==1){d.a2=d.a1+f;}else{d.a1=d.a2-f;}if(d.a1<c.min){d.a1=c.min;d.a2=f;}else{if(d.a2>c.max){d.a1=c.max-f;d.a2=c.max;}}}},applyRatio:function(c,a,e,b){var d;if(b=="N"||b=="S"){d=this.applyRatioToAxis({a1:c.y1,b1:c.x1,a2:c.y2,b2:c.x2},{a:a.y,b:a.x},{a:e.y,b:e.x},{min:0,max:this.imgW});c.x1=d.b1;c.y1=d.a1;c.x2=d.b2;c.y2=d.a2;}else{d=this.applyRatioToAxis({a1:c.x1,b1:c.y1,a2:c.x2,b2:c.y2},{a:a.x,b:a.y},{a:e.x,b:e.y},{min:0,max:this.imgH});c.x1=d.a1;c.y1=d.b1;c.x2=d.a2;c.y2=d.b2;}},applyRatioToAxis:function(i,f,h,b){var j=Object.extend(i,{}),e=j.a2-j.a1,a=Math.floor(e*f.b/f.a),g=null,c=null,d=null;if(h.b==1){g=j.b1+a;if(g>b.max){g=b.max;d=g-j.b1;}j.b2=g;}else{g=j.b2-a;if(g<b.min){g=b.min;d=g+j.b2;}j.b1=g;}if(d!==null){c=Math.floor(d*f.a/f.b);if(h.a==1){j.a2=j.a1+c;}else{j.a1=j.a1=j.a2-c;}}return j;},drawArea:function(){var h=this.calcW(),e=this.calcH();var g="px",c=[this.areaCoords.x1+g,this.areaCoords.y1+g,h+g,e+g,this.areaCoords.x2+g,this.areaCoords.y2+g,(this.img.width-this.areaCoords.x2)+g,(this.img.height-this.areaCoords.y2)+g];var f=this.selArea.style;f.left=c[0];f.top=c[1];f.width=c[2];f.height=c[3];var i=Math.ceil((h-6)/2)+g,d=Math.ceil((e-6)/2)+g;this.handleN.style.left=i;this.handleE.style.top=d;this.handleS.style.left=i;this.handleW.style.top=d;this.north.style.height=c[1];var a=this.east.style;a.top=c[1];a.height=c[3];a.left=c[4];a.width=c[6];var j=this.south.style;j.top=c[5];j.height=c[7];var b=this.west.style;b.top=c[1];b.height=c[3];b.width=c[0];this.subDrawArea();this.forceReRender();},forceReRender:function(){if(this.isIE||this.isWebKit){var g=document.createTextNode(" ");var e,b,f,a;if(this.isIE){fixEl=this.selArea;}else{if(this.isWebKit){fixEl=document.getElementsByClassName("imgCrop_marqueeSouth",this.imgWrap)[0];e=new Element("div");e.style.visibility="hidden";var c=["SE","S","SW"];for(a=0;a<c.length;a++){b=document.getElementsByClassName("imgCrop_handle"+c[a],this.selArea)[0];if(b.childNodes.length){b.removeChild(b.childNodes[0]);}b.appendChild(e);}}}fixEl.appendChild(g);fixEl.removeChild(g);}},startResize:function(a){this.startCoords=this.cloneCoords(this.areaCoords);this.resizing=true;this.resizeHandle=Event.element(a).classNames().toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,"");Event.stop(a);},startDrag:function(a){this.selArea.show();this.clickCoords=this.getCurPos(a);this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y},false,false,null);this.dragging=true;this.onDrag(a);Event.stop(a);},getCurPos:function(b){var a=this.imgWrap,c=Element.cumulativeOffset(a);while(a.nodeName!="BODY"){c[1]-=a.scrollTop||0;c[0]-=a.scrollLeft||0;a=a.parentNode;}return{x:Event.pointerX(b)-c[0],y:Event.pointerY(b)-c[1]};},onDrag:function(f){if(this.dragging||this.resizing){var b=null,a=this.getCurPos(f),d=this.cloneCoords(this.areaCoords),c={x:1,y:1};if(this.dragging){if(a.x<this.clickCoords.x){c.x=-1;}if(a.y<this.clickCoords.y){c.y=-1;}this.transformCoords(a.x,this.clickCoords.x,d,"x");this.transformCoords(a.y,this.clickCoords.y,d,"y");}else{if(this.resizing){b=this.resizeHandle;if(b.match(/E/)){this.transformCoords(a.x,this.startCoords.x1,d,"x");if(a.x<this.startCoords.x1){c.x=-1;}}else{if(b.match(/W/)){this.transformCoords(a.x,this.startCoords.x2,d,"x");if(a.x<this.startCoords.x2){c.x=-1;}}}if(b.match(/N/)){this.transformCoords(a.y,this.startCoords.y2,d,"y");if(a.y<this.startCoords.y2){c.y=-1;}}else{if(b.match(/S/)){this.transformCoords(a.y,this.startCoords.y1,d,"y");if(a.y<this.startCoords.y1){c.y=-1;}}}}}this.setAreaCoords(d,false,f.shiftKey,c,b);this.drawArea();Event.stop(f);}},transformCoords:function(b,a,e,d){var c=[b,a];if(b>a){c.reverse();}e[d+"1"]=c[0];e[d+"2"]=c[1];},endCrop:function(){this.dragging=false;this.resizing=false;this.options.onEndCrop(this.areaCoords,{width:this.calcW(),height:this.calcH()});},subInitialize:function(){},subDrawArea:function(){}});Cropper.ImgWithPreview=Class.create(Cropper.Img,{subInitialize:function(){this.hasPreviewImg=false;if(typeof(this.options.previewWrap)!="undefined"&&this.options.minWidth>0&&this.options.minHeight>0){this.previewWrap=$(this.options.previewWrap);this.previewImg=this.img.cloneNode(false);this.previewImg.id="imgCrop_"+this.previewImg.id;this.options.displayOnInit=true;this.hasPreviewImg=true;this.previewWrap.addClassName("imgCrop_previewWrap");this.previewWrap.setStyle({width:this.options.minWidth+"px",height:this.options.minHeight+"px"});this.previewWrap.appendChild(this.previewImg);}},subDrawArea:function(){if(this.hasPreviewImg){var d=this.calcW(),e=this.calcH();var f={x:this.imgW/d,y:this.imgH/e};var c={x:d/this.options.minWidth,y:e/this.options.minHeight};var a={w:Math.ceil(this.options.minWidth*f.x)+"px",h:Math.ceil(this.options.minHeight*f.y)+"px",x:"-"+Math.ceil(this.areaCoords.x1/c.x)+"px",y:"-"+Math.ceil(this.areaCoords.y1/c.y)+"px"};var b=this.previewImg.style;b.width=a.w;b.height=a.h;b.left=a.x;b.top=a.y;}}});if(typeof(window.Identity)=='undefined')
{window.Identity=Class.create();}
Identity.GetValue=function(aKey)
{var cookie=document.cookie;var identIdx=cookie.indexOf('identity');if(identIdx<0)
{return null;}
else
{var identity=cookie.substring(identIdx+9);var vars=identity.split('&');var value=$A(vars).find(function(aVar)
{return(aVar.startsWith(aKey));});if(value)
{value=value.substring(aKey.length+1);}
else
{value=null;}
return value;}};Identity.GetLoginName=function()
{return Identity.GetValue('username');};Identity.GetDisplayName=function()
{return Identity.GetValue('displayname');};Identity.GetRoleNames=function()
{if(Identity.GetLoginID()===null){return'';}
return Identity.GetValue('roles').toLowerCase();};Identity.GetLoginID=function()
{return Identity.GetValue('loginid');};Identity.GetFirstAccountIDForRole=function(role)
{if(Identity.GetLoginID()===null){return-1;}
var roleNames=Identity.GetRoleNames();if(roleNames)
{window.pattern='\:'+role.toLowerCase()+'\:(\\d+)\:';window.stringtomatch=roleNames;var re=new RegExp(pattern);window.results=re.exec(stringtomatch);if(results&&results.length>0)
{return results[1];}}
return-1;};Identity.ContainsRole=function(role)
{if(Identity.GetLoginID()===null){return false;}
return(Identity.GetRoleNames()&&(Identity.GetRoleNames().indexOf(':'+role.toLowerCase()+':')>=0||Identity.GetRoleNames().indexOf(':superadmin:')>=0));};Identity.ContainsAccountRole=function(role,accountID)
{if(Identity.GetLoginID()===null){return false;}
return(Identity.GetRoleNames()&&(Identity.GetRoleNames().indexOf(':'+role.toLowerCase()+':'+accountID+':')>=0||Identity.GetRoleNames().indexOf(':superadmin:')>=0));};Identity.HasPermission=function(title)
{var existingRoleIDs=PermissionRole.getExistingRoleIDsAsCSV(Identity.GetRoleNames());return Permission.hasPermission({existingRoleIDs:existingRoleIDs,title:title});};Identity.IsConfirmed=function()
{var isConf=Identity.GetValue('needsconf');return isConf===null;};Identity.IsQuickReg=function()
{var isConf=Identity.GetValue('isquickreg');return isConf!==null;};var BrowserSupport_={getInternetExplorerVersion:function()
{var rv=-1;if(navigator.appName=='Microsoft Internet Explorer')
{var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)
rv=parseFloat(RegExp.$1);}
return rv;}};var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.vendor,subString:"Apple",identity:"Safari"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"}],dataOS:[{string:navigator.platform,subString:"Mac",identity:"Mac"}]};BrowserDetect.init();document.fireWhenReady=function()
{var list=document.whenReady.list;for(var i=0;i<list.length;i++)
if(list[i])
{list[i]();list[i]=null;}}
document.whenReady=function(aFunction)
{document.whenReady.list.push(aFunction);if(document.loaded)
document.fireWhenReady();}
document.whenReady.list=new Array();document.observe('dom:loaded',document.fireWhenReady);if(!this.Node)
{this.Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};}
Accordion=Class.create();Accordion.prototype={initialize:function(container,options)
{if(!container){return;}
this.container=$(container);this.options=options||{};this.pane=this.options.pane||'div';this.clickpane=this.options.clickpane||'';this.bodypane=this.options.bodypane||'';this.openpane=this.options.openpane||'';this.duration=this.options.duration||0.5;this.closable=this.options.closable||false;this.multiple=this.options.multiple||false;if(this.options.allowopencheck)
{this.options.allowopencheck=this.options.allowopencheck.bind(this);}
this.allowopencheck=this.options.allowopencheck||function(){return true;};if(this.options.effect&&this.options.effect=='blind')
{this.effect='blind';}
else
{this.effect='slide';}
this.panels=$A(this.container.getElementsByTagName(this.pane));if(this.clickpane=='')
{throw("You must specify the class of the click pane.");}
this.clickpanes=this.container.select('.'+this.clickpane);if(this.bodypane=='')
{throw("You must specify the class of the body pane.");}
this.bodypanes=this.container.select('.'+this.bodypane);if(this.openpane=='')
{this.openpane=$(this.panels[0]);}
else if(this.openpane=='noshow')
{this.openpane=null;}
else
{this.openpane=$(this.openpane);}
var accordion=this;this.clickpanes.each(function(s)
{s.observe('click',accordion.slideAccordion.bindAsEventListener(accordion));});var effect=this.effect;this.bodypanes.each(function(s)
{if(effect=='slide')
{div=document.createElement('div');div.innerHTML=s.innerHTML;s.innerHTML='';s.appendChild(div);}});this.singleOpen=this.singleOpen.bind(this);this.singleClose=this.singleClose.bind(this);this.allOpen=this.allOpen.bind(this);this.allClose=this.allClose.bind(this);if(this.openpane)
{this.singleOpen(this.openpane.immediateDescendants()[1]);}},syncronizedSlide:function(elup,eldown)
{this.singleClose(elup);this.singleOpen(eldown);},singleOpen:function(ele)
{if(!this.allowopencheck(ele))
{return;}
ele.up().addClassName('open');if(this.effect=='blind')
{new Effect.BlindDown(ele,{duration:this.duration});}
else
{new Effect.SlideDown(ele,{duration:this.duration});}},singleClose:function(ele)
{ele.up().removeClassName('open');if(this.effect=='blind')
{new Effect.BlindUp(ele,{duration:this.duration});}
else
{new Effect.SlideUp(ele,{duration:this.duration});}},allOpen:function()
{singleOpen=this.singleOpen.bind(this);this.bodypanes.each(function(ele){singleOpen(ele);});},allClose:function()
{singleClose=this.singleClose.bind(this);this.bodypanes.each(function(ele){singleClose(ele);});},slideAccordion:function(event)
{var elem=Event.element(event);while(!elem.className.match(this.clickpane))
{elem=elem.up();}
var bodyPaneEle=elem.next();if(!bodyPaneEle)
{return;}
var current;var bodypane=this.bodypane;this.panels.each(function(s)
{if(s.className==bodypane&&s.style.display!='none')
{current=s;}});if(!current)
{this.singleOpen(bodyPaneEle);}
else if(this.closable&&bodyPaneEle.style.display!='none')
{this.singleClose(bodyPaneEle);}
else if(!this.multiple&&bodyPaneEle!=current)
{this.syncronizedSlide(current,bodyPaneEle);}
else if(this.multiple)
{this.singleOpen(bodyPaneEle);}}};var AjaxIndicator={indicatorElement:null,activeRequests:[],registerIndicator:function(indicatorElementOrID)
{AjaxIndicator.indicatorElement=$(indicatorElementOrID);Ajax.Responders.register
({onCreate:function(aTransport)
{if(Ajax.activeRequestCount>0)
{AjaxIndicator.indicatorElement.show();}
AjaxIndicator.indicatorElement.setAttribute('title',Ajax.activeRequestCount);if(document&&document.URL&&((document.URL.toLowerCase().indexOf('localhost')!=-1)||(document.URL.toLowerCase().indexOf('1to1blue.com')!=-1)||(document.URL.toLowerCase().indexOf('1to1real.com')!=-1)))
{var oldRespondToReadyState=aTransport.respondToReadyState;aTransport.respondToReadyState=function(readyState)
{var state=Ajax.Request.Events[readyState];var response=new Ajax.Response(this);if(state=='Complete'&&response.status==200&&response.responseText.indexOf('<form name="form1" method="post" action="Login2.aspx?ReturnUrl=')>0&&response.responseXML===null)
{Ajax.activeRequestCount--;Dlg.ShowIframe('ReLoginPage','Login Expired','Login2.aspx?reLoginFromIframe=true',{ok_handler:function()
{Dlg.hide();Dlg.stopProcessing();Inspect(response,'Look at response.request to see if it is intact');new Ajax.Request(response.request.url,response.request.options);},return_handler:function(){},but_ok:false,but_cancel:false,iFrameHeight:'584px',iFrameWidth:'1000px',iFrameNotice:'The action you attempted to execute has cannot be completed.',className:'modalDialogue_reLoginIframeDialogue'});return;}
oldRespondToReadyState.call(response.request,readyState);};}},onComplete:function(aTransport)
{if(Ajax.activeRequestCount===0)
{AjaxIndicator.indicatorElement.hide();}
AjaxIndicator.indicatorElement.setAttribute('title',Ajax.activeRequestCount);}});}};var CmaeonGmaps=Class.create
({POINT_DIAMETER:0.00046,RING_INCREMENT:6,RING_PADDING:0.00015,map:null,mapControl:null,mapTypeControl:null,wpControl:null,geocoder:null,markerManager:null,icons:null,allmarkers:null,_eventListeners:[],_tileData:[],_overlays:[],initialize:function(mapElement,options)
{this.options=options||{};mapElement=mapElement||$("mapElement");if(!window.GMap2)
{return;}
this.map=new GMap2(mapElement);if(!this.options.clustered)
{this.markerManager=new ClusterMarker(this.map,{clusteringEnabled:false});}
else
{this.clusterMarkerClick=this.clusterMarkerClick.bind(this);this.markerManager=new ClusterMarker(this.map,{clusteringEnabled:true,clusterMarkerCustomIcons:true,clusterMarkerIconColor:this.options.iconColor,clusterMarkerIconTextColor:this.options.iconTextColor,maxZoomClusterMarkerClickCallback:this.clusterMarkerClick});}
this.mapControl=new GLargeMapControl3D();if(!this.options.disableMapControl)
{this.map.addControl(this.mapControl);}
this.mapTypeControl=new GMapTypeControl();if(!this.options.disableMapTypeControl)
{this.map.addControl(this.mapTypeControl);}
if(this.options.enableOverviewMapControl)
{var overview=new GOverviewMapControl();this.map.addControl(overview);}
if(this.options.enableWaypointControl&&window.WaypointControl)
{this.wpControl=new WaypointControl();if(this.wpControl._updateNav)
{this.wpControl.backCallback=this.backHistory.bind(this);this.wpControl.forwardCallback=this.forwardHistory.bind(this);this.wpControl.hasBackHistory=this.hasBackHistory.bind(this);this.wpControl.hasForwardHistory=this.hasForwardHistory.bind(this);this.wpControl.updateNav=this.wpControl._updateNav.bind(this.wpControl);this.map.addControl(this.wpControl);GEvent.addListener(this.map,"moveend",this.wpControl.updateNav);GEvent.addListener(this.map,"zoomend",this.wpControl.updateNav);}}
if(!this.options.disableScrollZoom)
{this.map.enableScrollWheelZoom();}
this.map.setCenter(new GLatLng(34,0),1);this.map.addMapType(G_PHYSICAL_MAP);this.geocoder=new CmaeonGGeoCoder();this.icons={};this.allmarkers=[];if(this.options.makeOverlay&&this.options.loadTileData&&this.options.loadInfoWindow)
{this.mouseMove=this.mouseMove.bind(this);GEvent.addListener(this.map,"mousemove",this.mouseMove);this.mouseClick=this.mouseClick.bind(this);GEvent.addListener(this.map,"click",this.mouseClick);}
GEvent.addListener(this.map,"zoomstart",this.map.closeInfoWindow);},makeMarker:function(posn,opts)
{if(!posn)
{return;}
opts=opts||{};opts.title=opts.title||'Click for more information';opts.infoHtml=opts.infoHtml||null;opts.infoHtmlCall=opts.infoHtmlCall||null;opts.showInfo=opts.showInfo||false;opts.zoomLevel=opts.zoomLevel||null;opts.draggable=opts.draggable||false;opts.dragend=opts.dragend||null;var marker=null;var latlng=this.getLatLng(posn);if(this.options.clustered&&!opts.icon)
{opts.icon=this.makeCustomIcon();}
marker=new GMarker(latlng,opts);marker.objectID=opts.objectID||-1;marker.objectType=opts.objectType||'Development';if(opts.infoHtml)
{marker.bindInfoWindowHtml(opts.infoHtml);}
if(opts.infoHtmlCall)
{this._eventListeners.push(GEvent.addListener(marker,'click',function(){opts.infoHtmlCall(marker);}));}
if(opts.dragend)
{GEvent.addListener(marker,"dragend",opts.dragend);}
this.allmarkers.push(marker);if(opts.zoomLevel)
{this.map.setCenter(latlng,opts.zoomLevel);this.map.savePosition();}
if(opts.infoHtml&&opts.showInfo)
{marker.openInfoWindowHtml(opts.infoHtml);}},makeCustomIcon:function(opts)
{opts=opts||{};var iconOptions={};iconOptions.width=opts.diameter||16;iconOptions.height=opts.diameter||16;iconOptions.primaryColor=(opts.color||this.options.iconColor)+'CC';iconOptions.label=opts.label||'1 ';iconOptions.labelSize=opts.labelSize||12;iconOptions.labelColor=opts.labelColor||'#FFFFFF';iconOptions.shape='circle';return MapIconMaker.createFlatIcon(iconOptions);},addMarker:function(posn,opts)
{this.makeMarker(posn,opts);if(this.allmarkers&&this.allmarkers.length)
{this.markerManager.addMarkers(this.allmarkers);this.markerManager.refresh(true);}},addMarkers:function(points,infoHtmlCall)
{if(points)
{var self=this;if(points[0]&&points[0].Location)
{points.sortBy(function(s){return self.getLatLng(s.Location).lat();});}
else if(points[0]&&points[0].location)
{points.sortBy(function(s){return self.getLatLng(s.location[0]).lat();});}
for(var i=0;i<points.length;i++)
{if(points[i])
{var objType=(points[i].itemtype&&points[i].itemtype[0].value=='Property')?'Property':'Development';this.makeMarker((points[i].location?points[i].location[0]:points[i].Location),{objectID:points[i].id,objectType:objType,infoHtmlCall:infoHtmlCall,bndObj:points[i],title:(points[i].Name||points[i].name)});}}}
if(this.allmarkers&&this.allmarkers.length)
{this.markerManager.addMarkers(this.allmarkers);this.markerManager.refresh(true);this.markerManager.fitMapToMarkers();this.map.savePosition();}},getLatLng:function(loca)
{var latlng=new GLatLng(0,0);if(loca)
{if(loca.latitude)
{latlng=new GLatLng(loca.latitude,loca.longitude);}
else if(loca.Latitude)
{latlng=new GLatLng(loca.Latitude,loca.Longitude);}
else if(loca.x)
{latlng=new GLatLng(loca.y,loca.x);}
else if(loca.coordinates)
{latlng=new GLatLng(loca.coordinates[1],loca.coordinates[0]);}}
return latlng;},showMarkers:function()
{this.markerManager.refresh();},findMarkerWithID:function(id)
{for(var i=0;i<this.allmarkers.length;i++)
{if(id==this.allmarkers[i].objectID)
{return this.allmarkers[i];}}},findMarkerAtPoint:function(posn)
{var latlng=this.getLatLng(posn);for(var i=0;i<this.allmarkers.length;i++)
{if(latlng.equals(this.allmarkers[i].getLatLng()))
{return this.allmarkers[i];}}},getObjectIDsFromMarkers:function(markers)
{var ids=[];markers.each(function(marker){ids.push(marker.objectID);});return ids;},getMarkersAtLatLgn:function(latlng)
{var markers=[];for(var i=0;i<this.allmarkers.length&&markers.length<20;i++)
{if(latlng.equals(this.allmarkers[i].getLatLng()))
{markers.push(this.allmarkers[i]);}}
return markers;},getMarkersInBounds:function(bounds)
{bounds=bounds||this.map.getBounds();var markers=[];for(var i=0;i<this.allmarkers.length;i++)
{if(bounds.contains(this.allmarkers[i].getLatLng()))
{markers.push(this.allmarkers[i]);}}
return markers;},countMarkersInBounds:function(bounds)
{return this.getMarkersInBounds(bounds).length;},clearMarkers:function()
{this.allmarkers=[];if(this.markerManager.clearMarkers)
{this.markerManager.clearMarkers();}
if(this.markerManager.removeMarkers)
{this.markerManager.removeMarkers();}
for(i=this._eventListeners.length-1;i>=0;i--)
{GEvent.removeListener(this._eventListeners[i]);}
this._eventListeners=[];},findAddressPoint:function(address,callback)
{this.geocoder.findAddressPoint(address,callback);},findAddressPlacemark:function(address,callback)
{this.geocoder.findAddressPlacemark(address,calback);},getIcon:function(images)
{var icon=null;if(images)
{if(icons[images[0]])
{icon=icons[images[0]];}
else
{icon=new GIcon();icon.image="images/"+images[0]+".png";var size=iconData[images[0]];icon.iconSize=new GSize(size.width,size.height);icon.iconAnchor=new GPoint(size.width>>1,size.height>>1);icon.shadow="images/"+images[1]+".png";size=iconData[images[1]];icon.shadowSize=new GSize(size.width,size.height);icons[images[0]]=icon;}}
return icon;},updateOverlay:function()
{this._tileData=[];if(this._overlays.length>0)
{this.map.removeOverlay(this._overlays[0]);}
if(this.options.makeOverlay)
{this._overlays[0]=this.options.makeOverlay();}
if(this._overlays[0])
{this.map.addOverlay(this._overlays[0]);}},clusterMarkerClick:function(cluster)
{var $markerIconSize=cluster.getIcon().iconSize,$markerWidth=$markerIconSize.width,$markerHeight=$markerIconSize.width,$mapZoomLevel=this.map.getZoom(),$mapProjection=this.map.getCurrentMapType().getProjection(),$mapPointSw,$activeAreaPointSw,$activeAreaLatLngSw,$mapPointNe,$activeAreaPointNe,$activeAreaLatLngNe,$activePoint=cluster.getPoint(),$activeAreaBounds;$mapPointSw=$mapProjection.fromLatLngToPixel($activePoint,$mapZoomLevel);$activeAreaPointSw=new GPoint($mapPointSw.x-$markerWidth/2,$mapPointSw.y+$markerHeight/2);$activeAreaLatLngSw=$mapProjection.fromPixelToLatLng($activeAreaPointSw,$mapZoomLevel);$mapPointNe=$mapProjection.fromLatLngToPixel($activePoint,$mapZoomLevel);$activeAreaPointNe=new GPoint($mapPointNe.x+$markerWidth/2,$mapPointNe.y-$markerHeight/2);$activeAreaLatLngNe=$mapProjection.fromPixelToLatLng($activeAreaPointNe,$mapZoomLevel);$activeAreaBounds=new GLatLngBounds($activeAreaLatLngSw,$activeAreaLatLngNe);var markers=this.getMarkersInBounds($activeAreaBounds);var type='';if(markers.length>0)
{type=markers[0].objectType;}
this.options.clusterMarkerClick(cluster,this.getObjectIDsFromMarkers(markers),type);},mouseClick:function(overlay,mouseLatLng,overlaylatlng)
{var zoom=this.map.getZoom();var mousePx=G_NORMAL_MAP.getProjection().fromLatLngToPixel(mouseLatLng,zoom);var tile=this.getTileNameFromPoint(mousePx);if(this.isBlocking('CLICK_'+tile))
{return;}
if(!this._tileData[zoom])
{this._tileData[zoom]=[];}
var tileObj=this._tileData[zoom][tile];if(!tileObj||tileObj.length===0)
{return;}
var threshold=5+(this.map.getZoom()/2);var contactIDs=[];var latlng=null;for(var n=0;n<tileObj.length;n++)
{var d=Math.sqrt(Math.pow((mousePx.x-tileObj[n].X),2)+Math.pow((mousePx.y-tileObj[n].Y),2));if(d<threshold)
{if(!latlng)
{latlng=G_NORMAL_MAP.getProjection().fromPixelToLatLng(new GPoint(tileObj[n].X,tileObj[n].Y),this.map.getZoom());}
contactIDs.push(tileObj[n].id);}}
if(contactIDs.length>0)
{this.options.loadInfoWindow(contactIDs,latlng);}},mouseMove:function(mouseLatLng)
{var zoom=this.map.getZoom();var mousePx=G_NORMAL_MAP.getProjection().fromLatLngToPixel(mouseLatLng,zoom);var tile=this.getTileNameFromPoint(mousePx);if(this.isBlocking('MOVE_'+tile))
{return;}
if(!this._tileData[zoom])
{this._tileData[zoom]=[];}
if(!this._tileData[zoom][tile])
{this._tileData[zoom][tile]=[];this.options.loadTileData(tile,mousePx,zoom,Math.floor(mousePx.x/256),Math.floor(mousePx.y/256));}
else
{this.checkTileMouseover(zoom,this._tileData[zoom][tile],mousePx);}},loadTileDataHandler:function(zoom,tile,points)
{if(!this._tileData)
{this._tileData=[];}
if(!this._tileData[zoom])
{this._tileData[zoom]=[];}
this._tileData[zoom][tile]=points;},checkTileMouseover:function(zoom,tileData,mousePx)
{if(!tileData||tileData.length===0)
{return;}
var tile=this.getTileNameFromPoint(mousePx);if(this.isBlocking('CLICK_'+tile))
{return;}
var threshold=5+(zoom/2);var isOverlapping=false;for(var n=0;n<tileData.length;n++)
{var d=Math.sqrt(Math.pow((mousePx.x-tileData[n].X),2)+Math.pow((mousePx.y-tileData[n].Y),2));if(d<threshold)
{isOverlapping=true;break;}}
if(isOverlapping)
{this.map.getDragObject().setDraggableCursor('pointer');}
else
{this.map.getDragObject().setDraggableCursor('url(http://maps.gstatic.com/intl/en_ALL/mapfiles/openhand_8_8.cur), default');}},tileDataExists:function(zoom,tile)
{return this._tileData&&this._tileData[zoom]&&this._tileData[zoom][this.getTileNameFromTile(tile)];},getTileNameFromTile:function(point)
{return'T'+point.x+'_'+point.y;},getTileNameFromPoint:function(point)
{return'T'+Math.floor(point.x/256)+'_'+Math.floor(point.y/256);},isBlocking:function(request)
{if(this._overlays.length<1)
{return true;}
var now=new Date();if(!this.lastMovement)
{this.lastMovement=[];}
if(!this.lastMovement[request])
{this.lastMovement[request]=now;return false;}
var last=this.lastMovement[request];var lmUTC=Date.UTC(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),last.getSeconds(),last.getMilliseconds()+50);var nowUTC=Date.UTC(now.getFullYear(),now.getMonth(),now.getDate(),now.getHours(),now.getMinutes(),now.getSeconds(),now.getMilliseconds());if(lmUTC>nowUTC)
{return true;}
this.lastMovement[request]=now;return false;},addPointHistory:function(latlng,zoom)
{this.markerManager.addPointHistory(latlng,zoom);},backHistory:function()
{return this.markerManager.backHistory();},forwardHistory:function()
{return this.markerManager.forwardHistory();},hasBackHistory:function()
{return this.markerManager.hasBackHistory();},hasForwardHistory:function()
{return this.markerManager.hasForwardHistory();}});var CmaeonGGeoCoder=Class.create
({geocoder:null,maxTries:0,tryCount:0,initialize:function()
{this.geocoder=new GClientGeocoder();this.maxTries=5;this.tryCount=0;},findAddressPoint:function(address,callback,retry)
{if(!retry)
{this.tryCount=0;}
this.geocoder.getLatLng(address,function(point)
{if(!point&&(this.tryCount++)<this.maxTries)
{this.findAddressPoint(address,callback,true);}
else if(!point)
{callback({status:'failure'});}
else
{callback({status:'success',point:point});}});},findAddressPlacemark:function(address,callback,retry)
{if(!retry)
{this.tryCount=0;}
this.geocoder.getLocations(address,function(response)
{if((!response||response.Status.code==500)&&(this.tryCount++)<this.maxTries)
{this.findAddressPlacemark(address,callback,true);}
else if(response.Status.code!=200)
{callback({status:'failure'});}
else
{placemark=response.Placemark;callback({status:'success',placemark:placemark});}});},parseGeocodeToAddress:function(response,callbacksObject)
{this.lastGeocode=response;var location=callbacksObject.getNewLocation();if(response.status=='success')
{var placemark=response.placemark[0];parseGeocodeToState=function(spResponse)
{if(!spResponse||spResponse.status!='success')
{return;}
location.StateProvName=spResponse.placemark[0].address.substr(0,spResponse.placemark[0].address.indexOf(','));callbacksObject.populateForm.defer(location);};if(!placemark.AddressDetails||!placemark.AddressDetails.Country||!placemark.Point)
{Dlg.Show('Invalid Address!','Google Maps was unable to parse the location string.  Please check that your address is entered correctly and try again.');}
else
{location.Address=placemark.address.replace(/\./g,'');location.Lat=placemark.Point.coordinates[1];location.Lng=placemark.Point.coordinates[0];location.Accuracy=placemark.AddressDetails.Accuracy;location.CountryName=placemark.AddressDetails.Country.CountryName;location.CountryAbrv=placemark.AddressDetails.Country.CountryNameCode.replace(/\./g,'');if(placemark.AddressDetails.Country.AdministrativeArea&&placemark.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName)
{location.StateProvAbrv=placemark.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName.replace(/\./g,'');location.StateProvName=placemark.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName.replace(/\./g,'');if(location.CountryAbrv=='CA'||location.CountryAbrv=='US')
{this.findAddressPlacemark(location.StateProvAbrv+', '+location.CountryName,parseGeocodeToState);}
var locality=placemark.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea?placemark.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality:placemark.AddressDetails.Country.AdministrativeArea.Locality;if(locality)
{location.CityName=locality.LocalityName?locality.LocalityName:locality.DependentLocality.DependentLocalityName;if(locality.Thoroughfare)
{location.Street=locality.Thoroughfare.ThoroughfareName;}
else
{callbacksObject.populateStreet();}
if(locality.PostalCode)
{location.PostalCode=locality.PostalCode.PostalCodeNumber;}}
else
{City.LoadCitiesByStateProvName(location.StateProvAbrv,location.CountryName,callbacksObject.populateCities);}}
else
{StateProvince.LoadStateProvincesByCountryName(location.CountryName,callbacksObject.populateStateProvs);}}
if(!location.StateProvName||(location.CountryAbrv!='CA'&&location.CountryAbrv!='US'))
{callbacksObject.populateForm.defer(location);}}
else
{Dlg.Show('Invalid Address!','Google Maps was unable to parse the location string.  Please check that your address is entered correctly and try again.');}}});var WaypointControl=function(){};window.setupWaypointControl=function()
{if(!window.GControl)
{return;}
WaypointControl.prototype=new GControl();WaypointControl.prototype.initialize=function(map)
{var container=$(document.createElement("div"));var controls=$(document.createElement("div"));var logoDiv=$(document.createElement("div"));container.addClassName('nav-wrapper');controls.addClassName('nav-controls');logoDiv.addClassName('nav-logo');container.appendChild(controls);container.appendChild(logoDiv);wpControl=this;this.backDiv=$(document.createElement("div"));this.backDiv.addClassName('nav-back');controls.appendChild(this.backDiv);this.backDiv.appendChild(document.createTextNode("Back"));GEvent.addDomListener(this.backDiv,"click",wpControl.backCallback);this.forwardDiv=$(document.createElement("div"));this.forwardDiv.addClassName('nav-forward');controls.appendChild(this.forwardDiv);this.forwardDiv.appendChild(document.createTextNode("Forward"));GEvent.addDomListener(this.forwardDiv,"click",wpControl.forwardCallback);map.getContainer().appendChild(container);return container;};WaypointControl.prototype._updateNav=function()
{if(this.hasBackHistory())
{this.backDiv.addClassName('nav-back-active');}
else
{this.backDiv.removeClassName('nav-back-active');}
if(this.hasForwardHistory())
{this.forwardDiv.addClassName('nav-forward-active');}
else
{this.forwardDiv.removeClassName('nav-forward-active');}};WaypointControl.prototype.getDefaultPosition=function()
{return new GControlPosition(G_ANCHOR_BOTTOM_LEFT);};WaypointControl.prototype.setButtonStyle_=function(button)
{button.style.textDecoration="none";button.style.color="#000000";button.style.backgroundColor="white";button.style.font="small Arial";button.style.border="1px solid black";button.style.padding="2px";button.style.marginBottom="3px";button.style.textAlign="center";button.style.width="6em";button.style.cursor="pointer";};};if(window.google)
{google.setOnLoadCallback(setupWaypointControl);}
var Cookie=new Object();Cookie.CreateCookie=function(aName,aValue,someDays)
{var name=aName;var value=aValue;var expires=false;var path='/';var domain=false;var secure=false;if(someDays)
{expires=new Date();expires.setTime(expires.getTime()+(someDays*24*60*60*1000));}
var curCookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");document.cookie=curCookie;};Cookie.ReadCookie=function(aName)
{var nameEQ=aName+"=";var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++)
{var cookie=cookies[i];while(cookie.charAt(0)===' ')
{cookie=cookie.substring(1,cookie.length);}
if(cookie.indexOf(nameEQ)===0)
{return unescape(cookie.substring(nameEQ.length,cookie.length));}}
return null;};Cookie.EraseCookie=function(aName)
{Cookie.CreateCookie(aName,"",-1);};Date.FullDays=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];Date.FullMonths=['January','February','March','April','May','June','July','August','September','October','November','December'];Date.Days=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];Date.Months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];Date.FromISOString=function(aValue)
{if(aValue&&aValue.toISOString)
{return aValue;}
var result=aValue;if(!!aValue)
{var dateTimeSplit=aValue.split('T');var dateParts=dateTimeSplit[0].split('-');var date=new Date
(Date.Months[parseInt(dateParts[1],10)-1]+' '+
parseInt(dateParts[2],10)+','+
parseInt(dateParts[0],10));if(dateTimeSplit.length>1)
{var timeZoneSplit=dateTimeSplit[1].split('Z');var timeParts=timeZoneSplit[0].split(':');if(timeParts.length==3)
{var secondParts=timeParts[2].split('.');date.setHours(parseInt(timeParts[0],10));date.setMinutes(parseInt(timeParts[1],10));date.setSeconds(parseInt(secondParts[0],10));if(secondParts.length>1)
{date.setMilliseconds(parseInt(secondParts[1],10));}}}
result=date;}
return result;};Date.IsDatePartEqual=function(aDate1,aDate2)
{return(aDate1.getFullYear()==aDate2.getFullYear()&&aDate1.getMonth()==aDate2.getMonth()&&aDate1.getDate()==aDate2.getDate());};Date.prototype.toShortTimeString=function()
{var retVal='';if(this.getHours()===0)
{retVal='12:'+this.getMinutes().toPaddedString(2)+' am';}
else if(this.getHours()<=11)
{retVal=(this.getHours())+':'+this.getMinutes().toPaddedString(2)+' am';}
else if(this.getHours()==12)
{retVal='12:'+this.getMinutes().toPaddedString(2)+' pm';}
else
{retVal=(this.getHours()-12)+':'+this.getMinutes().toPaddedString(2)+' pm';}
return retVal;};Date.prototype.toShortDayMonthString=function()
{return Date.Days[this.getDay()]+' '+Date.Months[this.getMonth()]+'-'+this.getDate();};Date.prototype.toLongDayString=function()
{return Date.FullDays[this.getDay()]+', '+Date.FullMonths[this.getMonth()]+' '+this.getDate();};Date.prototype.toLongDateString=function()
{return Date.FullDays[this.getDay()]+', '+Date.FullMonths[this.getMonth()]+' '+this.getDate()+' '+this.getFullYear();};Date.prototype.toLongDateTimeString=function()
{return this.toShortString()+' '+this.toShortTimeString();};Date.prototype.toExtraLongDateTimeString=function()
{return this.toLongDateString()+' @ '+this.toShortTimeString();};Date.prototype.toShortDateTimeString=function()
{return this.toShortDayMonthString()+' '+this.toShortTimeString();};Date.prototype.toShortString=function()
{return Date.Days[this.getDay()]+' '+Date.Months[this.getMonth()]+'-'+this.getDate()+'-'+this.getFullYear();};Date.prototype.toShortNoDayString=function(){return Date.Months[this.getMonth()]+'-'+this.getDate()+'-'+this.getFullYear();};Date.prototype.isDatePartEqual=function(aDate)
{return(this.getFullYear()==aDate.getFullYear()&&this.getMonth()==aDate.getMonth()&&this.getDate()==aDate.getDate());};Date.prototype.clone=function()
{var ticks=this.getTime();return new Date(ticks);};Date.prototype.addTime=function(hours,minutes,seconds,milliseconds)
{var ticks=this.getTime();if(hours)
{ticks+=1000*60*60*hours;}
if(minutes)
{ticks+=1000*60*minutes;}
if(seconds)
{ticks+=1000*seconds;}
if(milliseconds)
{ticks+=milliseconds;}
this.setTime(ticks);return this;};Date.prototype.addDays=function(days)
{var ticks=this.getTime();ticks+=1000*60*60*24*days;this.setTime(ticks);return this;};Date.prototype.addHours=function(hours)
{var ticks=this.getTime();ticks+=1000*60*60*hours;this.setTime(ticks);return this;};Date.prototype.addMinutes=function(minutes)
{var ticks=this.getTime();ticks+=1000*60*minutes;this.setTime(ticks);return this;};Date.prototype.subtractTime=function(days,hours,minutes,seconds,milliseconds)
{var ticks=this.getTime();if(days)
{ticks-=(1000*60*60*24*days);}
if(hours)
{ticks-=(1000*60*60*hours);}
if(minutes)
{ticks-=(1000*60*minutes);}
if(seconds)
{ticks-=(1000*seconds);}
if(milliseconds)
{ticks-=(milliseconds);}
this.setTime(ticks);return this;};Date.prototype.stripTime=function()
{this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.ToISOString=function()
{var timezoneHours=-this.getTimezoneOffset()/60;var timezoneMinutes=Math.abs(this.getTimezoneOffset()%60);var iso=this.getFullYear().toString()+'-'+
((this.getMonth()<9)?'0':'')+(this.getMonth()+1).toString()+'-'+
((this.getDate()<10)?'0':'')+this.getDate().toString();iso+='T';iso+=((this.getHours()<10)?'0':'')+this.getHours().toString()+':'+
((this.getMinutes()<10)?'0':'')+this.getMinutes().toString()+':'+
((this.getSeconds()<10)?'0':'')+this.getSeconds().toString()+'.'+
this.getMilliseconds().toString();iso+=timezoneHours.toString()+':'+
((timezoneMinutes<10)?'0':'')+timezoneMinutes.toString();return iso;};Date.prototype.millisecondsElapsed=function(aDate)
{var difference=this-aDate;return difference;};Date.prototype.secondsElapsed=function(aDate)
{return Math.floor(this.millisecondsElapsed(aDate)/1000);};Date.prototype.minutesElapsed=function(aDate)
{return Math.floor(this.secondsElapsed(aDate)/60);};Date.prototype.hoursElapsed=function(aDate)
{return Math.floor(this.minutesElapsed(aDate)/60);};Date.prototype.daysElapsed=function(aDate)
{return Math.floor(this.hoursElapsed(aDate)/24);};Date.prototype.timeElapsedFormatted=function(aDate)
{var retSB=new StringBuilder();var seconds=this.secondsElapsed(aDate);var minutes=Math.floor(seconds/60);var hours=Math.floor(minutes/60);var days=Math.floor(hours/24);retSB.append(days+'d ');retSB.append((hours%24)+'h ');retSB.append((minutes%60)+'m ');retSB.append((seconds%60)+'s ');return retSB.toString();};Date.prototype.ToReadableDateString=function()
{var sDate='';sDate+=Date.Months[this.getMonth()];sDate+=' ';sDate+=this.getDate();sDate+=', ';sDate+=this.getFullYear();return sDate;};Date.prototype.ToSQLDateString=function()
{var sDate=this.getFullYear()+'-'+(this.getMonth()+1).toString().padLeft(2,'0')+'-'+this.getDate().toString().padLeft(2,'0');return sDate;};Date.prototype.ToSQLDateTimeString=function()
{var sDate=this.getFullYear()+'-'+(this.getMonth()+1).toString().padLeft(2,'0')+'-'+this.getDate().toString().padLeft(2,'0');sDate+=' ';sDate+=this.getHours().toString().padLeft(2,'0')+':'+this.getMinutes().toString().padLeft(2,'0')+':'+this.getSeconds().toString().padLeft(2,'0')+'.'+this.getMilliseconds().toString().padLeft(3,'0');return sDate;};Date.prototype.ToQueryableDateString=function()
{var sDate='';sDate+=this.getMonth()+1;sDate+='/';sDate+=this.getDate();sDate+='/';sDate+=this.getFullYear();return sDate;};Date.prototype.ToQueryableDateTimeString=function()
{var sDate='';sDate+=this.getMonth()+1;sDate+='/';sDate+=this.getDate();sDate+='/';sDate+=this.getFullYear();sDate+=' ';sDate+=this.toShortTimeString().toUpperCase();return sDate;};Date.prototype.formatDate=function(format)
{format=format+""||"";var result="";var i_format=0;var c="";var token="";var MONTH_NAMES=['January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];var DAY_NAMES=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat'];var LZ=function(x){return(x<0||x>9?"":"0")+x;};var y=this.getYear()+"";var M=this.getMonth()+1;var d=this.getDate();var E=this.getDay();var H=this.getHours();var m=this.getMinutes();var s=this.getSeconds();var value={};if(y.length<4){y=""+(y-0+1900);}
value.y=""+y;value.yyyy=y;value.yy=y.substring(2,4);value.M=M;value.MM=LZ(M);value.MMM=MONTH_NAMES[M-1];value.NNN=MONTH_NAMES[M+11];value.d=d;value.dd=LZ(d);value.ddd=d+(d%10==1?"st":"th");value.dddd=LZ(d)+(d%10==1?"st":"th");value.E=DAY_NAMES[E+7];value.EE=DAY_NAMES[E];value.H=H;value.HH=LZ(H);if(H===0){value.h=12;}
else if(H>12){value.h=H-12;}
else{value.h=H;}
value.hh=LZ(value.h);if(H>11){value.K=H-12;}else{value.K=H;}
value.k=H+1;value.KK=LZ(value.K);value.kk=LZ(value.k);if(H>11){value.A="PM";value.a="pm";value.p="p";}
else{value.A="AM";value.a="am";value.p="a";}
value.m=m;value.mm=LZ(m);value.s=s;value.ss=LZ(s);while(i_format<format.length)
{c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length))
{token+=format.charAt(i_format++);}
if(value[token]!==null&&value[token]!==undefined){result=result+value[token];}
else{result=result+token;}}
return result;};Date.prototype.DaysThisMonth=function()
{return new Date(this.getFullYear(),this.getMonth()+1,0).getDate();};Date.prototype.WeeksThisMonth=function(startOfWeek)
{startOfWeek=1;var firstDayInMonth=new Date(this.getFullYear(),this.getMonth(),1).getDay();var daysInFirstWeek=((startOfWeek+7)-firstDayInMonth)%8;var daysRemaining=this.DaysThisMonth()-daysInFirstWeek;var weeksInMonth=1;while(daysRemaining>0)
{daysRemaining-=7;weeksInMonth++;}
return weeksInMonth;};Date.prototype.Copy=function()
{return new Date(this.getTime());};Date.prototype.getFirstDay=function()
{var date=new Date(this.getFullYear(),this.getMonth(),1);return date.getDay();};Date.prototype.getLastDay=function()
{var date=new Date(this.getFullYear(),this.getMonth()+1,0);return date.getDay();};Date.prototype.getPreviousMonday=function()
{var date=new Date(this.getFullYear(),this.getMonth(),this.getDate());while(date.getDay()!=1)
date=date.addDays(-1);return date;}
Element.addMethods({scrollToElement:function(parent,child,additionalOffset)
{parent.scrollTop=child.cumulativeOffset().top-
parent.cumulativeOffset().top-
(additionalOffset||0);},getVal:function(fieldElement,defaultValue)
{if(fieldElement.type=='checkbox')
{return fieldElement.checked;}
else if(fieldElement.type=='select-multiple')
{return fieldElement.getValue().join(", ");}
else if(fieldElement.value||fieldElement.value===''||fieldElement.value===false||fieldElement.value===0)
{return fieldElement.value;}
else if(fieldElement.innerHTML||fieldElement.innerHTML===''||fieldElement.innerHTML===false||fieldElement.innerHTML===0)
{return fieldElement.innerHTML;}
else
{return defaultValue;}},getParentWithClass:function(element,className)
{var parent=$(element.parentNode);if(parent.nodeName.toLowerCase()=='html')
{return null;}
if(parent.classNames().find(function(s){return(s==className);}))
{return parent;}
return parent.getParentWithClass(className);}});Element.addMethods(['DIV','TABLE','SPAN','A'],{getClassValue:function(container,className,defaultValue)
{if(!container||!className)
{return;}
defaultValue=defaultValue||'';var fieldElement=container.getClassField(className);if(!fieldElement)
{return defaultValue;}
return fieldElement.getVal(defaultValue);},getClassField:function(container,className)
{var fieldElement=container.select('.'+className);if(fieldElement.length<1)
{fieldElement=container.getElementsByClassName(className);}
if(fieldElement.length<1)
{return null;}
return fieldElement[0];},setVisibleByClassName:function(container,className,visible)
{var fields=$(container).select('.'+className);for(var i=0;i<fields.length;i++)
{if(visible)
{fields[i].show();}
else
{fields[i].hide();}}},truncate:function(container,truncLen,makeLink)
{if(!container)
{return;}
var trunc=container.innerHTML;if(trunc.length>truncLen)
{trunc=trunc.substring(0,truncLen);trunc=trunc.replace(/\w+$/,'');if(makeLink)
{trunc+='<a href="#" '+'onclick="this.parentNode.innerHTML='+'unescape(\''+escape(container.innerHTML)+'\');return false;">'+'...<\/a>';}
else
{trunc+='...';}
container.innerHTML=trunc;}}});var URLParser={gup:function(name)
{name=name.replace(/\[/,"\\[").replace(/\]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results===null)
{return"";}
else
{return results[1];}}};var Utl={getAppNamePrefixedURL:function(url)
{if(fwk.APP_NAME.length>1)
{url=fwk.APP_NAME+url;}
return url;},runAjaxCall:function(url,options)
{url=Utl.getAppNamePrefixedURL(url);if(!options.method)
{options.method='get';}
if(!options.responseType){options.responseType='xml';}
new Ajax.Request
(url,{method:options.method,postBody:options.postBody,onSuccess:function(transport)
{var response;try
{if(!transport||transport===null||transport.status===0)
{return;}
if(options.responseType=='xml'&&(!options.evalJSON||options.evalJSON===false))
{response=null;if(transport&&transport.responseXML)
{response=transport.responseXML.documentElement;}
if(!options.validationNodeName||response.nodeName==options.validationNodeName)
{if(options.onSuccess)
{options.onSuccess(response);}}
else
{alert('runAjaxCall - Validationname not found, problem with XML response: '+url);}}
else if(options.responseType=='text'||options.evalJSON===true)
{response=transport.responseText;if(options.evalJSON)
{if(response&&response.length>0)
{response=response.toString().evalJSON();if(options.validationNodeName)
{response=response[options.validationNodeName];}}
else
{response={};}}
if(options.onSuccess)
{options.onSuccess(response);}}
else
{alert('runAjaxCall - No response type set: '+url);Inspect(transport);}}
catch(e)
{}},onFailure:function(transport)
{if(!transport||transport===null||transport.status===0)
{return;}},onComplete:function(transport)
{if(!transport||transport===null||transport.status===0)
{return;}
if(options.onComplete)
{if(transport&&transport.responseXML)
{options.onComplete(transport.responseXML.documentElement);}
else if(transport&&transport.responseText)
{options.onComplete(transport.responseText);}
else
{options.onComplete(transport);}}}});},clearAllChildren:function(element)
{var ele=$(element);if(ele&&ele.innerHTML)
{ele.innerHTML='';}},getInstanceOfTemplate:function(templateId,makeFirstChildRoot,hide)
{try
{var template=$(templateId);if(!template){return null;}
var ieVersion=window.BrowserSupport_?BrowserSupport_.getInternetExplorerVersion():-1;var ourInstance;if(ieVersion<7&&ieVersion!=-1)
{ourInstance=$(document.createElement('div'));ourInstance.innerHTML=template.innerHTML;}
else
{ourInstance=template.cleanWhitespace().cloneNode(true);}
if(makeFirstChildRoot===true)
{ourInstance=$($(ourInstance.cleanWhitespace()).firstChild);}
if(hide===true)
{ourInstance.hide();}
return ourInstance;}
catch(e)
{return null;}},loadExternalReference:function(fileRef)
{if(typeof fileRef!="undefined")
{document.getElementsByTagName("head")[0].appendChild(fileRef);}},loadjsfile:function(filename)
{var fileref=document.createElement('script');fileref.setAttribute("type","text/javascript");fileref.setAttribute("src",filename);Utl.loadExternalReference(fileref);},loadcssfile:function(filename)
{var fileref=document.createElement('link');fileref.setAttribute("type","text/css");fileref.setAttribute("rel","stylesheet");fileref.setAttribute("src",filename);Utl.loadExternalReference(fileref);},isEven:function(num)
{return(num%2)===0;},isOdd:function(num)
{return(num%2)==1;},trim:function(str,chars)
{return Utl.ltrim(Utl.rtrim(str,chars),chars);},ltrim:function(str,chars)
{if(!str){return'';}
chars=chars||"\\s";return str.replace(new RegExp("^["+chars+"]+","g"),"");},rtrim:function(str,chars)
{if(!str){return'';}
chars=chars||"\\s";return str.replace(new RegExp("["+chars+"]+$","g"),"");},padString:function(origval,padvalue,minlength)
{if(!origval){origval='';}
while(origval.length<minlength)
{origval=padvalue+origval;}
return origval;},toArray:function(obj)
{if(Utl.isArray(obj)===false)
{var newArray=[];newArray.push(obj);obj=newArray;}
return obj;},isArray:function(obj)
{if(!obj.constructor)
{return false;}
if(obj.constructor.toString().indexOf('Array')==-1)
{return false;}
else
{return true;}},areArraysEqual:function(array1,array2)
{var temp=new Array();if(!Utl.isArray(array1)||!Utl.isArray(array2))
{return false;}
if(array1.length!=array2.length)
{return false;}
for(var i=0,len=array1.length;i<len;i++)
{key=(typeof array1[i])+"~"+array1[i];if(temp[key]){temp[key]++;}else{temp[key]=1;}}
for(var i=0,len=array2.length;i<len;i++)
{key=(typeof array2[i])+"~"+array2[i];if(temp[key])
{if(temp[key]==0){return false;}else{temp[key]--;}}
else
{return false;}}
return true;},formatCurrency:function(num,showCents)
{if(!num)
{num=0;}
num=num.toString().replace(/\$|\,/g,'');if(isNaN(num)){num="0";}
sign=(num==(num=Math.abs(num)));num=Math.floor(num*100+0.50000000001);cents=num%100;num=Math.floor(num/100).toString();if(cents<10)
{cents="0"+cents;}
for(var i=0;i<Math.floor((num.length-(1+i))/3);i++)
{num=num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));}
num=((sign)?'':'-')+'$'+num;if(showCents)
{num=num+'.'+cents;}
return num;},compareDates:function(x,y)
{var xDate=new Date((x.getMonth()+1)+'/'+x.getDate()+'/'+x.getFullYear()+'/');var yDate=new Date((y.getMonth()+1)+'/'+y.getDate()+'/'+y.getFullYear()+'/');if(xDate.getTime()==yDate.getTime())
{return 0;}
else if(xDate.getTime()>yDate.getTime())
{return 1;}
else
{return-1;}},registerModal:function(modalId)
{var modal=$(modalId);modal.remove();$('dialogues').appendChild(modal);},toSafeDateTimeString:function(aDate)
{var sb=new StringBuilder();sb.append(Utl.padString((aDate.getMonth()+1),'0',2));sb.append('/');sb.append(Utl.padString(aDate.getDate(),'0',2));sb.append('/');sb.append(aDate.getFullYear());sb.append(' ');sb.append(Utl.padString(aDate.getHours(),'0',2));sb.append(':');sb.append(Utl.padString(aDate.getMinutes(),'0',2));sb.append(':');sb.append(Utl.padString(aDate.getSeconds(),'0',2));return sb.toString();},toSafeClassName:function(name)
{if(!name||!name.replace){return'';}
var className=name;className=className.replace(/[ |\/|,|\.]/g,'');return className;},convertXmlToString:function(aNode)
{var content='';var i=0;if(typeof(aNode)=='object')
{if(aNode.nodeType==Node.DOCUMENT_NODE)
{if(!!aNode.documentElement)
{return Utl.convertXmlToString(aNode.documentElement);}
else if(aNode.hasChildNodes())
{$A(aNode.childNodes).each(function(aChildNode)
{content+=Utl.convertXmlToString(aChildNode);});}
else
{content+=aNode;}}
else if(aNode.nodeType==Node.ELEMENT_NODE)
{content+='<'+aNode.nodeName.toLowerCase();for(i=0;i<aNode.attributes.length;i++)
{if(aNode.attributes[i].specified)
{content+=' '+aNode.attributes[i].nodeName+"='"+escape(FixupXmlChars(aNode.attributes[i].value))+"'";}}
if(aNode.childNodes.length>0)
{content+='>';for(i=0;i<aNode.childNodes.length;i++)
{content+=Utl.convertXmlToString(aNode.childNodes[i]);}
content+='</'+aNode.nodeName.toLowerCase()+'>';}
else
{content+='/>';}}
else if(aNode.nodeType==Node.CDATA_SECTION_NODE)
{content+='<!CDATA['+aNode.nodeValue+']]>';}
else if(aNode.nodeType==Node.TEXT_NODE)
{content+=escape(FixupXmlChars(aNode.nodeValue));}
else
{content+=aNode;}}
else
{content+=aNode;}
return content;},filterEnumList:function(list,idAttribute,matchId)
{var retArray=[];if(!list){return retArray;}
for(var i=0;i<list.length;i++)
{if(list[i][idAttribute]==matchId)
{retArray.push(list[i]);}}
return retArray;},getRandomNegativeID:function()
{return Math.round(-10000000*Math.random());}};var UtilPop={populateSelect:function(select,objList,title,name,value,selectedValue)
{if(!select||!select.options){return;}
select.update('');if(title)
{UtilPop.appendOptionIntoSelect(select,title,'-1');UtilPop.appendOptionIntoSelect(select,'--------------------------------','0');}
if(objList&&name&&value)
{UtilPop.appendOptionsIntoSelect(objList,select,name,value,selectedValue||0);}},appendOptionsIntoSelect:function(dataArray,parentSelectElement,displayValueAttribute,valueAttribute,selectedValue)
{for(var i=0;i<dataArray.length;i++)
{var tmp=dataArray[i];var display=tmp[displayValueAttribute];var val=display;if(valueAttribute)
{val=tmp[valueAttribute];}
parentSelectElement.options[parentSelectElement.options.length]=new Option(display,val);if(selectedValue&&selectedValue==val)
{parentSelectElement.options[parentSelectElement.options.length-1].selected=true;}}},appendEnumOptionsIntoSelect:function(dataEnum,parentSelectElement)
{for(var key in dataEnum)
{var display=dataEnum.key;parentSelectElement.options[parentSelectElement.options.length]=new Option(display,key);}},appendEnumPropertiesIntoSelect:function(dataEnum,parentSelectElement)
{for(var property in dataEnum)
{var display=dataEnum[property];parentSelectElement.options[parentSelectElement.options.length]=new Option(display,property);}},appendOptionIntoSelect:function(parentSelectElement,displayValue,dataValue,disabled)
{if(typeof(dataValue)=='undefined')
{dataValue=displayValue;}
parentSelectElement.options[parentSelectElement.options.length]=new Option(displayValue,dataValue);if((typeof(disabled)!='undefined')&&(disabled=='true'))
{parentSelectElement.options[parentSelectElement.options.length-1].disabled=true;}},appendAsCheckBoxes:function(dataArray,parentElement,displayAttr,valueAttr,nameAsClass)
{for(i=0;i<dataArray.length;i++)
{var newLbl=document.createElement('label');if(nameAsClass){newLbl.className=Utl.toSafeClassName(dataArray[i][displayAttr]);}
var newinput=document.createElement('input');newinput.setAttribute('type','checkbox');newinput.className='si_input';newinput.value=dataArray[i][valueAttr];newLbl.appendChild(newinput);newLbl.appendChild(document.createTextNode(dataArray[i][displayAttr]+' '));parentElement.appendChild(newLbl);}},ensureSelectedOptionValid:function(selectElement)
{if(selectElement&&selectElement.type=='change'&&selectElement.target)
{selectElement=selectElement.target;}
if(!selectElement||!selectElement.options||selectElement.options.length<1)
{return false;}
if(!selectElement.selectedIndex&&selectElement.target)
{selectElement=selectElement.target;}
if(selectElement.selectedIndex<2)
{if(!selectElement.oldIndex)
{selectElement.oldIndex=0;}
if(selectElement.selectedIndex==1)
{selectElement.selectedIndex=selectElement.oldIndex;}}
selectElement.oldIndex=selectElement.selectedIndex;return(selectElement.selectedIndex!==0);},performFunctionByClassName:function(container,className,func)
{var fields=$(container).select('.'+className);if(!fields){return;}
for(var i=0;i<fields.length;i++)
{func(fields[i]);}},setImageSourceByClassName:function(container,className,value,defaultValue)
{var fields=$(container).select('.'+className);if(!fields){return;}
for(var i=0;i<fields.length;i++)
{fields[i].src=value||defaultValue||'';}},setFieldsByClassName:function(container,className,value,defaultValue,boolOverride)
{var fields=$(container).select('.'+className);if(!fields){return;}
for(var i=0;i<fields.length;i++)
{UtilPop.setField(fields[i],value,defaultValue,boolOverride);}},setVisibleByClassName:function(container,className,visible)
{var fields=$(container).select('.'+className);if(!fields){return;}
for(var i=0;i<fields.length;i++)
{if(visible)
{fields[i].show();}
else
{fields[i].hide();}}},setLinksByClassName:function(container,className,value,defaultValue,target)
{var fields=$(container).select('.'+className);if(!fields){return;}
for(var i=0;i<fields.length;i++)
{fields[i].href=value||defaultValue||'';if(target)
{fields[i].target=target;}}},observeLinksByClassName:function(container,className,bindObj,bindFunc)
{var fields=$(container).select('.'+className);if(!fields){return;}
for(var i=0;i<fields.length;i++)
{bindFunc(fields[i],bindObj);}},setField:function(fieldElement,value,defaultValue,boolOverride)
{if(!fieldElement){return;}
if((fieldElement.nodeName=='INPUT')||(fieldElement.nodeName=='SELECT')||(fieldElement.nodeName=='BUTTON'))
{if(fieldElement.type=='checkbox')
{UtilPop.setCheckboxValue(fieldElement,value,defaultValue);}
else if(fieldElement.tagName=='SELECT'&&fieldElement.type=='select-multiple')
{UtilPop.setMultiSelectedValue(fieldElement,value.split(', '));}
else if(fieldElement.tagName=='SELECT')
{UtilPop.setDropDownSelectedValue(fieldElement,value,defaultValue);}
else if(fieldElement.value!==undefined)
{UtilPop.setFieldValue(fieldElement,value,defaultValue,boolOverride);}
else
{UtilPop.setFieldInnerHTML(fieldElement,value,defaultValue,boolOverride);}}
else
{UtilPop.setFieldInnerHTML(fieldElement,value,defaultValue,boolOverride);}},setFieldValue:function(fieldElement,value,defaultValue,boolOverride)
{value=UtilPop.getValue(value,boolOverride,defaultValue);fieldElement.value=value;},setFieldInnerHTML:function(fieldElement,value,defaultValue,boolOverride)
{value=UtilPop.getValue(value,boolOverride,defaultValue);fieldElement.innerHTML=UtilPop.escapeHTML(value);},getValue:function(value,boolOverride,defaultValue)
{if(defaultValue===undefined||defaultValue===null){defaultValue='';}
if(value===undefined||value===null){value=defaultValue;}
boolOverride=boolOverride||{t:'',f:''};if(value===true){value=boolOverride.t||value;}
if(value===false){value=boolOverride.f||value;}
return value.toString();},setCheckboxValue:function(fieldElement,value,defaultValue)
{fieldElement.checked=value||defaultValue||false;},setMultiSelectedValue:function(fieldElement,value)
{fieldElement.setValue(value);},setDropDownSelectedValue:function(fieldElement,value,defaultValue)
{fieldElement.value=value;if(fieldElement.value!=value)
{fieldElement.value=defaultValue;if(fieldElement.value!=defaultValue)
{for(var i=0;i<fieldElement.options.length;i++)
{if(fieldElement.options[i].text==value)
{fieldElement.selectedIndex=i;return;}}}
fieldElement.selectedIndex=0;}},escapeHTML:function(str)
{var div=document.createElement('div');var text=document.createTextNode(str);div.appendChild(text);return div.innerHTML;},unescapeHTML:function(str)
{var div=new Element('div');div.update(str);if(div.innerText)
{return div.innerText;}
return div.textContent;}};var UtilParse={getFieldValueByClassName:function(container,className)
{container=$(container);if(!container){return null;}
var fieldElement=container.select('.'+className);if(fieldElement.length>1)
{fieldElement=fieldElement.getElementByClassName(className);}
if(fieldElement.length>1)
{return null;}
return UtilParse.getFieldValue(fieldElement[0]);},getFieldValue:function(fieldElement)
{if(fieldElement.type=='checkbox')
{return fieldElement.checked;}
else if(fieldElement.value||fieldElement.value==''||fieldElement.value===false||fieldElement.value===0)
{return fieldElement.value;}
else if(fieldElement.innerHTML||fieldElement.innerHTML==''||fieldElement.innerHTML===false||fieldElement.innerHTML===0)
{return fieldElement.innerHTML;}
else
{return null;}},getDropDownSelectedText:function(fieldElement)
{return fieldElement.options[fieldElement.selectedIndex].text;}};Array.prototype.remove=function(from,to){var rest=this.slice((to||from)+1||this.length);this.length=from<0?this.length+from:from;return this.push.apply(this,rest);};String.prototype.toTitleCase=function()
{return this.replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase();});};String.prototype.escapeSlashes=function()
{return this.replace(/\\/g,'\\\\');};var imgUtl={buildImagePath:function(relImagePath)
{return fwk.PROD_URL_STATIC+window.FileServer_ImagePath+relImagePath;},buildFilePath:function(relPath)
{return fwk.PROD_URL_STATIC+window.FileServer_FilePath+relPath;},convertImagePathToThumbnailPath:function(relImagePath)
{return imgUtl.forceForwardSlash(imgUtl.buildImagePath('thumbs/'+relImagePath));},convertImagePathToLargeThumbnailPath:function(relImagePath)
{return imgUtl.forceForwardSlash(imgUtl.buildImagePath('large_thumbs/'+relImagePath));},forceForwardSlash:function(path)
{return path.replace(/\\+/g,'/').replace(/%5C/g,'/');},getFileIconImage:function(file)
{if(file.contenttype[0].filetypename=='PDF')
{return fwk.PROD_URL_STATIC+'/includes/images/filetypeicons/icoAcrobat.png';}
else
{return fwk.PROD_URL_STATIC+'/includes/images/filetypeicons/icoGeneric.png';}}};function PrivateGetInspectorDiv(shouldPrepend)
{var inspector=$('inspector');if(!inspector)
{var body=document.body;if(body)
{inspector=new Element('div');inspector.id='inspector';inspector.style.zIndex=5000;inspector.style.clear='both';inspector.style.paddingLeft='50px';inspector.style.paddingRight='50px';if(window.debug===false)
{inspector.hide();}
if(shouldPrepend)
{body.firstChild.insert({before:inspector});}
else
{body.appendChild(inspector);}}}
return inspector;}
function PrivateToggleTables(e)
{var div=e.element();var tables=div.parentNode.select('table');tables.each(Element.toggle);}
function FixupXmlChars(someXML)
{return someXML.replace('"','&quot;').replace("&",'&amp;').replace("'",'&apos;').replace("<",'&lt;').replace(">",'&gt;');}
function ConvertXML(aNode)
{var content='';var i=0;if(typeof(aNode)=='object')
{if(aNode.nodeType==Node.DOCUMENT_NODE)
{if(!!aNode.documentElement)
{return ConvertXML(aNode.documentElement);}
else if(aNode.hasChildNodes())
{$A(aNode.childNodes).each(function(aChildNode)
{content+=ConvertXML(aChildNode);});}
else
{content+=aNode;}}
else if(aNode.nodeType==Node.ELEMENT_NODE)
{content+='<'+aNode.nodeName.toLowerCase();for(i=0;i<aNode.attributes.length;i++)
{if(aNode.attributes[i].specified)
{content+=' '+aNode.attributes[i].nodeName+"='"+escape(FixupXmlChars(aNode.attributes[i].value))+"'";}
else
{content+=' ['+aNode.attributes[i].nodeName+"='"+escape(FixupXmlChars(aNode.attributes[i].value))+"']";}}
if(aNode.childNodes.length>0)
{content+='>';for(i=0;i<aNode.childNodes.length;i++)
{content+=ConvertXML(aNode.childNodes[i]);}
content+='</'+aNode.nodeName.toLowerCase()+'>';}
else
{content+='/>';}}
else if(aNode.nodeType==Node.CDATA_SECTION_NODE)
{content+='<![CDATA['+aNode.nodeValue+']]>';}
else if(aNode.nodeType==Node.TEXT_NODE)
{content+=escape(FixupXmlChars(aNode.nodeValue));}
else
{content+=aNode;}}
else
{content+=aNode;}
return content;}
function ConvertObjectToTable(anObject,aTitle)
{var objectType='no typeof support';try
{objectType=typeof(anObject);if(anObject===null)
{objectType='null';}}
catch(exception){}
var div=new Element('div');div.addClassName('inspection');div.style.border='solid 1px Silver';div.style.zIndex=5000;div.style.width='100%';div.inspectee=anObject;var titleDiv=new Element('div');div.appendChild(titleDiv);titleDiv.addClassName('clearfix');titleDiv.style.width='100%';titleDiv.style.backgroundColor='Cyan';titleDiv.style.textAlign='center';titleDiv.style.fontSize='large';titleDiv.style.cursor='pointer';titleDiv.observe('click',PrivateToggleTables);if(!Inspect.AutoAuditor)
{var auditButton=new Element('button',{'style':'float:left;'}).update('Audit');titleDiv.appendChild(auditButton);auditButton.observe('click',function()
{Inspect.Audit('Inspector',div);auditButton.disabled=true;});}
if(!aTitle)
{if(objectType!='object')
{titleDiv.appendChild(document.createTextNode(objectType));}
else if(!!anObject)
{titleDiv.appendChild(document.createTextNode(anObject.nodeName));}
else
{titleDiv.appendChild(document.createTextNode(anObject));}}
else
{titleDiv.appendChild(document.createTextNode(aTitle+' ['+objectType+']'));}
if((objectType=='object')||(objectType=='undefined'))
{var table=new Element('table');div.appendChild(table);table.hide();var objArray=[];for(var o in anObject)
{objArray.push(o);}
objArray=objArray.sort(function(obj1,obj2)
{if(typeof(obj1)==typeof(obj2))
{if(obj1<obj2)
{return-1;}
else
{return 1;}}
else if(typeof(obj1)=='string')
{return 1;}
else
{return-1;}});$A(objArray).each(function(o)
{try
{var row=$(table.insertRow(-1));var cell=$(row.insertCell(-1));cell.update(o);cell.style.width='20%';cell=$(row.insertCell(-1));var stringContent;var objectType;try
{if(anObject[o]===undefined)
{stringContent=objectType='undefined';}
else if(anObject[o]===null)
{stringContent=objectType='null';}
else
{objectType=typeof(anObject[o]);stringContent=anObject[o].toString();}}
catch(exception)
{stringContent=objectType='unknown';}
if(objectType=='function')
{cell.update('function');cell.style.cursor='pointer';cell.style.backgroundColor='Silver';cell.style.border='1px solid black';cell.observe('click',function(e)
{e.element().stopObserving('click');var insertionPoint=$A(row.parentNode.rows).indexOf(row)+1;var newRow=table.insertRow(insertionPoint);var newCell=newRow.insertCell(-1);var newDiv=document.createElement('div');newCell.colSpan=2;newCell.appendChild(newDiv);newDiv.style.marginLeft='10px';Inspect(stringContent,'function',false,newDiv);});}
else
{stringContent=stringContent.replace(/\r\n/g,'<br/>').replace(/\n/g,'<br/>');stringContent=stringContent.replace(/\\r\\n/g,'<br/>').replace(/\\n/g,'<br/>');stringContent=stringContent.replace(/ /g,'&nbsp;');cell.update(stringContent);if(objectType=='object')
{cell.style.cursor='pointer';cell.style.backgroundColor='Silver';cell.style.border='1px solid black';cell.observe('click',function(e)
{e.element().stopObserving('click');var insertionPoint=$A(row.parentNode.rows).indexOf(row)+1;var newRow=table.insertRow(insertionPoint);var newCell=newRow.insertCell(-1);var newDiv=document.createElement('div');newCell.colSpan=2;newCell.appendChild(newDiv);newDiv.style.marginLeft='10px';Inspect(anObject[o],o,false,newDiv);});}}}
catch(exception){}});}
else if(objectType=='string')
{anObject=unescape(anObject);anObject=anObject.replace(/\r\n/g,'<br/>').replace(/\n/g,'<br/>');if(anObject.length===0)
{anObject='Empty string';}
div.appendChild(document.createTextNode(anObject));}
else
{div.appendChild(document.createTextNode(anObject));}
if(Inspect.AutoAuditor)
{Inspect.Audit('Inspector',div);}
return div;}
function InspectDocumentFragment(aDocumentFragment,aTitle,shouldPrepend,anInspectionDiv)
{var content='';for(var i=0;i<aDocumentFragment.childNodes;i++)
{content+=ConvertXML(aDocumentFragment.childNodes[i])+'\n';}
Inspect(content,aTitle,shouldPrepend,anInspectionDiv);}
function Inspect(anObject,aTitle,shouldPrepend,anInspectionDiv)
{if(!!anObject&&(anObject.nodeType==Node.DOCUMENT_FRAGMENT_NODE))
{InspectDocumentFragment(anObject,aTitle,(shouldPrepend===true),anInspectionDiv);}
else if(anInspectionDiv)
{anInspectionDiv.appendChild(ConvertObjectToTable(anObject,aTitle,anInspectionDiv));}
else
{var inspectorDiv=PrivateGetInspectorDiv(shouldPrepend===true);if(inspectorDiv)
{inspectorDiv.appendChild(ConvertObjectToTable(anObject,aTitle,anInspectionDiv));}
else
{alert('Unable to create inspector div\n'+anObject+'\n'+aTitle);}}}
Inspect.Clear=function()
{PrivateGetInspectorDiv().update();};Inspect.Audit=function(aMessage,anElementOrID)
{new Ajax.Request
('webservices/AuditorService.asmx/addAudit',{method:'post',parameters:{aMessage:aMessage,aPriority:'Error',aLongMessage:ConvertXML($(anElementOrID))},onFailure:function(aTransport)
{Inspect.AutoAuditor=false;Inspect(aTransport,'Inspect.Audit onFailure');}});};Inspect.AutoAuditor=!window.debug;var jsonP={loadData:function(url,callback)
{var scriptID='jsonp'+Math.floor(Math.random()*10001);url+=((url.indexOf('?')<0)?'?callback=jsonP.':'&callback=jsonP.')+scriptID;var script=jsonP.createScriptTag(url);jsonP[scriptID]=function(response)
{if(response.ResponseStatus==200)
{callback(response.ResponseData);}
jsonP[scriptID]=null;document.getElementsByTagName("head")[0].removeChild(script);};document.getElementsByTagName("head")[0].appendChild(script);},createScriptTag:function(url)
{var script=document.createElement('script');script.setAttribute('type','text/javascript');script.setAttribute('src',url);return script;}};(function(){var CHARS='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');Math.uuid=function(len,radix){var chars=CHARS,uuid=[];radix=radix||chars.length;if(len){for(var i=0;i<len;i++)uuid[i]=chars[0|Math.random()*radix];}else{var r;uuid[8]=uuid[13]=uuid[18]=uuid[23]='-';uuid[14]='4';for(var i=0;i<36;i++){if(!uuid[i]){r=0|Math.random()*16;uuid[i]=chars[(i==19)?(r&0x3)|0x8:r];}}}
return uuid.join('');};Math.uuidFast=function(){var chars=CHARS,uuid=new Array(36),rnd=0,r;for(var i=0;i<36;i++){if(i==8||i==13||i==18||i==23){uuid[i]='-';}else if(i==14){uuid[i]='4';}else{if(rnd<=0x02)rnd=0x2000000+(Math.random()*0x1000000)|0;r=rnd&0xf;rnd=rnd>>4;uuid[i]=chars[(i==19)?(r&0x3)|0x8:r];}}
return uuid.join('');};Math.uuidCompact=function(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c=='x'?r:(r&0x3|0x8);return v.toString(16);}).toUpperCase();};})();if(!Prototype||!Node)
alert('PageLoader requires Prototype and Node');if(!document.whenReady)
alert('PageLoader requires document.whenReady, an extension to document that ensures pages are loaded after the DOM');var PageLoader=Class.create();PageLoader.Counter=0;PageLoader.prototype={pageURL:null,pageContentId:null,container:null,onSuccess:null,onFailure:null,initialize:function
(aPageURL,aPageContentId,aLocalElementOrId)
{if(fwk&&fwk.addVersionToURL)
{aPageURL=fwk.addVersionToURL(aPageURL);}
this.pageURL=aPageURL;this.pageContentId=aPageContentId;this.container=$(aLocalElementOrId);},parseLoadedPage:function(responseText)
{try
{if((responseText===undefined)||(responseText===null))
throw('PageLoader.parseLoadedPage exception: responseText is empty');if(!!this.pageContentId)
{var htmlDoc=$(document.createElement('root'));htmlDoc.innerHTML=responseText;htmlDoc=htmlDoc.getElementsBySelector('[id="'+this.pageContentId+'"]')[0];new Insertion.Top(this.container,htmlDoc.innerHTML);}
else
{new Insertion.Top(this.container,responseText);}}
catch(exception)
{Inspect({aPageLoader:this,responseText:responseText,anException:exception},'PageLoader.parseLoadedPage exception',true);}},pageLoadFailure:function(aTransport)
{Inspect(aTransport,'PageLoader failed to load '+this.pageURL);},pageLoadComplete:function(aTransport)
{PageLoader.Counter--;},loadPage:function(asynchronousLoad)
{var pageLoader=this;var ajaxRequest=new Ajax.Request
(this.pageURL,{method:'get',asynchronous:asynchronousLoad,onSuccess:function(aTransport)
{document.whenReady
(function()
{pageLoader.parseLoadedPage(aTransport.responseText);if(pageLoader.onSuccess)
{setTimeout(function()
{try
{pageLoader.onSuccess(pageLoader);}
catch(anException)
{Inspect(anException,'PageLoader.onSuccess callback exception');}},100);}});},onFailure:function(aTransport)
{pageLoader.pageLoadFailure(aTransport);if(pageLoader.onFailure)
{setTimeout
(function()
{try
{pageLoader.onFailure(pageLoader);}
catch(anException)
{Inspect(anException,'PageLoader.onFailure callback exception');}},10);}},onComplete:function(aTransport){pageLoader.pageLoadComplete(aTransport);}});},loadPageExternal:function()
{jsonP.loadData(this.pageURL,this.parseLoadedPage.bind(this));}};PageLoader.Load=function
(aPageURL,aPageContentId,intoAnElementOrId,asynchronousLoad,onSuccess,onFailure)
{document.whenReady
(function()
{PageLoader.Counter++;if(aPageURL.indexOf('?')>=0)
{aPageURL=aPageURL+'&version='+fwk.VERSION;}
else
{aPageURL=aPageURL+'?version='+fwk.VERSION;}
var pageLoader=new PageLoader(aPageURL,aPageContentId,intoAnElementOrId);if(!asynchronousLoad&&(asynchronousLoad!==false))
{asynchronousLoad=true;}
pageLoader.onSuccess=onSuccess;pageLoader.onFailure=onFailure;pageLoader.loadPage(asynchronousLoad);});};var Slideshow=Class.create();Slideshow.ids={};Slideshow.prototype={initialize:function(el,options)
{this.outerBox=el;this.options=options||{};this.decorate();},decorate:function()
{$(this.outerBox).makePositioned();this.innerBox=$(document.createElement("DIV"));this.innerBox.addClassName("slideshow-innerBox clearfix");this.innerBox.style.top="0px";while(this.outerBox.hasChildNodes())
{this.innerBox.appendChild(this.outerBox.firstChild);}
this.controls=$(document.createElement('div'));this.controls.addClassName("slideshow-controls");this.fadeBoxes=this.innerBox.select('.fade-box');this.fadeBoxesControls=[];if(this.fadeBoxes.length>1)
{this.prevLink=this.makeControlLink('<',this.PrevImageEvent.bindAsEventListener(this),this.controls);this.prevLink.addClassName("slideshow-item-select-prev");}
for(var i=0;i<this.fadeBoxes.length;i++)
{this.fadeBoxes[i].index=i;this.fadeBoxes[i].style.position="absolute";this.fadeBoxes[i].control=this.makeControlLink(this.fadeBoxesControls.length+1,this.SwapImageEvent.bindAsEventListener(this,this.fadeBoxes[i]),this.controls);this.fadeBoxesControls.push(this.fadeBoxes[i].control);if(i!==0)
{this.fadeBoxes[i].hide();}
else
{this.SwapImageEvent(null,this.fadeBoxes[i]);}}
if(this.fadeBoxes.length>1)
{this.nextLink=this.makeControlLink('>',this.NextImageEvent.bindAsEventListener(this),this.controls);this.prevLink.addClassName("slideshow-item-select-next");}
this.outerBox.appendChild(this.innerBox);if(this.fadeBoxes.length>1)
{this.outerBox.appendChild(this.controls);}},makeControlLink:function(text,listener,wrapper)
{var link=$(document.createElement('a'));link.addClassName("slideshow-item-select");link.makePositioned();link.appendChild(document.createTextNode(text));wrapper.appendChild(link);link.listener=listener;$(link).observe('click',link.listener);return link;},release:function()
{this.fadeBoxesControls.each(function(control)
{control.stopObserving('click',control.listener);});},PrevImageEvent:function()
{if(this.activeBox.index>0)
{this.SwapImageEvent(null,this.fadeBoxes[this.activeBox.index-1]);}},NextImageEvent:function()
{if(this.activeBox.index<this.fadeBoxes.length-1)
{this.SwapImageEvent(null,this.fadeBoxes[this.activeBox.index+1]);}},SwapImageEvent:function(event,fadeBox)
{fadeBox=$(fadeBox);if(event){Event.stop(event);}
var oldBox=this.activeBox;this.activeBox=fadeBox;if(fadeBox==oldBox){return;}
if(oldBox)
{oldBox.control.removeClassName('active');oldBox.fade({duration:1});}
fadeBox.control.addClassName('active');fadeBox.appear({duration:1});if(this.options.callback)
{this.options.callback(fadeBox);}}};Slideshow.setAll=function(){$$('.makeSlideshow').each(function(item){Slideshow.ids[item.id]=new Slideshow(item);});};Slideshow.reset=function(body_id)
{if($(body_id).className.match(new RegExp(/(^|\s)makeSlideshow(\s|$)/)))
{if(Slideshow.ids[body_id])
{Slideshow.ids[body_id].release();}
Slideshow.ids[body_id]=new Slideshow($(body_id));}};Event.observe(window,"load",Slideshow.setAll);String.prototype.padLeft=function(toLength,usingChar)
{var padded=this;while(padded.length<toLength)
{padded=usingChar+padded;}
return padded;};String.prototype.padRight=function(toLength,usingChar)
{var padded=this;while(padded.length<toLength)
{padded+=usingChar;}
return padded;};var StringBuilder=Class.create({initialize:function(value)
{this.strings=[""];this.append(value);},append:function(value)
{if(value)
{this.strings.push(value);}},clear:function()
{this.strings.length=1;},length:function()
{return this.strings.length-1;},popLast:function()
{var val=this.strings[this.strings.length-1];this.strings.length=this.strings.length-1;return val;},toString:function()
{return this.strings.join("");},constructSentence:function()
{var i=0;snt=[""];for(i=1;i<this.strings.length;i++)
{if(i==this.strings.length-1)
{snt.push(this.strings[i]);snt.push('.');}else if(i==this.strings.length-2)
{snt.push(this.strings[i]);snt.push(' and');}else
{snt.push(this.strings[i]);snt.push(',');}}
return snt.join("");}});var TabbedPanelManager=Class.create();TabbedPanelManager.TabbedPanelManagers=[];TabbedPanelManager.prototype={tabContainer:null,panelContainer:null,onFocusHandlers:null,onBlurHandlers:null,onValidateHandlers:null,onResetHandlers:null,initialize:function(tabsGoHere,panelsGoHere,ignoreKeyDown)
{var manager=this;TabbedPanelManager.TabbedPanelManagers.push(manager);this.tabContainer=$(document.createElement('ul'));this.panelContainer=$(document.createElement('div'));this.onFocusHandlers=[];this.onBlurHandlers=[];this.onValidateHandlers=[];this.onResetHandlers=[];this.tabContainer.addClassName('tabContainer');this.panelContainer.addClassName('panelContainer');this.panelContainer.style.clear='left';var tabsParent=$(tabsGoHere);var panelsParent=$(panelsGoHere);tabsParent.appendChild(this.tabContainer);panelsParent.appendChild(this.panelContainer);if(!ignoreKeyDown)
{Event.observe(document,'keydown',function(anEvent){manager.keyDown(anEvent);});}},addPanel:function
(aPanelURI,aPanelContentID,aTabName,aUniqueName,onLoad)
{var manager=this;var tab=$(document.createElement('li'));var span=$(document.createElement('span'));var tabName=$(document.createTextNode(aTabName));var panel=$(document.createElement('div'));tab.appendChild(span);if(!aUniqueName)
{aUniqueName=aTabName;}
span.appendChild(tabName);tab.uniqueName=aUniqueName;panel.addClassName('panel');this.onFocusHandlers=this.onFocusHandlers.concat(null);this.onBlurHandlers=this.onBlurHandlers.concat(null);this.onValidateHandlers=this.onValidateHandlers.concat(null);this.onResetHandlers=this.onResetHandlers.concat(null);Event.observe(tab,'click',function(anEvent){manager.tabClicked(anEvent);});this.tabContainer.appendChild(tab);if(this.tabContainer.childNodes.length==1)
{tab.addClassName('active');}
else
{panel.hide();}
this.panelContainer.appendChild(panel);if(aPanelURI)
{if(onLoad)
{PageLoader.Load(aPanelURI,aPanelContentID,panel,true,function(aPageLoader)
{onLoad(tab);});}
else
{PageLoader.Load(aPanelURI,aPanelContentID,panel);}}
else if(onLoad)
{onLoad(tab);}
return tab;},updatePanel:function(aPanelURI,aPanelContentID,aTabName,aUniqueName)
{if(!aUniqueName)
{aUniqueName=aTabName;}
var tabIdx=this.getTabIndex(aUniqueName);var panel=this.panelContainer.childNodes[tabIdx];Utl.clearAllChildren(panel);PageLoader.Load(aPanelURI,aPanelContentID,panel);},getTabForElement:function(anElement)
{var index=$A(this.panelContainer.childNodes).indexOf(this.getPanelForElement(anElement));if(index!=-1)
{return this.tabContainer.childNodes[index];}
else
{return null;}},getPanelForElement:function(anElement)
{var panel;anElement=$(anElement);if(anElement&&anElement.hasClassName)
{if(anElement.hasClassName('panel'))
{panel=anElement;}
else
{panel=anElement.up('.panel');}}
return panel;},isCurrentTabName:function(aUniqueName)
{return this.getTabIndex(aUniqueName)==$A(this.tabContainer.childNodes).indexOf(this.getCurrentTab());},getCurrentTab:function()
{var activeTabs=this.tabContainer.select('.active');if(activeTabs.length==1)
{return activeTabs[0];}
else
{return null;}},getCurrentPanel:function()
{var tabs=this.tabContainer.childNodes;var currentTab=this.getCurrentTab();var currentIndex=$A(tabs).indexOf(currentTab);return this.panelContainer.childNodes[currentIndex];},getPanelFromTabName:function(aUniqueName)
{return this.getPanelForTab(this.getTab(this.getTabIndex(aUniqueName)));},getPanelForTab:function(aTab)
{var tabIndex=$A(this.tabContainer.childNodes).indexOf(aTab);return this.panelContainer.childNodes[tabIndex];},getTab:function(aTabIndex)
{if(this.tabContainer.childNodes.length>aTabIndex)
{return this.tabContainer.childNodes[aTabIndex];}
else
{return null;}},getTabIndex:function(aTabOrUniqueName)
{var tabs=this.tabContainer.childNodes;var tabIndex=-1;if(!aTabOrUniqueName.nodeName)
{$A(tabs).each
(function(aTab,aTabIndex)
{tabIndex=aTabIndex;if(aTab.uniqueName==aTabOrUniqueName)
{throw $break;}});if(tabIndex>=0&&(tabIndex==(tabs.length-1))&&(tabs[tabIndex].uniqueName!=aTabOrUniqueName))
{tabIndex=-1;}}
else
{tabIndex=$A(tabs).indexOf(aTabOrUniqueName);}
return tabIndex;},removeTab:function(aTabOrUniqueName)
{if(this.tabContainer.childNodes.length>1)
{var index=this.getTabIndex(aTabOrUniqueName);var tab=this.getTab(index);var currentTab=this.getCurrentTab();if(tab==currentTab)
{var newIndex=index+1;if(newIndex==this.tabContainer.childNodes.length)
{newIndex=-1;}
this.gotoTab(this.tabContainer.childNodes[newIndex]);}
$(this.tabContainer.childNodes[index]).remove();$(this.panelContainer.childNodes[index]).remove();}},showTab:function(aTabUniqueName)
{this.setTabVisibility(aTabUniqueName,true);},hideTab:function(aTabUniqueName)
{this.setTabVisibility(aTabUniqueName,false);},setTabVisibility:function(aTabUniqueName,visible)
{var idx=this.getTabIndex(aTabUniqueName);if(!idx){return null;}
var currentTab=this.getCurrentTab();if(this.getTabIndex(currentTab)==idx&&!visible)
{for(var i=0;i<this.tabContainer.childNodes.length;i++)
{var newTab=this.tabContainer.childNodes[i];if(newTab.visible()&&newTab!=currentTab)
{this.gotoTab(newTab);}}}
if(visible)
{$(this.tabContainer.childNodes[idx]).show();}
else
{$(this.tabContainer.childNodes[idx]).hide();$(this.panelContainer.childNodes[idx]).hide();}},setOnFocusHandler:function(aTabOrUniqueName,aHandler)
{var tabIndex=this.getTabIndex(aTabOrUniqueName);if(tabIndex!=-1)
{this.onFocusHandlers[tabIndex]=aHandler;if(tabIndex===0)
{aHandler(this);}}},setOnBlurHandler:function(aTabOrUniqueName,aHandler)
{var tabIndex=this.getTabIndex(aTabOrUniqueName);if(tabIndex!=-1)
{this.onBlurHandlers[tabIndex]=aHandler;}},setOnValidateHandler:function(aTabOrUniqueName,aHandler)
{var tabIndex=this.getTabIndex(aTabOrUniqueName);if(tabIndex!=-1)
{this.onValidateHandlers[tabIndex]=aHandler;}},setOnResetHandler:function(aTabOrUniqueName,aHandler)
{var tabIndex=this.getTabIndex(aTabOrUniqueName);if(tabIndex!=-1)
{this.onResetHandlers[tabIndex]=aHandler;}},resetPanels:function()
{for(var i=0;i<this.onResetHandlers.length;i++)
{if(!!this.onResetHandlers[i])
{this.onResetHandlers[i](this);}}},checkPanelIsValid:function()
{var tabs=this.tabContainer.childNodes;var currentTab=this.getCurrentTab();var currentIndex=$A(tabs).indexOf(currentTab);var validationHandler=this.onValidateHandlers[currentIndex];return(!validationHandler||validationHandler(this));},tabClicked:function(anEvent)
{var tab=Event.element(anEvent);if($A(this.tabContainer.childNodes).indexOf(tab)==-1)
{tab=tab.parentNode;}
this.gotoTab(tab);},keyDown:function(keyEvent)
{if(!keyEvent.ctrlKey&&!keyEvent.shiftKey&&!keyEvent.altKey)
{if(keyEvent.keyCode==Event.KEY_PAGEDOWN)
{this.nextTab();Event.stop(keyEvent);}
else if(keyEvent.keyCode==Event.KEY_PAGEUP)
{this.previousTab();Event.stop(keyEvent);}}},nextTab:function()
{var tabs=this.tabContainer.childNodes;var currentTab=this.getCurrentTab();var newIndex=($A(tabs).indexOf(currentTab)+1)%tabs.length;this.gotoTab(tabs[newIndex]);},previousTab:function()
{var tabs=this.tabContainer.childNodes;var currentTab=this.getCurrentTab();var newIndex=(tabs.length+$A(tabs).indexOf(currentTab)-1)%tabs.length;this.gotoTab(tabs[newIndex]);},gotoTab:function(aTabOrUniqueName)
{var newTab;var newTabIndex=this.getTabIndex(aTabOrUniqueName);if((newTabIndex!=-1)&&this.checkPanelIsValid())
{var tabs=this.tabContainer.childNodes;var currentTab=this.getCurrentTab();var currentIndex=$A(tabs).indexOf(currentTab);if(newTabIndex!=currentIndex)
{newTab=tabs[newTabIndex];var panels=this.panelContainer.childNodes;var currentPanel=panels[currentIndex];var blurHandler=this.onBlurHandlers[currentIndex];var focusHandler=this.onFocusHandlers[newTabIndex];currentTab.removeClassName('active');currentPanel.hide();currentTab=tabs[newTabIndex];currentPanel=panels[newTabIndex];currentTab.addClassName('active');currentPanel.show();if(!!blurHandler)
{blurHandler(this);}
if(!!focusHandler)
{focusHandler(this);}}
newTab=currentTab;}
return newTab;},refocusPanel:function()
{var tabs=this.tabContainer.childNodes;var currentTab=this.getCurrentTab();var currentIndex=$A(tabs).indexOf(currentTab);var focusHandler=this.onFocusHandlers[currentIndex];if(!!focusHandler)
{focusHandler(this);}},getTabCount:function(){var count=this.tabContainer.childNodes.length;return count;},getPanelForTab:function(aTab){var index=$A(this.tabContainer.childNodes).indexOf(aTab);if(index<0)return false;var panel=this.panelContainer.childNodes[index];return panel;},removeTabAndHandlers:function(aTabOrUniqueName){if(this.tabContainer.childNodes.length>1){var index=this.getTabIndex(aTabOrUniqueName);var tab=this.getTab(index);var currentTab=this.getCurrentTab();var currentIndex=this.getTabIndex(currentTab);if(tab==currentTab){var newIndex=index+1;if(newIndex==this.tabContainer.childNodes.length)
newIndex=-1;this.gotoTab(this.tabContainer.childNodes[newIndex]);}
$(this.tabContainer.childNodes[index]).remove();$(this.panelContainer.childNodes[index]).remove();this.onFocusHandlers.splice(index,1);this.onBlurHandlers.splice(index,1);this.onValidateHandlers.splice(index,1);this.onResetHandlers.splice(index,1);}},insertPanel:function(aPanelURI,aPanelContentID,aTabName,atIndex,aUniqueName,onLoad){if(atIndex<0||atIndex>this.tabContainer.childNodes.length)
return;if(atIndex==this.tabContainer.childNodes.length){var tab=this.addPanel(aPanelURI,aPanelContentID,aTabName,aUniqueName,onLoad)
return tab;}
var manager=this;var tab=$(document.createElement('li'));var span=$(document.createElement('span'));var tabName=$(document.createTextNode(aTabName));var panel=$(document.createElement('div'));tab.appendChild(span);if(!aUniqueName)
aUniqueName=aTabName;span.appendChild(tabName);tab.uniqueName=aUniqueName;panel.addClassName('panel');this.onFocusHandlers.splice(atIndex,0,null);this.onBlurHandlers.splice(atIndex,0,null);this.onValidateHandlers.splice(atIndex,0,null);this.onResetHandlers.splice(atIndex,0,null);Event.observe
(tab,'click',function(anEvent){manager.tabClicked(anEvent);});this.tabContainer.childNodes[atIndex].insert({before:tab});this.panelContainer.childNodes[atIndex].insert({before:panel});if(this.tabContainer.childNodes.length==1)
tab.addClassName('active');else
panel.hide();if(aPanelURI)
if(onLoad){PageLoader.Load
(aPanelURI,aPanelContentID,panel,true,function(aPageLoader){onLoad(tab);});}
else
PageLoader.Load(aPanelURI,aPanelContentID,panel);else if(onLoad)
onLoad(tab);return tab;}};TabbedPanelManager.FindManagerForElement=function(anElement)
{var manager=TabbedPanelManager.TabbedPanelManagers.find(function(aManager){return(aManager.getTabForElement(anElement)!==null);});return manager;};var Updater=Class.create
({version:0.1,className:'Updater',initialize:function()
{},handleDisplay:function(anElement,aModel,aPropertyName)
{var dashIndex=aPropertyName.indexOf('-');if(dashIndex>=0)
{var parsedName=aPropertyName.substring(0,dashIndex);var toParse=aPropertyName.substring(dashIndex+1);if(aModel[parsedName])
{this.handleDisplay(anElement,aModel[parsedName],toParse);}
return;}
switch(typeof(aModel[aPropertyName]))
{case'object':if(aModel[aPropertyName])
{this.updateObjects([anElement],aModel[aPropertyName]);}
else
{this.updateStrings([anElement],'');}
break;case'function':this.updateFunctions([anElement],aModel,aPropertyName);break;default:if(typeof(aModel[aPropertyName])!='undefined')
{this.updateStrings([anElement],aModel[aPropertyName]);}
else
{this.updateStrings([anElement],'');}
break;}},handleSave:function(anElement,aModel,aPropertyName)
{var name=aPropertyName.substring(0,aPropertyName.indexOf('_'));aPropertyName=aPropertyName.replace(name+'_','');switch(typeof(aModel[aPropertyName]))
{case'object':if(aModel[aPropertyName]!==null)
{anElement[name]=aModel[aPropertyName];}
else
{anElement[name]='';}
break;case'function':anElement[name]=aModel[aPropertyName]();break;default:anElement[name]=aModel[aPropertyName];break;}},updateStrings:function(someElements,aString)
{try
{someElements.each(function(anElement)
{if(anElement.hasClassName('asDate'))
{var date=Date.FromISOString(aString);if(date)
{aString=date.toShortString();anElement.date=date;}}
else if(anElement.hasClassName('asShortDate'))
{var date=Date.FromISOString(aString);if(date){aString=date.toShortNoDayString();anElement.date=date;}}
else if(anElement.hasClassName('asEmail'))
{aString="<a href='mailto:"+aString+"'>"+aString+"</a>";}
else if(anElement.hasClassName('asPhone'))
{aString="<a href='tel:"+aString+"'>"+aString+"</a>";}
else if(anElement.hasClassName('asMultiline'))
{aString=aString.replace(/\n/g,'<br/>');}
else if(anElement.hasClassName('asURL'))
{anElement.observe('click',function(anEvent)
{if(anEvent.ctrlKey&&!anEvent.shiftKey&&!anEvent.altKey)
{anEvent.stop();var element=Event.element(anEvent);var url=element.getVal();if(url)
{window.open(url);}}});}
else if(anElement.hasClassName('asMoney'))
{var money=parseFloat(aString);if(money)
{aString=money.toFixed(2);aString='$'+aString;}}
else if(anElement.hasClassName('asPrice')){var price=parseFloat(aString);if(price==0)
{aString='$0.0000';}
else if(price)
{aString=price.toFixed(4);aString='$'+aString;}}
else if(anElement.hasClassName('asUnit')){var unit=parseFloat(aString);if(unit==0)
{aString='0.0000';}
else if(unit)
{aString=unit.toFixed(4);}}
else if(anElement.hasClassName('asRate')){var rate=parseFloat(aString);if(rate==0)
{aString='0.0000%';}
else if(rate)
{aString=(rate*100).toFixed(4);aString=aString+'%';}}
else if(anElement.hasClassName('asBool'))
{if(aString.toString().toLowerCase()==true.toString())
{aString='Yes';}
else
{aString='No';}}
if((anElement.nodeName=='INPUT')||(anElement.nodeName=='SELECT')||(anElement.nodeName=='BUTTON'))
{anElement.setValue(aString);}
else
{anElement.update(aString);}});}
catch(anException)
{Inspect
({exception:anException,someElements:someElements,aModel:aModel,aFunctionName:aFunctionName},'Updater.updateStrings exception');throw anException;}},updateFunctions:function(someElements,aModel,aFunctionName)
{try
{var updater=this;someElements.each(function(anElement)
{if(anElement.hasClassName('exec'))
{aModel[aFunctionName](anElement);}
else
{updater.updateStrings([anElement],aModel[aFunctionName](anElement).toString());}});}
catch(anException)
{Inspect
({exception:anException,someElements:someElements,aModel:aModel,aFunctionName:aFunctionName},'Updater.updateFunctions exception');throw anException;}},updateObjects:function(someElements,anObject)
{someElements.each(function(anElement)
{var value=anObject;if(anElement.hasClassName('asDate'))
{value=anObject.ToReadableDateString();}
else if(anElement.hasClassName('asShortDate'))
{value=anObject.toShortNoDayString();}
if((anElement.nodeName=='INPUT')||(anElement.nodeName=='SELECT')||(anElement.nodeName=='BUTTON'))
{anElement.setValue(value);}
else
{anElement.update(value);}});},updateWithModel:function(aRootElement,aClassRoot,aModel)
{var update=this;var updateClass='.'+aClassRoot+(typeof(aModel.className)!='undefined'?aModel.className:'');var updateElements=aRootElement.select(updateClass);updateElements.each(function(anElement)
{var classes=$w(anElement.className);classes.each(function(aClass)
{if(aClass.startsWith('display_'))
{update.handleDisplay(anElement,aModel,aClass.replace('display_',''));}
else if(aClass.startsWith('save_'))
{update.handleSave(anElement,aModel,aClass.replace('save_',''));}});});},updateFromEdits:function(aRootElement,aClassRoot,aModel)
{var hasUpdates=true;var edits=aRootElement.select('.gadget_editor');var updateClassPreface=(typeof(aModel.className)!='undefined'?aModel.className:'');edits.each(function(anEdit){anEdit.editor.save();});return hasUpdates;}});var Validator=Class.create({initialize:function(validationHandler)
{this.validationHandler=validationHandler||this.setFieldValidation;this.validationItems=[];this.validationErrors=[];this.isValid=true;},addItemClass:function(form,className,options,custMsg)
{form=$(form);if(!form){return;}
var fields=form.select('.'+className);for(var i=0;i<fields.length;i++)
{this.addItem(fields[i],options,custMsg);}},add:function(field,options,custMsg)
{if(!field){return;}
this.validationItems.push({field:field,options:options,custMsg:custMsg});},addItem:function(field,options,custMsg)
{this.add(field,options,custMsg);},validate:function()
{this.isValid=true;this.validationErrors=[];for(j=this.validationItems.length-1;j>=0;j--)
{this.isValid=this.validateField(this.validationItems[j].field,this.validationItems[j].options,this.validationItems[j].custMsg)&&this.isValid;}
this.validationErrors=this.validationErrors.reverse();return this.isValid;},validationErrorsAsList:function()
{sbMsg=new StringBuilder();if(this.validationErrors!==null&&this.validationErrors.length>0)
{sbMsg.append("<ul>");for(i=0;i<this.validationErrors.length;i++)
{sbMsg.append("<li>");sbMsg.append(this.validationErrors[i]);sbMsg.append("</li>");}
sbMsg.append("</ul>");}
return sbMsg.toString();},validationErrorsAsString:function()
{sbMsg=new StringBuilder();if(this.validationErrors!==null&&this.validationErrors.length>0)
{for(i=0;i<this.validationErrors.length;i++)
{sbMsg.append(this.validationErrors[i]);sbMsg.append(" ");}}
return sbMsg.toString();},setFieldValidation:function(field,isValid)
{if(isValid)
{if(field.removeClassName)
{field.removeClassName('invalid');}}
else
{if(field.addClassName)
{field.addClassName('invalid');}
if(field.focus&&field.visible&&field.visible())
{try
{field.focus();}
catch(ex){}}}},resetValidationFields:function()
{for(var i=0;i<this.validationItems.length;i++)
{for(var j=0;j<this.validationItems[i].field.length;j++)
{this.setFieldValidation(this.validationItems[i].field[j],true);}}},REGEX:{isNumeric:/^(-)?(\d*)(\.?)(\d*)$/,isInteger:/^(-)?(\d*)$/,isAlpha:/^[a-zA-Z]*$/,isAlphaNumeric:/^[a-zA-Z0-9\&\"\'\.\-,_]*[\sa-zA-Z0-9\&\"\'\.\-,_]*[a-zA-Z0-9\&\"\'\.\-,_]+$/,zipCode:/\d{5}(-\d{4})?/,phoneNumber:/^((\+\d{1,3}(-| |\.)?\(?\d\)?(-| |\.)?\d{1,5})|(\(?\d{2,6}\)?))(-| |\.)?(\d{3,4})(-| |\.)?(\d{4})(( x| ext)\d{1,5}){0,1}$/,phoneNumberInternational:/^\d(\d|-){7,20}/,currency:/\$\d{1,3}(,\d{3})*\.\d{2}/,time:/^([1-9]|1[0-2]):[0-5]\d$/,emailAddress:/^[a-zA-Z0-9!#$%&*+\/=?\^_`{|}~\-]+(?:\.[a-zA-Z0-9!#$%&*+\/=?\^_`{|}~\-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?\.)+(?:[a-zA-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)$/,ipAddress:/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,date:/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}( (\d|0\d|1[0-2]):[0-5]\d(:[0-5]\d)? (AM|PM|am|pm))?$/,state:/^(AK|AL|AR|AZ|CA|CO|CT|DC|DE|FL|GA|HI|IA|ID|IL|IN|KS|KY|LA|MA|MD|ME|MI|MN|MO|MS|MT|NB|NC|ND|NH|NJ|NM|NV|NY|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VA|VT|WA|WI|WV|WY)$/i,province:/^(AB|BC|MB|MB|NF|NT|NS|NU|ON|PE|QC|SK|YT)$/i,SSN:/^\d{3}\-\d{2}\-\d{4}$/,username:/^[a-zA-Z]+[\.\_\-a-zA-Z0-9]{5,}$/,noSpaces:/\s+/},customExpression:function(re,param)
{return param.toString().match(re)!==null;},required:function(param)
{return param!=''&&param!==null;},compare:function(param1,param2)
{return param1==param2;},email:function(param)
{return this.customExpression(this.REGEX.emailAddress,param);},phone:function(param)
{return this.customExpression(this.REGEX.phoneNumber,param);},isAlpha:function(param)
{return this.customExpression(this.REGEX.isAlpha,param);},isAlphaNumeric:function(param)
{return this.customExpression(this.REGEX.isAlphaNumeric,param);},noSpaces:function(param)
{return!this.customExpression(this.REGEX.noSpaces,param);},isNumeric:function(param)
{if(param===0)
{return true;}
else if(!param)
{return false;}
return this.customExpression(this.REGEX.isNumeric,param);},isInteger:function(param)
{if(param===0)
{return true;}
else if(!param)
{return false;}
return this.customExpression(this.REGEX.isInteger,param);},date:function(param)
{return!isNaN(Date.parse(param));},username:function(param)
{return this.customExpression(this.REGEX.username,param);},range:function(param,minVal,maxVal)
{return this.min(param,minVal)&&this.max(param,maxVal);},min:function(param,min)
{return this.isNumeric(param)&&param>=min;},max:function(param,max)
{return this.isNumeric(param)&&param<=max;},rangeLength:function(param,minVal,maxVal)
{return param&&this.range(param.length,minVal,maxVal);},minLength:function(param,min)
{return param&&this.min(param.length,min);},maxLength:function(param,max)
{return param&&this.max(param.length,max);},validateField:function(field,options,custMsg)
{if(!field)
{alert('developer: missing field to validate');return false;}
var defMsg=new StringBuilder();var isValid=true;if(options)
{if(options.custom)
{if(!this.customExpression(options.custom,field.value))
{defMsg.append(" is invalid");}}
if(options.required)
{if(!this.required(field.value))
{defMsg.append(" is a required field");}}
if(options.compare&&field)
{if(!this.compare(field.value,options.compare))
{defMsg.append(" must match <span>"+options.matchName+"</span>");}}
if(options.different&&field)
{if(this.compare(field.value,options.different))
{defMsg.append(" must not match <span>"+options.matchName+"</span>");}}
if(options.isAlpha)
{if(field.value!=""&&!this.isAlpha(field.value))
{defMsg.append(" must contain only letters");}}
if(options.noSpaces)
{if(field.value!=""&&!this.noSpaces(field.value))
{defMsg.append(" may not contain spaces");}}
if(options.isNumeric)
{if(field.value!=""&&!this.isNumeric(field.value))
{defMsg.append(" must be a number");}}
if(options.isInteger)
{if(field.value!=""&&!this.isInteger(field.value))
{defMsg.append(" must be an Integer");}}
if(options.isAlphaNumeric)
{if(field.value!=""&&!this.isAlphaNumeric(field.value))
{defMsg.append(" must be alpha numeric (including . , _ - \" ' &)");}}
if(options.email)
{if(field.value!=""&&!this.email(field.value))
{defMsg.append(" must be a valid email address");}}
if(options.phone)
{if(field.value!=""&&!this.phone(field.value))
{defMsg.append(" must be a valid phone number");}}
if(options.date)
{if(field.value!=""&&!this.date(field.value))
{defMsg.append(" must be a valid date mm/dd/yyyy");}}
if(options.username)
{if(!this.username(field.value))
{defMsg.append(" may only contain alpha-numeric characters (including . _ -), start with a letter and be at least 6 characters long");}}
if(options.checked)
{if(!field.checked)
{defMsg.append(" must be checked");}}
if(this.isNumeric(options.minLength)&&this.isNumeric(options.maxLength))
{if(!this.rangeLength(field.value,options.minLength,options.maxLength))
{defMsg.append(" must be between "+options.minLength+" and "+options.maxLength+" characters long");}}else if(this.isNumeric(options.minLength))
{if(!this.minLength(field.value,options.minLength))
{defMsg.append(" must be at least "+options.minLength+" characters long");}}else if(this.isNumeric(options.maxLength))
{if(!this.maxLength(field.value,options.maxLength))
{defMsg.append(" must be no more than "+options.maxLength+" characters long");}}
if(this.isNumeric(options.min)&&this.isNumeric(options.max))
{if(!this.range(field.value,options.min,options.max))
{defMsg.append(" must be between "+options.min+" and "+options.max);}}else if(this.isNumeric(options.min))
{if(!this.min(field.value,options.min))
{defMsg.append(" must be at least "+options.min);}}else if(this.isNumeric(options.max))
{if(!this.max(field.value,options.max))
{defMsg.append(" must be no more than "+options.max);}}
if(this.isNumeric(options.minSelectedIndex)&&this.isNumeric(options.maxSelectedIndex))
{if(!this.range(field.selectedIndex,options.minSelectedIndex,options.maxSelectedIndex))
{defMsg.append(" requires a valid selection");}}
else if(this.isNumeric(options.minSelectedIndex))
{if(!this.min(field.selectedIndex,options.minSelectedIndex))
{defMsg.append(" requires a valid selection");}}
else if(this.isNumeric(options.maxSelectedIndex))
{if(!this.max(field.selectedIndex,options.maxSelectedIndex))
{defMsg.append(" requires a valid selection");}}}
else
{return true;}
message="";if(defMsg.length()>0)
{isValid=false;if(custMsg)
{message=custMsg;}
else
{message='<span>'+field.name+'</span>'+defMsg.constructSentence();}
this.validationErrors.push(message);}
if(typeof this.validationHandler=="function")
{this.validationHandler(field,isValid);}
return isValid;}});var ImageViewer={currentImageReference:null,aImageReferences:new Array(),BindLink:function(imageLink,anImageReference)
{Event.observe(imageLink,'click',function(args)
{ImageViewer.Show(anImageReference);});},Show:function(anImageReference)
{if((typeof anImageReference)=='string')
{anImageReference={imagepath:anImageReference,tooltip:'',imagereferenceid:'-1'};}
var imageViewer=$('dyn_imageviewer_dialogue');Dlg.ShowPreformatted(imageViewer,{but_ok:false});ImageViewer.setImage(anImageReference);ImageViewer.showNav();Dlg.observe(Dlg.modalDialogue.overlay,'click',Dlg.hide)},setImage:function(anImageReference)
{ImageViewer.currentImageReference=anImageReference;var imageViewer=Dlg.textMessage;var img=imageViewer.getElementsByClassName('dyn_image')[0];img.src=imgUtl.buildImagePath(anImageReference.imagepath);img.title=anImageReference.tooltip;img.alt=anImageReference.tooltip;},onImageLoaded:function()
{if(window.Dlg&&Dlg.modalDialogue)
{Dlg.modalDialogue.adjustForResize();}},length:function()
{return ImageViewer.aImageReferences.length;},add:function(images)
{images=Utl.toArray(images);for(var i=0;i<images.length;i++)
{ImageViewer.aImageReferences.push(images[i]);}},clearImageList:function()
{ImageViewer.aImageReferences=[];},remove:function(images)
{toRemove=[];images=Utl.toArray(images);for(var i=0;i<images.length;i++)
{for(var j=0;j<ImageViewer.aImageReferences.length;j++)
{if(images[i].imagereferenceid==ImageViewer.aImageReferences[j].imagereferenceid)
{toRemove.push(j);}}}
ImageViewer.aImageReferences.splice(j,1);},showNav:function()
{var links=Dlg.textMessage.select('.fakelink');if(ImageViewer.aImageReferences.length>1)
{for(var i=0;i<links.length;i++)
{links[i].show();}}
else
{for(var i=0;i<links.length;i++)
{if(!links[i].hasClassName('close'))
{links[i].hide();}}}},clear:function()
{aImageReferences=[];},next:function()
{aImageReferences=ImageViewer.aImageReferences;currentImageReference=ImageViewer.currentImageReference;if(currentImageReference)
{for(var i=0;i<aImageReferences.length;i++)
{if(aImageReferences[i].imagereferenceid==currentImageReference.imagereferenceid)
{if(i+1<aImageReferences.length)
{ImageViewer.setImage(aImageReferences[i+1]);}
else
{ImageViewer.setImage(aImageReferences[0]);}}}}},prev:function()
{aImageReferences=ImageViewer.aImageReferences;currentImageReference=ImageViewer.currentImageReference;if(currentImageReference)
{for(var i=0;i<aImageReferences.length;i++)
{if(aImageReferences[i].imagereferenceid==currentImageReference.imagereferenceid)
{if(i-1>=0)
{ImageViewer.setImage(aImageReferences[i-1]);}
else
{ImageViewer.setImage(aImageReferences[aImageReferences.length-1]);}}}}}};var Dlg={modalDialogue:null,observers:null,buttonOK:null,buttonCancel:null,textTitle:null,textMessage:null,textResponse:null,imgProcessing:null,ok_handler:null,cancel_handler:null,return_handler:null,disableid:null,focusFieldClassName:null,autohide:null,Setup:function()
{Dlg.modalDialogue=new ModalDialogue('dialogueFrame');Dlg.modalDialogue.onShow=Dlg.onShow;Dlg.observers=[];Dlg.buttonOK=$('informationDialogueButOK');Dlg.buttonCancel=$('informationDialogueButCancel');Dlg.textTitle=$('informationDialogueTitle');Dlg.textMessage=$('informationDialogueMessage');Dlg.textResponse=$('informationDialogueResponse');Dlg.imgProcessing=$('informationDialogueProcessing');Dlg.help=$('informationDialogueHelp');},ShowConfirmation:function(message,callback)
{Dlg.Show('',message,{but_cancel:true,ok_handler:Dlg.callCallback,callback:callback});},ShowProgress:function(message,options)
{options=options||{};options.ok_handler=options.ok_handler||function(){};options.cancel_handler=options.cancel_handler||function(){Dlg.hide();};options.but_ok=options.but_ok||false;options.but_cancel=options.but_cancel||false;options.timeout=options.timeout||30;if(Dlg.autohide){window.clearTimeout(Dlg.autohide);}
Dlg.autohide=Dlg.ShowTimeout.delay(options.timeout);Dlg.Show(message,'',options);Dlg.startProcessing();},ShowTimeout:function()
{Dlg.Show('Error','This operation has timed out, please try again.');if(Dlg.autohide){window.clearTimeout(Dlg.autohide);}},ShowRedirect:function(message,newlocationURL)
{Dlg.ShowProgress(message,{but_cancel:true,cancel_handler:function(){Dlg.hide();}});location.href=newlocationURL;Dlg.setButtonsEnabled(true);Dlg.bindDefaultEvents();},ShowPage:function(title,message,pageURL,options)
{Dlg.Show(title,message,options);Dlg.textMessage.show();PageLoader.Load(pageURL,null,Dlg.textMessage,false);Dlg.modalDialogue.adjustForResize();},ShowIframe:function(iframeID,title,iframePageURL,options)
{var iFrame=new Element('iframe');iFrame.name=iframeID;iFrame.id=iframeID;iFrame.src=iframePageURL;if(options.iFrameHeight){iFrame.style.height=options.iFrameHeight;}
if(options.iFrameWidth){iFrame.style.width=options.iFrameWidth;}
if(options.iFrameNotice){Dlg.Show(title,options.iFrameNotice,options);}
else{Dlg.Show(title,'',options);}
Dlg.textMessage.appendChild(iFrame);Dlg.textMessage.show();Dlg.modalDialogue.adjustForResize();},Show:function(title,message,options)
{options=options||{};if(options.maxContentHeight)
{message='<div style="height:'+options.maxContentHeight+'px; overflow-y:scroll">'+message+'</div>';}
if(Dlg.autohide){window.clearTimeout(Dlg.autohide);}
Dlg.autohide=null;Dlg.disableid=options.disableid||Dlg.disableid;Dlg.ok_handler=options.ok_handler||Dlg.hide;Dlg.cancel_handler=options.cancel_handler||function(){Dlg.hide();};Dlg.return_handler=options.return_handler;if(options.but_ok!=false)
{Dlg.buttonOK.show();}
else
{Dlg.buttonOK.hide();}
if(options.but_cancel==true)
{Dlg.buttonCancel.show();}
else
{Dlg.buttonCancel.hide();}
Dlg.callback=options.callback;Dlg.focusFieldClassName=options.focusFieldClassName;Dlg.modalDialogue.element.className=options.className||'modalDialogue';Dlg.setHelp(options.help);Dlg.setTitle(title);Dlg.setMessage(message);Dlg.setResponse();Dlg.imgProcessing.hide();Dlg.modalDialogue.show();if(options.appear)
{Dlg.modalDialogue.element.hide();new Effect.Appear(Dlg.modalDialogue.element,{duration:.8});}},ShowPreformatted:function(container,options){options=options||{};container=$(container);if(!container)
{Dlg.hide();alert('Missing templated dialogue container.');return;}
var title=container.select('.dyn_title')[0];var message=container.select('.dyn_message')[0];var className=container.select('.dyn_className')[0];title=title?title.innerHTML:'';message=message?message.innerHTML:'';options.className=options.className||(className?className.innerHTML:null);options.className=options.className.strip();Dlg.Show(title,message,options);},onShow:function(){if(!Dlg.focusFieldClassName)
{window.setTimeout('try{if(Dlg.buttonOK.visible())Dlg.buttonOK.focus();}catch(e){}',10);}
else
{window.setTimeout("try{Dlg.textMessage.select('."+Dlg.focusFieldClassName+"')[0].focus();}catch(e){}",10);}
Dlg.stopProcessing();Dlg.setDisableState(true);},hide:function()
{if(Dlg.autohide){window.clearTimeout(Dlg.autohide);}
Dlg.autohide=null;Dlg.setDisableState(false);Dlg.disableid=null;Dlg.modalDialogue.hide();Dlg.callback=null;},setDisableState:function(state)
{if(Dlg.disableid)
{$A($(Dlg.disableid).select('input, select, button')).each(function(input){input.disabled=state;});}},callCallback:function()
{var callback=Dlg.callback;Dlg.hide();if(callback&&callback.func)
{callback.func(callback.args);}
else if(callback)
{callback();}},setButtonsEnabled:function(enabled)
{Dlg.buttonOK.disabled=!enabled;Dlg.buttonCancel.disabled=!enabled;},startProcessing:function()
{Dlg.unbindEvents();Dlg.setButtonsEnabled(false);Dlg.imgProcessing.show();Dlg.setResponse('Please Wait...');},stopProcessing:function()
{Dlg.bindEvents();Dlg.setButtonsEnabled(true);Dlg.imgProcessing.hide();Dlg.setResponse();},setHelp:function(helpLink)
{if(Dlg.help)
{if(helpLink)
{Dlg.help.show();Dlg.help.down('a').setAttribute('href',helpLink);}
else
{Dlg.help.hide();}}},setTitle:function(text)
{Dlg.setField(Dlg.textTitle,text);},setMessage:function(text)
{Dlg.setField(Dlg.textMessage,text);},setResponse:function(text)
{Dlg.setField(Dlg.textResponse,text);},setField:function(field,text)
{if(text&&text!='')
{field.show();field.innerHTML=text;}
else
{field.innerHTML='';field.hide();}},observe:function(element,eventName,handler)
{Dlg.observers.push({element:element,eventName:eventName,handler:handler});Event.observe(element,eventName,handler);},unbindEvents:function()
{var observers=Dlg.observers;for(i=0;i<observers.length;i++)
{Event.stopObserving(observers[i].element,observers[i].eventName,observers[i].handler);}},bindDefaultEvents:function()
{Dlg.ok_handler=Dlg.hide;Dlg.cancel_handler=Dlg.hide;Dlg.bindEvents();},bindEvents:function()
{Dlg.unbindEvents();Dlg.observers=[];Dlg.observe(Dlg.buttonOK,'click',Dlg.okHandler);Dlg.observe(Dlg.buttonCancel,'click',Dlg.cancelHandler);Dlg.observe(document,'keydown',Dlg.keyListener);},keyListener:function(keyEvent)
{if(Dlg.modalDialogue.element.visible())
{if(keyEvent.keyCode==Event.KEY_RETURN)
{if(Dlg.return_handler)
{Dlg.return_handler(keyEvent);}
else if(Dlg.buttonCancel.isFocused)
{Dlg.cancelHandler(keyEvent);}
else
{Dlg.okHandler(keyEvent);}}
else if(keyEvent.keyCode==Event.KEY_ESC)
{Dlg.cancelHandler(keyEvent);}}},okHandler:function(anEvent)
{Dlg.startProcessing();Dlg.ok_handler(anEvent);},cancelHandler:function(anEvent)
{Dlg.cancel_handler(anEvent);}};var ModalDialogue=Class.create();ModalDialogue.PageWidth=function()
{return window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null;},ModalDialogue.PageHeight=function()
{return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;},ModalDialogue.PosLeft=function()
{return typeof window.pageXOffset!='undefined'?window.pageXOffset:document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft?document.body.scrollLeft:0;},ModalDialogue.PosTop=function()
{return typeof window.pageYOffset!='undefined'?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0;},ModalDialogue.prototype={element:null,overlay:null,scrollObserver:null,resizeObserver:null,onShow:null,onHide:null,initialize:function(anElementOrID)
{this.overlay=$('modalDialogueOverlay');if(!this.overlay)
{this.overlay=$(document.createElement('div'));this.overlay.id='modalDialogueOverlay';this.overlay.style.position='absolute';this.overlay.style.display='none';this.overlay.style.zIndex=9998;this.overlay.style.backgroundColor='Black';var opacity=70;this.overlay.style.opacity=(opacity/100);this.overlay.style.MozOpacity=(opacity/100);this.overlay.style.KhtmlOpacity=(opacity/100);this.overlay.style.filter="alpha(opacity="+opacity+")";$('dialogues').appendChild(this.overlay);}
this.element=$(anElementOrID);this.element.hide();this.element.style.position='absolute';this.element.style.zIndex=9999;var modalDialogue=this;this.scrollObserver=function(anEvent){modalDialogue.adjustForScroll(anEvent);};this.resizeObserver=function(anEvent){modalDialogue.adjustForResize(anEvent);};},adjustForScroll:function()
{var overlay=document.getElementById('overlay');this.overlay.style.left=ModalDialogue.PosLeft()+'px';this.overlay.style.top=ModalDialogue.PosTop()+'px';},adjustForResize:function()
{this.overlay.style.width=ModalDialogue.PageWidth()+'px';this.overlay.style.height=ModalDialogue.PageHeight()+'px';this.element.style.left=(ModalDialogue.PosLeft()+ModalDialogue.PageWidth()/2-this.element.getWidth()/2)+'px';this.element.style.top=(ModalDialogue.PosTop()+ModalDialogue.PageHeight()/2-this.element.getHeight()/2)+'px';},show:function(aPayload)
{this.overlay.style.left=ModalDialogue.PosLeft()+'px';this.overlay.style.top=ModalDialogue.PosTop()+'px';this.overlay.style.width=ModalDialogue.PageWidth()+'px';this.overlay.style.height=ModalDialogue.PageHeight()+'px';this.element.style.left=(ModalDialogue.PosLeft()+ModalDialogue.PageWidth()/2-this.element.getWidth()/2)+'px';this.element.style.top=(ModalDialogue.PosTop()+ModalDialogue.PageHeight()/2-this.element.getHeight()/2)+'px';Event.observe(window,'scroll',this.scrollObserver);Event.observe(window,'resize',this.resizeObserver);this.overlay.style.display='block';this.element.style.display='block';var inputs=this.element.getElementsBySelector('input');try
{for(var i=0;i<1;i++)
{if(inputs[i]&&!inputs[i].disabled&&inputs[i].visible)
{inputs[i].focus();}}}
catch(e){}
if(this.onShow)
{this.onShow(this,aPayload);}},hide:function(aPayload)
{this.overlay.style.display='none';this.element.style.display='none';Event.stopObserving(window,'scroll',this.scrollObserver);Event.observe(window,'resize',this.resizeObserver);if(!!this.onHide)
{this.onHide(this,aPayload);}}};var PunbbUser=Class.create({punbbuserXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='_punbbuser')
this.punbbuserXML=inputXML;else{this.punbbuserXML=document.createElement('_punbbuser');this.punbbuserXML.setAttribute('punbbuserid',-1);}},getID:function(){return this.punbbuserXML.getAttribute('punbbuserid');},setID:function(val){this.punbbuserXML.setAttribute('punbbuserid',val);},getActivate_Key:function(){return unescape(this.punbbuserXML.getAttribute('activate_key'));},setActivate_Key:function(val){this.punbbuserXML.setAttribute('activate_key',escape(val));},getActivate_String:function(){return unescape(this.punbbuserXML.getAttribute('activate_string'));},setActivate_String:function(val){this.punbbuserXML.setAttribute('activate_string',escape(val));},getAdmin_Note:function(){return unescape(this.punbbuserXML.getAttribute('admin_note'));},setAdmin_Note:function(val){this.punbbuserXML.setAttribute('admin_note',escape(val));},getLast_Visit:function(){return unescape(this.punbbuserXML.getAttribute('last_visit'));},setLast_Visit:function(val){this.punbbuserXML.setAttribute('last_visit',escape(val));},getRegistration_IP:function(){return unescape(this.punbbuserXML.getAttribute('registration_ip'));},setRegistration_IP:function(val){this.punbbuserXML.setAttribute('registration_ip',escape(val));},getRegistered:function(){return unescape(this.punbbuserXML.getAttribute('registered'));},setRegistered:function(val){this.punbbuserXML.setAttribute('registered',escape(val));},getLast_Post:function(){return unescape(this.punbbuserXML.getAttribute('last_post'));},setLast_Post:function(val){this.punbbuserXML.setAttribute('last_post',escape(val));},getNum_Posts:function(){return unescape(this.punbbuserXML.getAttribute('num_posts'));},setNum_Posts:function(val){this.punbbuserXML.setAttribute('num_posts',escape(val));},getStyle:function(){return unescape(this.punbbuserXML.getAttribute('style'));},setStyle:function(val){this.punbbuserXML.setAttribute('style',escape(val));},getLanguage:function(){return unescape(this.punbbuserXML.getAttribute('language'));},setLanguage:function(val){this.punbbuserXML.setAttribute('language',escape(val));},getDate_Format:function(){return unescape(this.punbbuserXML.getAttribute('date_format'));},setDate_Format:function(val){this.punbbuserXML.setAttribute('date_format',escape(val));},getTime_Format:function(){return unescape(this.punbbuserXML.getAttribute('time_format'));},setTime_Format:function(val){this.punbbuserXML.setAttribute('time_format',escape(val));},getDst:function(){return unescape(this.punbbuserXML.getAttribute('dst'));},setDst:function(val){this.punbbuserXML.setAttribute('dst',escape(val));},getTimezone:function(){return unescape(this.punbbuserXML.getAttribute('timezone'));},setTimezone:function(val){this.punbbuserXML.setAttribute('timezone',escape(val));},getShow_Sig:function(){return unescape(this.punbbuserXML.getAttribute('show_sig'));},setShow_Sig:function(val){this.punbbuserXML.setAttribute('show_sig',escape(val));},getShow_Avatars:function(){return unescape(this.punbbuserXML.getAttribute('show_avatars'));},setShow_Avatars:function(val){this.punbbuserXML.setAttribute('show_avatars',escape(val));},getShow_Img_Sig:function(){return unescape(this.punbbuserXML.getAttribute('show_img_sig'));},setShow_Img_Sig:function(val){this.punbbuserXML.setAttribute('show_img_sig',escape(val));},getShow_Img:function(){return unescape(this.punbbuserXML.getAttribute('show_img'));},setShow_Img:function(val){this.punbbuserXML.setAttribute('show_img',escape(val));},getShow_Smilies:function(){return unescape(this.punbbuserXML.getAttribute('show_smilies'));},setShow_Smilies:function(val){this.punbbuserXML.setAttribute('show_smilies',escape(val));},getAuto_Notify:function(){return unescape(this.punbbuserXML.getAttribute('auto_notify'));},setAuto_Notify:function(val){this.punbbuserXML.setAttribute('auto_notify',escape(val));},getNotify_With_Post:function(){return unescape(this.punbbuserXML.getAttribute('notify_with_post'));},setNotify_With_Post:function(val){this.punbbuserXML.setAttribute('notify_with_post',escape(val));},getSave_Pass:function(){return unescape(this.punbbuserXML.getAttribute('save_pass'));},setSave_Pass:function(val){this.punbbuserXML.setAttribute('save_pass',escape(val));},getEmail_Setting:function(){return unescape(this.punbbuserXML.getAttribute('email_setting'));},setEmail_Setting:function(val){this.punbbuserXML.setAttribute('email_setting',escape(val));},getDisp_Posts:function(){return unescape(this.punbbuserXML.getAttribute('disp_posts'));},setDisp_Posts:function(val){this.punbbuserXML.setAttribute('disp_posts',escape(val));},getDisp_Topics:function(){return unescape(this.punbbuserXML.getAttribute('disp_topics'));},setDisp_Topics:function(val){this.punbbuserXML.setAttribute('disp_topics',escape(val));},getSignature:function(){return unescape(this.punbbuserXML.getAttribute('signature'));},setSignature:function(val){this.punbbuserXML.setAttribute('signature',escape(val));},getLocation:function(){return unescape(this.punbbuserXML.getAttribute('location'));},setLocation:function(val){this.punbbuserXML.setAttribute('location',escape(val));},getYahoo:function(){return unescape(this.punbbuserXML.getAttribute('yahoo'));},setYahoo:function(val){this.punbbuserXML.setAttribute('yahoo',escape(val));},getAim:function(){return unescape(this.punbbuserXML.getAttribute('aim'));},setAim:function(val){this.punbbuserXML.setAttribute('aim',escape(val));},getMsn:function(){return unescape(this.punbbuserXML.getAttribute('msn'));},setMsn:function(val){this.punbbuserXML.setAttribute('msn',escape(val));},getIcq:function(){return unescape(this.punbbuserXML.getAttribute('icq'));},setIcq:function(val){this.punbbuserXML.setAttribute('icq',escape(val));},getJabber:function(){return unescape(this.punbbuserXML.getAttribute('jabber'));},setJabber:function(val){this.punbbuserXML.setAttribute('jabber',escape(val));},getUrl:function(){return unescape(this.punbbuserXML.getAttribute('url'));},setUrl:function(val){this.punbbuserXML.setAttribute('url',escape(val));},getRealName:function(){return unescape(this.punbbuserXML.getAttribute('realname'));},setRealName:function(val){this.punbbuserXML.setAttribute('realname',escape(val));},getTitle:function(){return unescape(this.punbbuserXML.getAttribute('title'));},setTitle:function(val){this.punbbuserXML.setAttribute('title',escape(val));},getEmail:function(){return unescape(this.punbbuserXML.getAttribute('email'));},setEmail:function(val){this.punbbuserXML.setAttribute('email',escape(val));},getSalt:function(){return unescape(this.punbbuserXML.getAttribute('salt'));},setSalt:function(val){this.punbbuserXML.setAttribute('salt',escape(val));},getPassword:function(){return unescape(this.punbbuserXML.getAttribute('password'));},setPassword:function(val){this.punbbuserXML.setAttribute('password',escape(val));},getUsername:function(){return unescape(this.punbbuserXML.getAttribute('username'));},setUsername:function(val){this.punbbuserXML.setAttribute('username',escape(val));},getGroup_id:function(){return unescape(this.punbbuserXML.getAttribute('group_id'));},setGroup_id:function(val){this.punbbuserXML.setAttribute('group_id',escape(val));}});var PunbbForum=Class.create({punbbforumXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='_punbbforum')
this.punbbforumXML=inputXML;else{this.punbbforumXML=document.createElement('_punbbforum');this.punbbforumXML.setAttribute('punbbforumid',-1);}},getID:function(){return this.punbbforumXML.getAttribute('punbbforumid');},setID:function(val){this.punbbforumXML.setAttribute('punbbforumid',val);},getCat_ID:function(){return unescape(this.punbbforumXML.getAttribute('cat_id'));},setCat_ID:function(val){this.punbbforumXML.setAttribute('cat_id',escape(val));},getDisp_Position:function(){return unescape(this.punbbforumXML.getAttribute('disp_position'));},setDisp_Position:function(val){this.punbbforumXML.setAttribute('disp_position',escape(val));},getSort_By:function(){return unescape(this.punbbforumXML.getAttribute('sort_by'));},setSort_By:function(val){this.punbbforumXML.setAttribute('sort_by',escape(val));},getLast_Poster:function(){return unescape(this.punbbforumXML.getAttribute('last_poster'));},setLast_Poster:function(val){this.punbbforumXML.setAttribute('last_poster',escape(val));},getLast_Post_ID:function(){return unescape(this.punbbforumXML.getAttribute('last_post_id'));},setLast_Post_ID:function(val){this.punbbforumXML.setAttribute('last_post_id',escape(val));},getLoast_Post:function(){return unescape(this.punbbforumXML.getAttribute('loast_post'));},setLoast_Post:function(val){this.punbbforumXML.setAttribute('loast_post',escape(val));},getNum_Posts:function(){return unescape(this.punbbforumXML.getAttribute('num_posts'));},setNum_Posts:function(val){this.punbbforumXML.setAttribute('num_posts',escape(val));},getNum_Topics:function(){return unescape(this.punbbforumXML.getAttribute('num_topics'));},setNum_Topics:function(val){this.punbbforumXML.setAttribute('num_topics',escape(val));},getModerators:function(){return unescape(this.punbbforumXML.getAttribute('moderators'));},setModerators:function(val){this.punbbforumXML.setAttribute('moderators',escape(val));},getRedirect_Url:function(){return unescape(this.punbbforumXML.getAttribute('redirect_url'));},setRedirect_Url:function(val){this.punbbforumXML.setAttribute('redirect_url',escape(val));},getForum_Desc:function(){return unescape(this.punbbforumXML.getAttribute('forum_desc'));},setForum_Desc:function(val){this.punbbforumXML.setAttribute('forum_desc',escape(val));},getForum_Name:function(){return unescape(this.punbbforumXML.getAttribute('forum_name'));},setForum_Name:function(val){this.punbbforumXML.setAttribute('forum_name',escape(val));}});var Neighbourhood=Class.create({neighbourhoodXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='_neighbourhood')
this.neighbourhoodXML=inputXML;else{this.neighbourhoodXML=document.createElement('_neighbourhood');this.neighbourhoodXML.setAttribute('neighbourhoodid',-1);}},getID:function(){return this.neighbourhoodXML.getAttribute('neighbourhoodid');},setID:function(val){this.neighbourhoodXML.setAttribute('neighbourhoodid',val);},getAnimation:function(){return unescape(this.neighbourhoodXML.getAttribute('animation'));},setAnimation:function(val){this.neighbourhoodXML.setAttribute('animation',escape(val));},getImage:function(){return unescape(this.neighbourhoodXML.getAttribute('image'));},setImage:function(val){this.neighbourhoodXML.setAttribute('image',escape(val));},getName:function(){return unescape(this.neighbourhoodXML.getAttribute('name'));},setName:function(val){this.neighbourhoodXML.setAttribute('name',escape(val));}});var MapPoint=Class.create({mappointXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='_mappoint')
this.mappointXML=inputXML;else{this.mappointXML=document.createElement('_mappoint');this.mappointXML.setAttribute('mappointid',-1);}},getID:function(){return this.mappointXML.getAttribute('mappointid');},setID:function(val){this.mappointXML.setAttribute('mappointid',val);},getPointY:function(){return unescape(this.mappointXML.getAttribute('pointy'));},setPointY:function(val){this.mappointXML.setAttribute('pointy',escape(val));},getPointX:function(){return unescape(this.mappointXML.getAttribute('pointx'));},setPointX:function(val){this.mappointXML.setAttribute('pointx',escape(val));},getNeighbourhoodID:function(){return unescape(this.mappointXML.getAttribute('neighbourhoodid'));},setNeighbourhoodID:function(val){this.mappointXML.setAttribute('neighbourhoodid',escape(val));}});var RealestateTagType=Class.create({realestatetagtypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='realestatetagtype')
this.realestatetagtypeXML=inputXML;else{this.realestatetagtypeXML=document.createElement('realestatetagtype');}},getValue:function(){return unescape(this.realestatetagtypeXML.getAttribute('value'));},setValue:function(val){this.realestatetagtypeXML.setAttribute('value',escape(val));this.Value=val;}});RealestateTagType.values={Unknown:1,Account:2,Amenity:3,PropertyStyle:4,Lifestyle:5,General:6,Location:7,PropertyType:8,Neighbourhood:9,Grouping1:10,Grouping2:11,Grouping3:12,Grouping4:13,Grouping5:14,Grouping6:15,Grouping7:16,Grouping8:17,Grouping9:18,Grouping10:19};RealestateTagType.valueTypes=['N/A','Unknown','Account','Amenity','PropertyStyle','Lifestyle','General','Location','PropertyType','Neighbourhood','Grouping1','Grouping2','Grouping3','Grouping4','Grouping5','Grouping6','Grouping7','Grouping8','Grouping9','Grouping10'];var RealestateTag=Class.create({realestatetagXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='realestatetag')
this.realestatetagXML=inputXML;else{this.realestatetagXML=document.createElement('realestatetag');this.id=-1;this.realestatetagXML.setAttribute('realestatetagid',-1);}},getID:function(){return this.realestatetagXML.getAttribute('realestatetagid');},setID:function(val){this.realestatetagXML.setAttribute('realestatetagid',val);this.RealestateTagID=val;},getType:function(){var rslt=null;for(i=0;i<this.realestatetagXML.childNodes.length;i++)
if(this.realestatetagXML.childNodes[i].nodeName.toLowerCase()=='type'){for(j=0;j<this.realestatetagXML.childNodes[i].childNodes.length;j++)
if(this.realestatetagXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='realestatetagtype'){rslt=new RealestateTagType(this.realestatetagXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setType:function(aRealestateTagType){var alsNd=null;this.Type=aRealestateTagType;for(i=0;i<this.realestatetagXML.childNodes.length;i++)
if(this.realestatetagXML.childNodes[i].nodeName.toLowerCase()=='type'){alsNd=this.realestatetagXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('type');this.realestatetagXML.appendChild(alsNd);}
alsNd.appendChild(aRealestateTagType.realestatetagtypeXML);},getValue:function(){return unescape(this.realestatetagXML.getAttribute('value'));},setValue:function(val){this.realestatetagXML.setAttribute('value',escape(val));this.Value=val;}});var SearchQuery=Class.create({searchqueryXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='searchquery')
this.searchqueryXML=inputXML;else{this.searchqueryXML=document.createElement('searchquery');this.id=-1;this.searchqueryXML.setAttribute('searchqueryid',-1);this.searchqueryXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.searchqueryXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.searchqueryXML.getAttribute('searchqueryid');},setID:function(val){this.searchqueryXML.setAttribute('searchqueryid',val);this.SearchQueryID=val;},getCreateAt:function(){return this.searchqueryXML.getAttribute('createdat');},getLastModified:function(){return this.searchqueryXML.getAttribute('lastmodified');},getSavedName:function(){return unescape(this.searchqueryXML.getAttribute('savedname'));},setSavedName:function(val){this.searchqueryXML.setAttribute('savedname',escape(val));this.SavedName=val;},getResultCount:function(){return unescape(this.searchqueryXML.getAttribute('resultcount'));},setResultCount:function(val){this.searchqueryXML.setAttribute('resultcount',escape(val));this.ResultCount=val;},getKeywords:function(){return unescape(this.searchqueryXML.getAttribute('keywords'));},setKeywords:function(val){this.searchqueryXML.setAttribute('keywords',escape(val));this.Keywords=val;},getRawQuery:function(){return unescape(this.searchqueryXML.getAttribute('rawquery'));},setRawQuery:function(val){this.searchqueryXML.setAttribute('rawquery',escape(val));this.RawQuery=val;}});var UserProfile=Class.create({userprofileXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='userprofile')
this.userprofileXML=inputXML;else{this.userprofileXML=document.createElement('userprofile');this.id=-1;this.userprofileXML.setAttribute('userprofileid',-1);this.userprofileXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.userprofileXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.userprofileXML.getAttribute('userprofileid');},setID:function(val){this.userprofileXML.setAttribute('userprofileid',val);this.UserProfileID=val;},getCreateAt:function(){return this.userprofileXML.getAttribute('createdat');},getLastModified:function(){return this.userprofileXML.getAttribute('lastmodified');},getAttributes:function(){var ret=new Array();for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='attributes'){var ourNode=this.userprofileXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='stringkeyvaluepair')
ret.push(new StringKeyValuePair(ourNode.childNodes[j]));break;}
return ret;},setAttributes:function(stringkeyvaluepairList){stringkeyvaluepairList=Utl.toArray(stringkeyvaluepairList);this.Attributes=stringkeyvaluepairList;var alsNd=null;for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='attributes'){alsNd=this.userprofileXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('attributes');this.userprofileXML.appendChild(alsNd);}
for(i=0;i<stringkeyvaluepairList.length;i++)
alsNd.appendChild(stringkeyvaluepairList[i].stringkeyvaluepairXML);},getAuthenticationInformation:function(){var rslt=null;for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='authenticationinformation'){for(j=0;j<this.userprofileXML.childNodes[i].childNodes.length;j++)
if(this.userprofileXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='login'){rslt=new Login(this.userprofileXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setAuthenticationInformation:function(aLogin){var alsNd=null;this.AuthenticationInformation=aLogin;for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='authenticationinformation'){alsNd=this.userprofileXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('authenticationinformation');this.userprofileXML.appendChild(alsNd);}
alsNd.appendChild(aLogin.loginXML);this.setAuthenticationInformationID(aLogin.loginXML.getAttribute('loginid'));this.AuthenticationInformationID=aLogin.LoginID;},getAuthenticationInformationID:function(){return this.userprofileXML.getAttribute('authenticationinformationid');},setAuthenticationInformationID:function(aLoginID){this.userprofileXML.setAttribute('authenticationinformationid',aLoginID);this.AuthenticationInformationID=aLoginID},getDetails:function(){var rslt=null;for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='details'){for(j=0;j<this.userprofileXML.childNodes[i].childNodes.length;j++)
if(this.userprofileXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='contact'){rslt=new Contact(this.userprofileXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setDetails:function(aContact){var alsNd=null;this.Details=aContact;for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='details'){alsNd=this.userprofileXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('details');this.userprofileXML.appendChild(alsNd);}
alsNd.appendChild(aContact.contactXML);this.setDetailsID(aContact.contactXML.getAttribute('contactid'));this.DetailsID=aContact.ContactID;},getDetailsID:function(){return this.userprofileXML.getAttribute('detailsid');},setDetailsID:function(aContactID){this.userprofileXML.setAttribute('detailsid',aContactID);this.DetailsID=aContactID},getMyWatchLists:function(){var ret=new Array();for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='mywatchlists'){var ourNode=this.userprofileXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='searchquery')
ret.push(new SearchQuery(ourNode.childNodes[j]));break;}
return ret;},setMyWatchLists:function(searchqueryList){searchqueryList=Utl.toArray(searchqueryList);this.MyWatchLists=searchqueryList;var alsNd=null;for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='mywatchlists'){alsNd=this.userprofileXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('mywatchlists');this.userprofileXML.appendChild(alsNd);}
for(i=0;i<searchqueryList.length;i++)
alsNd.appendChild(searchqueryList[i].searchqueryXML);},getMyQueries:function(){var ret=new Array();for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='myqueries'){var ourNode=this.userprofileXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='searchquery')
ret.push(new SearchQuery(ourNode.childNodes[j]));break;}
return ret;},setMyQueries:function(searchqueryList){searchqueryList=Utl.toArray(searchqueryList);this.MyQueries=searchqueryList;var alsNd=null;for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='myqueries'){alsNd=this.userprofileXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('myqueries');this.userprofileXML.appendChild(alsNd);}
for(i=0;i<searchqueryList.length;i++)
alsNd.appendChild(searchqueryList[i].searchqueryXML);},getMyDevelopments:function(){var ret=new Array();for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='mydevelopments'){var ourNode=this.userprofileXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='development')
ret.push(new Development(ourNode.childNodes[j]));break;}
return ret;},setMyDevelopments:function(developmentList){developmentList=Utl.toArray(developmentList);this.MyDevelopments=developmentList;var alsNd=null;for(i=0;i<this.userprofileXML.childNodes.length;i++)
if(this.userprofileXML.childNodes[i].nodeName.toLowerCase()=='mydevelopments'){alsNd=this.userprofileXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('mydevelopments');this.userprofileXML.appendChild(alsNd);}
for(i=0;i<developmentList.length;i++)
alsNd.appendChild(developmentList[i].developmentXML);}});UserProfile.addMethods({getLoginName:function()
{return this.AuthenticationInformation.LoginName;},getIsConfirmed:function()
{return(this.AuthenticationInformation.ConfirmationCode==''?'Yes':'No');},getFirstName:function()
{return this.Details.PersonalInfo.FirstName;},getLastName:function()
{return this.Details.PersonalInfo.LastName;},getGender:function()
{return this.Details.PersonalInfo.GenderValue;},getUserLocation:function()
{if(this.Details.MailingAddresses&&this.Details.MailingAddresses.length>0)
return this.Details.MailingAddresses[0].UserLocation;else
return null;},getMA_Address:function()
{var userMA=this.getUserLocation();if(userMA!=null)
{var fullAddress=userMA.split('\n');if(fullAddress.length>=4)
return fullAddress[0];else
return'';}
else
return'';},getMA_City:function()
{var userMA=this.getUserLocation();if(userMA!=null)
{var fullAddress=userMA.split('\n');if(fullAddress.length>=4)
return fullAddress[1];else
return'';}
else
return'';},getMA_Province:function()
{var userMA=this.getUserLocation();if(userMA!=null)
{var fullAddress=userMA.split('\n');if(fullAddress.length>=4)
return fullAddress[2];else
return'';}
else
return'';},getMA_Country:function()
{var userMA=this.getUserLocation();if(userMA!=null)
{var fullAddress=userMA.split('\n');if(fullAddress.length>=4)
return fullAddress[3];else
return'';}
else
return'';},getMA_Postal:function()
{var userMA=this.getUserLocation();if(userMA!=null)
return userMA.ZipPostal;else
return'';},getDateOfBirth:function()
{if(!this.Details||!this.Details.PersonalInfo)
return'';var db=new Date(this.Details.PersonalInfo.DateOfBirth);return(db.getMonth()+1)+'/'+db.getDate()+'/'+db.getFullYear();}});UserProfile.prototype.version=0.1;UserProfile.prototype.className='UserProfile';var MessageTracker=Class.create({messagetrackerXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='messagetracker')
this.messagetrackerXML=inputXML;else{this.messagetrackerXML=document.createElement('messagetracker');this.id=-1;this.messagetrackerXML.setAttribute('messagetrackerid',-1);this.messagetrackerXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.messagetrackerXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.messagetrackerXML.getAttribute('messagetrackerid');},setID:function(val){this.messagetrackerXML.setAttribute('messagetrackerid',val);this.MessageTrackerID=val;},getCreateAt:function(){return this.messagetrackerXML.getAttribute('createdat');},getLastModified:function(){return this.messagetrackerXML.getAttribute('lastmodified');},getCount:function(){return unescape(this.messagetrackerXML.getAttribute('count'));},setCount:function(val){this.messagetrackerXML.setAttribute('count',escape(val));this.Count=val;},getToUserProfileID:function(){return unescape(this.messagetrackerXML.getAttribute('touserprofileid'));},setToUserProfileID:function(val){this.messagetrackerXML.setAttribute('touserprofileid',escape(val));this.ToUserProfileID=val;},getFromUserProfileID:function(){return unescape(this.messagetrackerXML.getAttribute('fromuserprofileid'));},setFromUserProfileID:function(val){this.messagetrackerXML.setAttribute('fromuserprofileid',escape(val));this.FromUserProfileID=val;}});var EmailToFriend=Class.create({emailtofriendXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='emailtofriend')
this.emailtofriendXML=inputXML;else{this.emailtofriendXML=document.createElement('emailtofriend');this.id=-1;this.emailtofriendXML.setAttribute('emailtofriendid',-1);this.emailtofriendXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.emailtofriendXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.emailtofriendXML.getAttribute('emailtofriendid');},setID:function(val){this.emailtofriendXML.setAttribute('emailtofriendid',val);this.EmailToFriendID=val;},getCreateAt:function(){return this.emailtofriendXML.getAttribute('createdat');},getLastModified:function(){return this.emailtofriendXML.getAttribute('lastmodified');},getFromName:function(){return unescape(this.emailtofriendXML.getAttribute('fromname'));},setFromName:function(val){this.emailtofriendXML.setAttribute('fromname',escape(val));this.FromName=val;},getConfirmationDate:function(){return unescape(this.emailtofriendXML.getAttribute('confirmationdate'));},setConfirmationDate:function(val){this.emailtofriendXML.setAttribute('confirmationdate',escape(val));this.ConfirmationDate=val;},getFromProfile:function(){var rslt=null;for(i=0;i<this.emailtofriendXML.childNodes.length;i++)
if(this.emailtofriendXML.childNodes[i].nodeName.toLowerCase()=='fromprofile'){for(j=0;j<this.emailtofriendXML.childNodes[i].childNodes.length;j++)
if(this.emailtofriendXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='userprofile'){rslt=new UserProfile(this.emailtofriendXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setFromProfile:function(aUserProfile){var alsNd=null;this.FromProfile=aUserProfile;for(i=0;i<this.emailtofriendXML.childNodes.length;i++)
if(this.emailtofriendXML.childNodes[i].nodeName.toLowerCase()=='fromprofile'){alsNd=this.emailtofriendXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('fromprofile');this.emailtofriendXML.appendChild(alsNd);}
alsNd.appendChild(aUserProfile.userprofileXML);this.setFromProfileID(aUserProfile.userprofileXML.getAttribute('userprofileid'));this.FromProfileID=aUserProfile.UserProfileID;},getFromProfileID:function(){return this.emailtofriendXML.getAttribute('fromprofileid');},setFromProfileID:function(aUserProfileID){this.emailtofriendXML.setAttribute('fromprofileid',aUserProfileID);this.FromProfileID=aUserProfileID},getDevelopmentID:function(){return unescape(this.emailtofriendXML.getAttribute('developmentid'));},setDevelopmentID:function(val){this.emailtofriendXML.setAttribute('developmentid',escape(val));this.DevelopmentID=val;},getNote:function(){return unescape(this.emailtofriendXML.getAttribute('note'));},setNote:function(val){this.emailtofriendXML.setAttribute('note',escape(val));this.Note=val;},getEmail:function(){return unescape(this.emailtofriendXML.getAttribute('email'));},setEmail:function(val){this.emailtofriendXML.setAttribute('email',escape(val));this.Email=val;},getToName:function(){return unescape(this.emailtofriendXML.getAttribute('toname'));},setToName:function(val){this.emailtofriendXML.setAttribute('toname',escape(val));this.ToName=val;}});var AccountUserBlackList=Class.create({accountuserblacklistXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='accountuserblacklist')
this.accountuserblacklistXML=inputXML;else{this.accountuserblacklistXML=document.createElement('accountuserblacklist');this.id=-1;this.accountuserblacklistXML.setAttribute('accountuserblacklistid',-1);this.accountuserblacklistXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.accountuserblacklistXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.accountuserblacklistXML.getAttribute('accountuserblacklistid');},setID:function(val){this.accountuserblacklistXML.setAttribute('accountuserblacklistid',val);this.AccountUserBlackListID=val;},getCreateAt:function(){return this.accountuserblacklistXML.getAttribute('createdat');},getLastModified:function(){return this.accountuserblacklistXML.getAttribute('lastmodified');},getComment:function(){return unescape(this.accountuserblacklistXML.getAttribute('comment'));},setComment:function(val){this.accountuserblacklistXML.setAttribute('comment',escape(val));this.Comment=val;},getUserProfile:function(){var rslt=null;for(i=0;i<this.accountuserblacklistXML.childNodes.length;i++)
if(this.accountuserblacklistXML.childNodes[i].nodeName.toLowerCase()=='userprofile'){for(j=0;j<this.accountuserblacklistXML.childNodes[i].childNodes.length;j++)
if(this.accountuserblacklistXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='userprofile'){rslt=new UserProfile(this.accountuserblacklistXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setUserProfile:function(aUserProfile){var alsNd=null;this.UserProfile=aUserProfile;for(i=0;i<this.accountuserblacklistXML.childNodes.length;i++)
if(this.accountuserblacklistXML.childNodes[i].nodeName.toLowerCase()=='userprofile'){alsNd=this.accountuserblacklistXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('userprofile');this.accountuserblacklistXML.appendChild(alsNd);}
alsNd.appendChild(aUserProfile.userprofileXML);this.setUserProfileID(aUserProfile.userprofileXML.getAttribute('userprofileid'));this.UserProfileID=aUserProfile.UserProfileID;},getUserProfileID:function(){return this.accountuserblacklistXML.getAttribute('userprofileid');},setUserProfileID:function(aUserProfileID){this.accountuserblacklistXML.setAttribute('userprofileid',aUserProfileID);this.UserProfileID=aUserProfileID},getAccount:function(){var rslt=null;for(i=0;i<this.accountuserblacklistXML.childNodes.length;i++)
if(this.accountuserblacklistXML.childNodes[i].nodeName.toLowerCase()=='account'){for(j=0;j<this.accountuserblacklistXML.childNodes[i].childNodes.length;j++)
if(this.accountuserblacklistXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='account'){rslt=new Account(this.accountuserblacklistXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setAccount:function(aAccount){var alsNd=null;this.Account=aAccount;for(i=0;i<this.accountuserblacklistXML.childNodes.length;i++)
if(this.accountuserblacklistXML.childNodes[i].nodeName.toLowerCase()=='account'){alsNd=this.accountuserblacklistXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('account');this.accountuserblacklistXML.appendChild(alsNd);}
alsNd.appendChild(aAccount.accountXML);this.setAccountID(aAccount.accountXML.getAttribute('accountid'));this.AccountID=aAccount.AccountID;},getAccountID:function(){return this.accountuserblacklistXML.getAttribute('accountid');},setAccountID:function(aAccountID){this.accountuserblacklistXML.setAttribute('accountid',aAccountID);this.AccountID=aAccountID}});var Realtor=Class.create({realtorXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='realtor')
this.realtorXML=inputXML;else{this.realtorXML=document.createElement('realtor');this.id=-1;this.realtorXML.setAttribute('realtorid',-1);}},getID:function(){return this.realtorXML.getAttribute('realtorid');},setID:function(val){this.realtorXML.setAttribute('realtorid',val);this.RealtorID=val;},getAffiliationType:function(){return unescape(this.realtorXML.getAttribute('affiliationtype'));},setAffiliationType:function(val){this.realtorXML.setAttribute('affiliationtype',escape(val));this.AffiliationType=val;},getAffiliationIDNumber:function(){return unescape(this.realtorXML.getAttribute('affiliationidnumber'));},setAffiliationIDNumber:function(val){this.realtorXML.setAttribute('affiliationidnumber',escape(val));this.AffiliationIDNumber=val;},getAgentLicenseNumber:function(){return unescape(this.realtorXML.getAttribute('agentlicensenumber'));},setAgentLicenseNumber:function(val){this.realtorXML.setAttribute('agentlicensenumber',escape(val));this.AgentLicenseNumber=val;},getCompanyTaxIDNumber:function(){return unescape(this.realtorXML.getAttribute('companytaxidnumber'));},setCompanyTaxIDNumber:function(val){this.realtorXML.setAttribute('companytaxidnumber',escape(val));this.CompanyTaxIDNumber=val;},getCompanyLicenseNumber:function(){return unescape(this.realtorXML.getAttribute('companylicensenumber'));},setCompanyLicenseNumber:function(val){this.realtorXML.setAttribute('companylicensenumber',escape(val));this.CompanyLicenseNumber=val;},getCompanyName:function(){return unescape(this.realtorXML.getAttribute('companyname'));},setCompanyName:function(val){this.realtorXML.setAttribute('companyname',escape(val));this.CompanyName=val;},getContactInfo:function(){var rslt=null;for(i=0;i<this.realtorXML.childNodes.length;i++)
if(this.realtorXML.childNodes[i].nodeName.toLowerCase()=='contactinfo'){for(j=0;j<this.realtorXML.childNodes[i].childNodes.length;j++)
if(this.realtorXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='contact'){rslt=new Contact(this.realtorXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setContactInfo:function(aContact){var alsNd=null;this.ContactInfo=aContact;for(i=0;i<this.realtorXML.childNodes.length;i++)
if(this.realtorXML.childNodes[i].nodeName.toLowerCase()=='contactinfo'){alsNd=this.realtorXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('contactinfo');this.realtorXML.appendChild(alsNd);}
alsNd.appendChild(aContact.contactXML);this.setContactInfoID(aContact.contactXML.getAttribute('contactid'));this.ContactInfoID=aContact.ContactID;},getContactInfoID:function(){return this.realtorXML.getAttribute('contactinfoid');},setContactInfoID:function(aContactID){this.realtorXML.setAttribute('contactinfoid',aContactID);this.ContactInfoID=aContactID}});var Brand=Class.create({brandXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='brand')
this.brandXML=inputXML;else{this.brandXML=document.createElement('brand');this.id=-1;this.brandXML.setAttribute('brandid',-1);this.brandXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.brandXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.brandXML.getAttribute('brandid');},setID:function(val){this.brandXML.setAttribute('brandid',val);this.BrandID=val;},getCreateAt:function(){return this.brandXML.getAttribute('createdat');},getLastModified:function(){return this.brandXML.getAttribute('lastmodified');},getContact:function(){var rslt=null;for(i=0;i<this.brandXML.childNodes.length;i++)
if(this.brandXML.childNodes[i].nodeName.toLowerCase()=='contact'){for(j=0;j<this.brandXML.childNodes[i].childNodes.length;j++)
if(this.brandXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='contact'){rslt=new Contact(this.brandXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setContact:function(aContact){var alsNd=null;this.Contact=aContact;for(i=0;i<this.brandXML.childNodes.length;i++)
if(this.brandXML.childNodes[i].nodeName.toLowerCase()=='contact'){alsNd=this.brandXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('contact');this.brandXML.appendChild(alsNd);}
alsNd.appendChild(aContact.contactXML);this.setContactID(aContact.contactXML.getAttribute('contactid'));this.ContactID=aContact.ContactID;},getContactID:function(){return this.brandXML.getAttribute('contactid');},setContactID:function(aContactID){this.brandXML.setAttribute('contactid',aContactID);this.ContactID=aContactID},getWebsite:function(){return unescape(this.brandXML.getAttribute('website'));},setWebsite:function(val){this.brandXML.setAttribute('website',escape(val));this.Website=val;},getMissionStatement:function(){return unescape(this.brandXML.getAttribute('missionstatement'));},setMissionStatement:function(val){this.brandXML.setAttribute('missionstatement',escape(val));this.MissionStatement=val;},getHistory:function(){return unescape(this.brandXML.getAttribute('history'));},setHistory:function(val){this.brandXML.setAttribute('history',escape(val));this.History=val;},getTrademarks:function(){return unescape(this.brandXML.getAttribute('trademarks'));},setTrademarks:function(val){this.brandXML.setAttribute('trademarks',escape(val));this.Trademarks=val;},getTagline:function(){return unescape(this.brandXML.getAttribute('tagline'));},setTagline:function(val){this.brandXML.setAttribute('tagline',escape(val));this.Tagline=val;},getLogoThumb:function(){var rslt=null;for(i=0;i<this.brandXML.childNodes.length;i++)
if(this.brandXML.childNodes[i].nodeName.toLowerCase()=='logothumb'){for(j=0;j<this.brandXML.childNodes[i].childNodes.length;j++)
if(this.brandXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='imagereference'){rslt=new ImageReference(this.brandXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLogoThumb:function(aImageReference){var alsNd=null;this.LogoThumb=aImageReference;for(i=0;i<this.brandXML.childNodes.length;i++)
if(this.brandXML.childNodes[i].nodeName.toLowerCase()=='logothumb'){alsNd=this.brandXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('logothumb');this.brandXML.appendChild(alsNd);}
alsNd.appendChild(aImageReference.imagereferenceXML);this.setLogoThumbID(aImageReference.imagereferenceXML.getAttribute('imagereferenceid'));this.LogoThumbID=aImageReference.ImageReferenceID;},getLogoThumbID:function(){return this.brandXML.getAttribute('logothumbid');},setLogoThumbID:function(aImageReferenceID){this.brandXML.setAttribute('logothumbid',aImageReferenceID);this.LogoThumbID=aImageReferenceID},getLogo:function(){var rslt=null;for(i=0;i<this.brandXML.childNodes.length;i++)
if(this.brandXML.childNodes[i].nodeName.toLowerCase()=='logo'){for(j=0;j<this.brandXML.childNodes[i].childNodes.length;j++)
if(this.brandXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='imagereference'){rslt=new ImageReference(this.brandXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLogo:function(aImageReference){var alsNd=null;this.Logo=aImageReference;for(i=0;i<this.brandXML.childNodes.length;i++)
if(this.brandXML.childNodes[i].nodeName.toLowerCase()=='logo'){alsNd=this.brandXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('logo');this.brandXML.appendChild(alsNd);}
alsNd.appendChild(aImageReference.imagereferenceXML);this.setLogoID(aImageReference.imagereferenceXML.getAttribute('imagereferenceid'));this.LogoID=aImageReference.ImageReferenceID;},getLogoID:function(){return this.brandXML.getAttribute('logoid');},setLogoID:function(aImageReferenceID){this.brandXML.setAttribute('logoid',aImageReferenceID);this.LogoID=aImageReferenceID},getName:function(){return unescape(this.brandXML.getAttribute('name'));},setName:function(val){this.brandXML.setAttribute('name',escape(val));this.Name=val;}});var CartProduct=Class.create({cartproductXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='cartproduct')
this.cartproductXML=inputXML;else{this.cartproductXML=document.createElement('cartproduct');this.id=-1;this.cartproductXML.setAttribute('cartproductid',-1);this.cartproductXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.cartproductXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.cartproductXML.getAttribute('cartproductid');},setID:function(val){this.cartproductXML.setAttribute('cartproductid',val);this.CartProductID=val;},getCreateAt:function(){return this.cartproductXML.getAttribute('createdat');},getLastModified:function(){return this.cartproductXML.getAttribute('lastmodified');},getGroup:function(){var rslt=null;for(i=0;i<this.cartproductXML.childNodes.length;i++)
if(this.cartproductXML.childNodes[i].nodeName.toLowerCase()=='group'){for(j=0;j<this.cartproductXML.childNodes[i].childNodes.length;j++)
if(this.cartproductXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='cartgroup'){rslt=new CartGroup(this.cartproductXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setGroup:function(aCartGroup){var alsNd=null;this.Group=aCartGroup;for(i=0;i<this.cartproductXML.childNodes.length;i++)
if(this.cartproductXML.childNodes[i].nodeName.toLowerCase()=='group'){alsNd=this.cartproductXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('group');this.cartproductXML.appendChild(alsNd);}
alsNd.appendChild(aCartGroup.cartgroupXML);this.setGroupID(aCartGroup.cartgroupXML.getAttribute('cartgroupid'));this.GroupID=aCartGroup.CartGroupID;},getGroupID:function(){return this.cartproductXML.getAttribute('groupid');},setGroupID:function(aCartGroupID){this.cartproductXML.setAttribute('groupid',aCartGroupID);this.GroupID=aCartGroupID},getMaxInCart:function(){return unescape(this.cartproductXML.getAttribute('maxincart'));},setMaxInCart:function(val){this.cartproductXML.setAttribute('maxincart',escape(val));this.MaxInCart=val;},getAttributes:function(){var ret=new Array();for(i=0;i<this.cartproductXML.childNodes.length;i++)
if(this.cartproductXML.childNodes[i].nodeName.toLowerCase()=='attributes'){var ourNode=this.cartproductXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='stringkeyvaluepair')
ret.push(new StringKeyValuePair(ourNode.childNodes[j]));break;}
return ret;},setAttributes:function(stringkeyvaluepairList){stringkeyvaluepairList=Utl.toArray(stringkeyvaluepairList);this.Attributes=stringkeyvaluepairList;var alsNd=null;for(i=0;i<this.cartproductXML.childNodes.length;i++)
if(this.cartproductXML.childNodes[i].nodeName.toLowerCase()=='attributes'){alsNd=this.cartproductXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('attributes');this.cartproductXML.appendChild(alsNd);}
for(i=0;i<stringkeyvaluepairList.length;i++)
alsNd.appendChild(stringkeyvaluepairList[i].stringkeyvaluepairXML);},getOwnerAccount:function(){var rslt=null;for(i=0;i<this.cartproductXML.childNodes.length;i++)
if(this.cartproductXML.childNodes[i].nodeName.toLowerCase()=='owneraccount'){for(j=0;j<this.cartproductXML.childNodes[i].childNodes.length;j++)
if(this.cartproductXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='account'){rslt=new Account(this.cartproductXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setOwnerAccount:function(aAccount){var alsNd=null;this.OwnerAccount=aAccount;for(i=0;i<this.cartproductXML.childNodes.length;i++)
if(this.cartproductXML.childNodes[i].nodeName.toLowerCase()=='owneraccount'){alsNd=this.cartproductXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('owneraccount');this.cartproductXML.appendChild(alsNd);}
alsNd.appendChild(aAccount.accountXML);this.setOwnerAccountID(aAccount.accountXML.getAttribute('accountid'));this.OwnerAccountID=aAccount.AccountID;},getOwnerAccountID:function(){return this.cartproductXML.getAttribute('owneraccountid');},setOwnerAccountID:function(aAccountID){this.cartproductXML.setAttribute('owneraccountid',aAccountID);this.OwnerAccountID=aAccountID},getSortOrder:function(){return unescape(this.cartproductXML.getAttribute('sortorder'));},setSortOrder:function(val){this.cartproductXML.setAttribute('sortorder',escape(val));this.SortOrder=val;},getIsEnabled:function(){return unescape(this.cartproductXML.getAttribute('isenabled'));},setIsEnabled:function(val){this.cartproductXML.setAttribute('isenabled',escape(val));this.IsEnabled=val;},getPurchaseAction:function(){return unescape(this.cartproductXML.getAttribute('purchaseaction'));},setPurchaseAction:function(val){this.cartproductXML.setAttribute('purchaseaction',escape(val));this.PurchaseAction=val;},getDiscount:function(){return unescape(this.cartproductXML.getAttribute('discount'));},setDiscount:function(val){this.cartproductXML.setAttribute('discount',escape(val));this.Discount=val;},getPrice:function(){return unescape(this.cartproductXML.getAttribute('price'));},setPrice:function(val){this.cartproductXML.setAttribute('price',escape(val));this.Price=val;},getMainImage:function(){return unescape(this.cartproductXML.getAttribute('mainimage'));},setMainImage:function(val){this.cartproductXML.setAttribute('mainimage',escape(val));this.MainImage=val;},getDescription:function(){var rslt=null;for(i=0;i<this.cartproductXML.childNodes.length;i++)
if(this.cartproductXML.childNodes[i].nodeName.toLowerCase()=='description'){for(j=0;j<this.cartproductXML.childNodes[i].childNodes.length;j++)
if(this.cartproductXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='generalmarkup'){rslt=new GeneralMarkup(this.cartproductXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setDescription:function(aGeneralMarkup){var alsNd=null;this.Description=aGeneralMarkup;for(i=0;i<this.cartproductXML.childNodes.length;i++)
if(this.cartproductXML.childNodes[i].nodeName.toLowerCase()=='description'){alsNd=this.cartproductXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('description');this.cartproductXML.appendChild(alsNd);}
alsNd.appendChild(aGeneralMarkup.generalmarkupXML);this.setDescriptionID(aGeneralMarkup.generalmarkupXML.getAttribute('generalmarkupid'));this.DescriptionID=aGeneralMarkup.GeneralMarkupID;},getDescriptionID:function(){return this.cartproductXML.getAttribute('descriptionid');},setDescriptionID:function(aGeneralMarkupID){this.cartproductXML.setAttribute('descriptionid',aGeneralMarkupID);this.DescriptionID=aGeneralMarkupID},getSummary:function(){return unescape(this.cartproductXML.getAttribute('summary'));},setSummary:function(val){this.cartproductXML.setAttribute('summary',escape(val));this.Summary=val;},getName:function(){return unescape(this.cartproductXML.getAttribute('name'));},setName:function(val){this.cartproductXML.setAttribute('name',escape(val));this.Name=val;}});var CartOrderItem=Class.create({cartorderitemXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='cartorderitem')
this.cartorderitemXML=inputXML;else{this.cartorderitemXML=document.createElement('cartorderitem');this.id=-1;this.cartorderitemXML.setAttribute('cartorderitemid',-1);this.cartorderitemXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.cartorderitemXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.cartorderitemXML.getAttribute('cartorderitemid');},setID:function(val){this.cartorderitemXML.setAttribute('cartorderitemid',val);this.CartOrderItemID=val;},getCreateAt:function(){return this.cartorderitemXML.getAttribute('createdat');},getLastModified:function(){return this.cartorderitemXML.getAttribute('lastmodified');},getQuantity:function(){return unescape(this.cartorderitemXML.getAttribute('quantity'));},setQuantity:function(val){this.cartorderitemXML.setAttribute('quantity',escape(val));this.Quantity=val;},getProduct:function(){var rslt=null;for(i=0;i<this.cartorderitemXML.childNodes.length;i++)
if(this.cartorderitemXML.childNodes[i].nodeName.toLowerCase()=='product'){for(j=0;j<this.cartorderitemXML.childNodes[i].childNodes.length;j++)
if(this.cartorderitemXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='cartproduct'){rslt=new CartProduct(this.cartorderitemXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setProduct:function(aCartProduct){var alsNd=null;this.Product=aCartProduct;for(i=0;i<this.cartorderitemXML.childNodes.length;i++)
if(this.cartorderitemXML.childNodes[i].nodeName.toLowerCase()=='product'){alsNd=this.cartorderitemXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('product');this.cartorderitemXML.appendChild(alsNd);}
alsNd.appendChild(aCartProduct.cartproductXML);this.setProductID(aCartProduct.cartproductXML.getAttribute('cartproductid'));this.ProductID=aCartProduct.CartProductID;},getProductID:function(){return this.cartorderitemXML.getAttribute('productid');},setProductID:function(aCartProductID){this.cartorderitemXML.setAttribute('productid',aCartProductID);this.ProductID=aCartProductID},getPurchasePrice:function(){return unescape(this.cartorderitemXML.getAttribute('purchaseprice'));},setPurchasePrice:function(val){this.cartorderitemXML.setAttribute('purchaseprice',escape(val));this.PurchasePrice=val;}});var CartOrder=Class.create({cartorderXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='cartorder')
this.cartorderXML=inputXML;else{this.cartorderXML=document.createElement('cartorder');this.id=-1;this.cartorderXML.setAttribute('cartorderid',-1);this.cartorderXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.cartorderXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.cartorderXML.getAttribute('cartorderid');},setID:function(val){this.cartorderXML.setAttribute('cartorderid',val);this.CartOrderID=val;},getCreateAt:function(){return this.cartorderXML.getAttribute('createdat');},getLastModified:function(){return this.cartorderXML.getAttribute('lastmodified');},getIsEnabled:function(){return unescape(this.cartorderXML.getAttribute('isenabled'));},setIsEnabled:function(val){this.cartorderXML.setAttribute('isenabled',escape(val));this.IsEnabled=val;},getGatewayResponse:function(){return unescape(this.cartorderXML.getAttribute('gatewayresponse'));},setGatewayResponse:function(val){this.cartorderXML.setAttribute('gatewayresponse',escape(val));this.GatewayResponse=val;},getUserProfile:function(){var rslt=null;for(i=0;i<this.cartorderXML.childNodes.length;i++)
if(this.cartorderXML.childNodes[i].nodeName.toLowerCase()=='userprofile'){for(j=0;j<this.cartorderXML.childNodes[i].childNodes.length;j++)
if(this.cartorderXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='userprofile'){rslt=new UserProfile(this.cartorderXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setUserProfile:function(aUserProfile){var alsNd=null;this.UserProfile=aUserProfile;for(i=0;i<this.cartorderXML.childNodes.length;i++)
if(this.cartorderXML.childNodes[i].nodeName.toLowerCase()=='userprofile'){alsNd=this.cartorderXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('userprofile');this.cartorderXML.appendChild(alsNd);}
alsNd.appendChild(aUserProfile.userprofileXML);this.setUserProfileID(aUserProfile.userprofileXML.getAttribute('userprofileid'));this.UserProfileID=aUserProfile.UserProfileID;},getUserProfileID:function(){return this.cartorderXML.getAttribute('userprofileid');},setUserProfileID:function(aUserProfileID){this.cartorderXML.setAttribute('userprofileid',aUserProfileID);this.UserProfileID=aUserProfileID},getOrderItems:function(){var ret=new Array();for(i=0;i<this.cartorderXML.childNodes.length;i++)
if(this.cartorderXML.childNodes[i].nodeName.toLowerCase()=='orderitems'){var ourNode=this.cartorderXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='cartorderitem')
ret.push(new CartOrderItem(ourNode.childNodes[j]));break;}
return ret;},setOrderItems:function(cartorderitemList){cartorderitemList=Utl.toArray(cartorderitemList);this.OrderItems=cartorderitemList;var alsNd=null;for(i=0;i<this.cartorderXML.childNodes.length;i++)
if(this.cartorderXML.childNodes[i].nodeName.toLowerCase()=='orderitems'){alsNd=this.cartorderXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('orderitems');this.cartorderXML.appendChild(alsNd);}
for(i=0;i<cartorderitemList.length;i++)
alsNd.appendChild(cartorderitemList[i].cartorderitemXML);}});var CartGroup=Class.create({cartgroupXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='cartgroup')
this.cartgroupXML=inputXML;else{this.cartgroupXML=document.createElement('cartgroup');this.id=-1;this.cartgroupXML.setAttribute('cartgroupid',-1);}},getID:function(){return this.cartgroupXML.getAttribute('cartgroupid');},setID:function(val){this.cartgroupXML.setAttribute('cartgroupid',val);this.CartGroupID=val;},getParentID:function(){return unescape(this.cartgroupXML.getAttribute('parentid'));},setParentID:function(val){this.cartgroupXML.setAttribute('parentid',escape(val));this.ParentID=val;},getOwnerAccount:function(){var rslt=null;for(i=0;i<this.cartgroupXML.childNodes.length;i++)
if(this.cartgroupXML.childNodes[i].nodeName.toLowerCase()=='owneraccount'){for(j=0;j<this.cartgroupXML.childNodes[i].childNodes.length;j++)
if(this.cartgroupXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='account'){rslt=new Account(this.cartgroupXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setOwnerAccount:function(aAccount){var alsNd=null;this.OwnerAccount=aAccount;for(i=0;i<this.cartgroupXML.childNodes.length;i++)
if(this.cartgroupXML.childNodes[i].nodeName.toLowerCase()=='owneraccount'){alsNd=this.cartgroupXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('owneraccount');this.cartgroupXML.appendChild(alsNd);}
alsNd.appendChild(aAccount.accountXML);this.setOwnerAccountID(aAccount.accountXML.getAttribute('accountid'));this.OwnerAccountID=aAccount.AccountID;},getOwnerAccountID:function(){return this.cartgroupXML.getAttribute('owneraccountid');},setOwnerAccountID:function(aAccountID){this.cartgroupXML.setAttribute('owneraccountid',aAccountID);this.OwnerAccountID=aAccountID},getIsEnabled:function(){return unescape(this.cartgroupXML.getAttribute('isenabled'));},setIsEnabled:function(val){this.cartgroupXML.setAttribute('isenabled',escape(val));this.IsEnabled=val;},getSortOrder:function(){return unescape(this.cartgroupXML.getAttribute('sortorder'));},setSortOrder:function(val){this.cartgroupXML.setAttribute('sortorder',escape(val));this.SortOrder=val;},getMainImage:function(){return unescape(this.cartgroupXML.getAttribute('mainimage'));},setMainImage:function(val){this.cartgroupXML.setAttribute('mainimage',escape(val));this.MainImage=val;},getSummary:function(){return unescape(this.cartgroupXML.getAttribute('summary'));},setSummary:function(val){this.cartgroupXML.setAttribute('summary',escape(val));this.Summary=val;},getName:function(){return unescape(this.cartgroupXML.getAttribute('name'));},setName:function(val){this.cartgroupXML.setAttribute('name',escape(val));this.Name=val;}});var Bid=Class.create({bidXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='bid')
this.bidXML=inputXML;else{this.bidXML=document.createElement('bid');this.id=-1;this.bidXML.setAttribute('bidid',-1);this.bidXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.bidXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.bidXML.getAttribute('bidid');},setID:function(val){this.bidXML.setAttribute('bidid',val);this.BidID=val;},getCreateAt:function(){return this.bidXML.getAttribute('createdat');},getLastModified:function(){return this.bidXML.getAttribute('lastmodified');},getApprovedDate:function(){return unescape(this.bidXML.getAttribute('approveddate'));},setApprovedDate:function(val){this.bidXML.setAttribute('approveddate',escape(val));this.ApprovedDate=val;},getAbsentee:function(){return unescape(this.bidXML.getAttribute('absentee'));},setAbsentee:function(val){this.bidXML.setAttribute('absentee',escape(val));this.Absentee=val;},getComment:function(){return unescape(this.bidXML.getAttribute('comment'));},setComment:function(val){this.bidXML.setAttribute('comment',escape(val));this.Comment=val;},getIPAddress:function(){return unescape(this.bidXML.getAttribute('ipaddress'));},setIPAddress:function(val){this.bidXML.setAttribute('ipaddress',escape(val));this.IPAddress=val;},getBidder:function(){var rslt=null;for(i=0;i<this.bidXML.childNodes.length;i++)
if(this.bidXML.childNodes[i].nodeName.toLowerCase()=='bidder'){for(j=0;j<this.bidXML.childNodes[i].childNodes.length;j++)
if(this.bidXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='userprofile'){rslt=new UserProfile(this.bidXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setBidder:function(aUserProfile){var alsNd=null;this.Bidder=aUserProfile;for(i=0;i<this.bidXML.childNodes.length;i++)
if(this.bidXML.childNodes[i].nodeName.toLowerCase()=='bidder'){alsNd=this.bidXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('bidder');this.bidXML.appendChild(alsNd);}
alsNd.appendChild(aUserProfile.userprofileXML);this.setBidderID(aUserProfile.userprofileXML.getAttribute('userprofileid'));this.BidderID=aUserProfile.UserProfileID;},getBidderID:function(){return this.bidXML.getAttribute('bidderid');},setBidderID:function(aUserProfileID){this.bidXML.setAttribute('bidderid',aUserProfileID);this.BidderID=aUserProfileID},getAmount:function(){return unescape(this.bidXML.getAttribute('amount'));},setAmount:function(val){this.bidXML.setAttribute('amount',escape(val));this.Amount=val;}});var AuctionMarkup=Class.create({auctionmarkupXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='auctionmarkup')
this.auctionmarkupXML=inputXML;else{this.auctionmarkupXML=document.createElement('auctionmarkup');this.id=-1;this.auctionmarkupXML.setAttribute('auctionmarkupid',-1);}},getID:function(){return this.auctionmarkupXML.getAttribute('auctionmarkupid');},setID:function(val){this.auctionmarkupXML.setAttribute('auctionmarkupid',val);this.AuctionMarkupID=val;},getFileInformation:function(){var rslt=null;for(i=0;i<this.auctionmarkupXML.childNodes.length;i++)
if(this.auctionmarkupXML.childNodes[i].nodeName.toLowerCase()=='fileinformation'){for(j=0;j<this.auctionmarkupXML.childNodes[i].childNodes.length;j++)
if(this.auctionmarkupXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='fileinformation'){rslt=new FileInformation(this.auctionmarkupXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setFileInformation:function(aFileInformation){var alsNd=null;this.FileInformation=aFileInformation;for(i=0;i<this.auctionmarkupXML.childNodes.length;i++)
if(this.auctionmarkupXML.childNodes[i].nodeName.toLowerCase()=='fileinformation'){alsNd=this.auctionmarkupXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('fileinformation');this.auctionmarkupXML.appendChild(alsNd);}
alsNd.appendChild(aFileInformation.fileinformationXML);this.setFileInformationID(aFileInformation.fileinformationXML.getAttribute('fileinformationid'));this.FileInformationID=aFileInformation.FileInformationID;},getFileInformationID:function(){return this.auctionmarkupXML.getAttribute('fileinformationid');},setFileInformationID:function(aFileInformationID){this.auctionmarkupXML.setAttribute('fileinformationid',aFileInformationID);this.FileInformationID=aFileInformationID},getOverviewHTML:function(){return unescape(this.auctionmarkupXML.getAttribute('overviewhtml'));},setOverviewHTML:function(val){this.auctionmarkupXML.setAttribute('overviewhtml',escape(val));this.OverviewHTML=val;}});var AuctionItemType=Class.create({auctionitemtypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='auctionitemtype')
this.auctionitemtypeXML=inputXML;else{this.auctionitemtypeXML=document.createElement('auctionitemtype');}},getValue:function(){return unescape(this.auctionitemtypeXML.getAttribute('value'));},setValue:function(val){this.auctionitemtypeXML.setAttribute('value',escape(val));this.Value=val;}});AuctionItemType.values={Unknown:"Unknown",Property:"Property"}
var AuctionItem=Class.create({auctionitemXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='auctionitem')
this.auctionitemXML=inputXML;else{this.auctionitemXML=document.createElement('auctionitem');this.id=-1;this.auctionitemXML.setAttribute('auctionitemid',-1);this.auctionitemXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.auctionitemXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.auctionitemXML.getAttribute('auctionitemid');},setID:function(val){this.auctionitemXML.setAttribute('auctionitemid',val);this.AuctionItemID=val;},getCreateAt:function(){return this.auctionitemXML.getAttribute('createdat');},getLastModified:function(){return this.auctionitemXML.getAttribute('lastmodified');},getMarketPriceHidden:function(){return unescape(this.auctionitemXML.getAttribute('marketpricehidden'));},setMarketPriceHidden:function(val){this.auctionitemXML.setAttribute('marketpricehidden',escape(val));this.MarketPriceHidden=val;},getReservePriceHidden:function(){return unescape(this.auctionitemXML.getAttribute('reservepricehidden'));},setReservePriceHidden:function(val){this.auctionitemXML.setAttribute('reservepricehidden',escape(val));this.ReservePriceHidden=val;},getInitialPriceHidden:function(){return unescape(this.auctionitemXML.getAttribute('initialpricehidden'));},setInitialPriceHidden:function(val){this.auctionitemXML.setAttribute('initialpricehidden',escape(val));this.InitialPriceHidden=val;},getIsEnabled:function(){return unescape(this.auctionitemXML.getAttribute('isenabled'));},setIsEnabled:function(val){this.auctionitemXML.setAttribute('isenabled',escape(val));this.IsEnabled=val;},getDepositAmount:function(){return unescape(this.auctionitemXML.getAttribute('depositamount'));},setDepositAmount:function(val){this.auctionitemXML.setAttribute('depositamount',escape(val));this.DepositAmount=val;},getBuyoutPrice:function(){return unescape(this.auctionitemXML.getAttribute('buyoutprice'));},setBuyoutPrice:function(val){this.auctionitemXML.setAttribute('buyoutprice',escape(val));this.BuyoutPrice=val;},getBidIncrement:function(){return unescape(this.auctionitemXML.getAttribute('bidincrement'));},setBidIncrement:function(val){this.auctionitemXML.setAttribute('bidincrement',escape(val));this.BidIncrement=val;},getInitialPrice:function(){return unescape(this.auctionitemXML.getAttribute('initialprice'));},setInitialPrice:function(val){this.auctionitemXML.setAttribute('initialprice',escape(val));this.InitialPrice=val;},getMarketPrice:function(){return unescape(this.auctionitemXML.getAttribute('marketprice'));},setMarketPrice:function(val){this.auctionitemXML.setAttribute('marketprice',escape(val));this.MarketPrice=val;},getReservePrice:function(){return unescape(this.auctionitemXML.getAttribute('reserveprice'));},setReservePrice:function(val){this.auctionitemXML.setAttribute('reserveprice',escape(val));this.ReservePrice=val;},getBids:function(){var ret=new Array();for(i=0;i<this.auctionitemXML.childNodes.length;i++)
if(this.auctionitemXML.childNodes[i].nodeName.toLowerCase()=='bids'){var ourNode=this.auctionitemXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='bid')
ret.push(new Bid(ourNode.childNodes[j]));break;}
return ret;},setBids:function(bidList){bidList=Utl.toArray(bidList);this.Bids=bidList;var alsNd=null;for(i=0;i<this.auctionitemXML.childNodes.length;i++)
if(this.auctionitemXML.childNodes[i].nodeName.toLowerCase()=='bids'){alsNd=this.auctionitemXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('bids');this.auctionitemXML.appendChild(alsNd);}
for(i=0;i<bidList.length;i++)
alsNd.appendChild(bidList[i].bidXML);},getItemType:function(){var rslt=null;for(i=0;i<this.auctionitemXML.childNodes.length;i++)
if(this.auctionitemXML.childNodes[i].nodeName.toLowerCase()=='itemtype'){for(j=0;j<this.auctionitemXML.childNodes[i].childNodes.length;j++)
if(this.auctionitemXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='auctionitemtype'){rslt=new AuctionItemType(this.auctionitemXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setItemType:function(aAuctionItemType){var alsNd=null;this.ItemType=aAuctionItemType;for(i=0;i<this.auctionitemXML.childNodes.length;i++)
if(this.auctionitemXML.childNodes[i].nodeName.toLowerCase()=='itemtype'){alsNd=this.auctionitemXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('itemtype');this.auctionitemXML.appendChild(alsNd);}
alsNd.appendChild(aAuctionItemType.auctionitemtypeXML);},getItemID:function(){return unescape(this.auctionitemXML.getAttribute('itemid'));},setItemID:function(val){this.auctionitemXML.setAttribute('itemid',escape(val));this.ItemID=val;}});var Auction=Class.create({auctionXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='auction')
this.auctionXML=inputXML;else{this.auctionXML=document.createElement('auction');this.id=-1;this.auctionXML.setAttribute('auctionid',-1);this.auctionXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.auctionXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.auctionXML.getAttribute('auctionid');},setID:function(val){this.auctionXML.setAttribute('auctionid',val);this.AuctionID=val;},getCreateAt:function(){return this.auctionXML.getAttribute('createdat');},getLastModified:function(){return this.auctionXML.getAttribute('lastmodified');},getLegalInfo:function(){var rslt=null;for(i=0;i<this.auctionXML.childNodes.length;i++)
if(this.auctionXML.childNodes[i].nodeName.toLowerCase()=='legalinfo'){for(j=0;j<this.auctionXML.childNodes[i].childNodes.length;j++)
if(this.auctionXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='auctionmarkup'){rslt=new AuctionMarkup(this.auctionXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLegalInfo:function(aAuctionMarkup){var alsNd=null;this.LegalInfo=aAuctionMarkup;for(i=0;i<this.auctionXML.childNodes.length;i++)
if(this.auctionXML.childNodes[i].nodeName.toLowerCase()=='legalinfo'){alsNd=this.auctionXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('legalinfo');this.auctionXML.appendChild(alsNd);}
alsNd.appendChild(aAuctionMarkup.auctionmarkupXML);this.setLegalInfoID(aAuctionMarkup.auctionmarkupXML.getAttribute('auctionmarkupid'));this.LegalInfoID=aAuctionMarkup.AuctionMarkupID;},getLegalInfoID:function(){return this.auctionXML.getAttribute('legalinfoid');},setLegalInfoID:function(aAuctionMarkupID){this.auctionXML.setAttribute('legalinfoid',aAuctionMarkupID);this.LegalInfoID=aAuctionMarkupID},getIsEnabled:function(){return unescape(this.auctionXML.getAttribute('isenabled'));},setIsEnabled:function(val){this.auctionXML.setAttribute('isenabled',escape(val));this.IsEnabled=val;},getDisplayableAttributes:function(){var ret=new Array();for(i=0;i<this.auctionXML.childNodes.length;i++)
if(this.auctionXML.childNodes[i].nodeName.toLowerCase()=='displayableattributes'){var ourNode=this.auctionXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='stringkeyvaluepair')
ret.push(new StringKeyValuePair(ourNode.childNodes[j]));break;}
return ret;},setDisplayableAttributes:function(stringkeyvaluepairList){stringkeyvaluepairList=Utl.toArray(stringkeyvaluepairList);this.DisplayableAttributes=stringkeyvaluepairList;var alsNd=null;for(i=0;i<this.auctionXML.childNodes.length;i++)
if(this.auctionXML.childNodes[i].nodeName.toLowerCase()=='displayableattributes'){alsNd=this.auctionXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('displayableattributes');this.auctionXML.appendChild(alsNd);}
for(i=0;i<stringkeyvaluepairList.length;i++)
alsNd.appendChild(stringkeyvaluepairList[i].stringkeyvaluepairXML);},getOwnerAccount:function(){return unescape(this.auctionXML.getAttribute('owneraccount'));},setOwnerAccount:function(val){this.auctionXML.setAttribute('owneraccount',escape(val));this.OwnerAccount=val;},getRegisteredUsers:function(){var ret=new Array();for(i=0;i<this.auctionXML.childNodes.length;i++)
if(this.auctionXML.childNodes[i].nodeName.toLowerCase()=='registeredusers'){var ourNode=this.auctionXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='userprofile')
ret.push(new UserProfile(ourNode.childNodes[j]));break;}
return ret;},setRegisteredUsers:function(userprofileList){userprofileList=Utl.toArray(userprofileList);this.RegisteredUsers=userprofileList;var alsNd=null;for(i=0;i<this.auctionXML.childNodes.length;i++)
if(this.auctionXML.childNodes[i].nodeName.toLowerCase()=='registeredusers'){alsNd=this.auctionXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('registeredusers');this.auctionXML.appendChild(alsNd);}
for(i=0;i<userprofileList.length;i++)
alsNd.appendChild(userprofileList[i].userprofileXML);},getAuctionItems:function(){var ret=new Array();for(i=0;i<this.auctionXML.childNodes.length;i++)
if(this.auctionXML.childNodes[i].nodeName.toLowerCase()=='auctionitems'){var ourNode=this.auctionXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='auctionitem')
ret.push(new AuctionItem(ourNode.childNodes[j]));break;}
return ret;},setAuctionItems:function(auctionitemList){auctionitemList=Utl.toArray(auctionitemList);this.AuctionItems=auctionitemList;var alsNd=null;for(i=0;i<this.auctionXML.childNodes.length;i++)
if(this.auctionXML.childNodes[i].nodeName.toLowerCase()=='auctionitems'){alsNd=this.auctionXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('auctionitems');this.auctionXML.appendChild(alsNd);}
for(i=0;i<auctionitemList.length;i++)
alsNd.appendChild(auctionitemList[i].auctionitemXML);},getTagName:function(){return unescape(this.auctionXML.getAttribute('tagname'));},setTagName:function(val){this.auctionXML.setAttribute('tagname',escape(val));this.TagName=val;},getNote:function(){return unescape(this.auctionXML.getAttribute('note'));},setNote:function(val){this.auctionXML.setAttribute('note',escape(val));this.Note=val;},getSummary:function(){return unescape(this.auctionXML.getAttribute('summary'));},setSummary:function(val){this.auctionXML.setAttribute('summary',escape(val));this.Summary=val;},getName:function(){return unescape(this.auctionXML.getAttribute('name'));},setName:function(val){this.auctionXML.setAttribute('name',escape(val));this.Name=val;},getRegistrationDate:function(){return unescape(this.auctionXML.getAttribute('registrationdate'));},setRegistrationDate:function(val){this.auctionXML.setAttribute('registrationdate',escape(val));this.RegistrationDate=val;},getEndDate:function(){return unescape(this.auctionXML.getAttribute('enddate'));},setEndDate:function(val){this.auctionXML.setAttribute('enddate',escape(val));this.EndDate=val;},getStartDate:function(){return unescape(this.auctionXML.getAttribute('startdate'));},setStartDate:function(val){this.auctionXML.setAttribute('startdate',escape(val));this.StartDate=val;}});Auction.containsAuction=function(auctions,auctionID)
{var retVal=false;if(!auctions)return false;for(var idx=0;idx<auctions.length;idx++)
if(auctions[idx].auctionid==auctionID)
{retVal=true;break;}
return retVal;}
Auction.containsAuctionItem=function(auctions,auctionItemID)
{var retVal=false;if(!auctions)return false;for(var idx=0;idx<auctions.length;idx++)
if(auctions[idx].auctionitems)
for(var idy=0;idy<auctions[idx].auctionitems.length;idy++)
if(auctions[idx].auctionitems[idy].auctionitemid==auctionItemID)
{retVal=true;break;}
return retVal;}
var ExternalReference=Class.create({externalreferenceXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='externalreference')
this.externalreferenceXML=inputXML;else{this.externalreferenceXML=document.createElement('externalreference');this.id=-1;this.externalreferenceXML.setAttribute('externalreferenceid',-1);}},getID:function(){return this.externalreferenceXML.getAttribute('externalreferenceid');},setID:function(val){this.externalreferenceXML.setAttribute('externalreferenceid',val);this.ExternalReferenceID=val;},getInternalID:function(){return unescape(this.externalreferenceXML.getAttribute('internalid'));},setInternalID:function(val){this.externalreferenceXML.setAttribute('internalid',escape(val));this.InternalID=val;},getExternalID:function(){return unescape(this.externalreferenceXML.getAttribute('externalid'));},setExternalID:function(val){this.externalreferenceXML.setAttribute('externalid',escape(val));this.ExternalID=val;}});var DevelopmentFeed=Class.create({developmentfeedXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='developmentfeed')
this.developmentfeedXML=inputXML;else{this.developmentfeedXML=document.createElement('developmentfeed');this.id=-1;this.developmentfeedXML.setAttribute('developmentfeedid',-1);}},getID:function(){return this.developmentfeedXML.getAttribute('developmentfeedid');},setID:function(val){this.developmentfeedXML.setAttribute('developmentfeedid',val);this.DevelopmentFeedID=val;},getDevelopmentReference:function(){var ret=new Array();for(i=0;i<this.developmentfeedXML.childNodes.length;i++)
if(this.developmentfeedXML.childNodes[i].nodeName.toLowerCase()=='developmentreference'){var ourNode=this.developmentfeedXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='externalreference')
ret.push(new ExternalReference(ourNode.childNodes[j]));break;}
return ret;},setDevelopmentReference:function(externalreferenceList){externalreferenceList=Utl.toArray(externalreferenceList);this.DevelopmentReference=externalreferenceList;var alsNd=null;for(i=0;i<this.developmentfeedXML.childNodes.length;i++)
if(this.developmentfeedXML.childNodes[i].nodeName.toLowerCase()=='developmentreference'){alsNd=this.developmentfeedXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('developmentreference');this.developmentfeedXML.appendChild(alsNd);}
for(i=0;i<externalreferenceList.length;i++)
alsNd.appendChild(externalreferenceList[i].externalreferenceXML);},getSchemaVersion:function(){return unescape(this.developmentfeedXML.getAttribute('schemaversion'));},setSchemaVersion:function(val){this.developmentfeedXML.setAttribute('schemaversion',escape(val));this.SchemaVersion=val;},getAccount:function(){var rslt=null;for(i=0;i<this.developmentfeedXML.childNodes.length;i++)
if(this.developmentfeedXML.childNodes[i].nodeName.toLowerCase()=='account'){for(j=0;j<this.developmentfeedXML.childNodes[i].childNodes.length;j++)
if(this.developmentfeedXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='account'){rslt=new Account(this.developmentfeedXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setAccount:function(aAccount){var alsNd=null;this.Account=aAccount;for(i=0;i<this.developmentfeedXML.childNodes.length;i++)
if(this.developmentfeedXML.childNodes[i].nodeName.toLowerCase()=='account'){alsNd=this.developmentfeedXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('account');this.developmentfeedXML.appendChild(alsNd);}
alsNd.appendChild(aAccount.accountXML);this.setAccountID(aAccount.accountXML.getAttribute('accountid'));this.AccountID=aAccount.AccountID;},getAccountID:function(){return this.developmentfeedXML.getAttribute('accountid');},setAccountID:function(aAccountID){this.developmentfeedXML.setAttribute('accountid',aAccountID);this.AccountID=aAccountID},getLogin:function(){var rslt=null;for(i=0;i<this.developmentfeedXML.childNodes.length;i++)
if(this.developmentfeedXML.childNodes[i].nodeName.toLowerCase()=='login'){for(j=0;j<this.developmentfeedXML.childNodes[i].childNodes.length;j++)
if(this.developmentfeedXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='login'){rslt=new Login(this.developmentfeedXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLogin:function(aLogin){var alsNd=null;this.Login=aLogin;for(i=0;i<this.developmentfeedXML.childNodes.length;i++)
if(this.developmentfeedXML.childNodes[i].nodeName.toLowerCase()=='login'){alsNd=this.developmentfeedXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('login');this.developmentfeedXML.appendChild(alsNd);}
alsNd.appendChild(aLogin.loginXML);this.setLoginID(aLogin.loginXML.getAttribute('loginid'));this.LoginID=aLogin.LoginID;},getLoginID:function(){return this.developmentfeedXML.getAttribute('loginid');},setLoginID:function(aLoginID){this.developmentfeedXML.setAttribute('loginid',aLoginID);this.LoginID=aLoginID}});var PropertyMarkup=Class.create({propertymarkupXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='propertymarkup')
this.propertymarkupXML=inputXML;else{this.propertymarkupXML=document.createElement('propertymarkup');this.id=-1;this.propertymarkupXML.setAttribute('propertymarkupid',-1);}},getID:function(){return this.propertymarkupXML.getAttribute('propertymarkupid');},setID:function(val){this.propertymarkupXML.setAttribute('propertymarkupid',val);this.PropertyMarkupID=val;},getSummaryImage:function(){var rslt=null;for(i=0;i<this.propertymarkupXML.childNodes.length;i++)
if(this.propertymarkupXML.childNodes[i].nodeName.toLowerCase()=='summaryimage'){for(j=0;j<this.propertymarkupXML.childNodes[i].childNodes.length;j++)
if(this.propertymarkupXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='imagereference'){rslt=new ImageReference(this.propertymarkupXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setSummaryImage:function(aImageReference){var alsNd=null;this.SummaryImage=aImageReference;for(i=0;i<this.propertymarkupXML.childNodes.length;i++)
if(this.propertymarkupXML.childNodes[i].nodeName.toLowerCase()=='summaryimage'){alsNd=this.propertymarkupXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('summaryimage');this.propertymarkupXML.appendChild(alsNd);}
alsNd.appendChild(aImageReference.imagereferenceXML);this.setSummaryImageID(aImageReference.imagereferenceXML.getAttribute('imagereferenceid'));this.SummaryImageID=aImageReference.ImageReferenceID;},getSummaryImageID:function(){return this.propertymarkupXML.getAttribute('summaryimageid');},setSummaryImageID:function(aImageReferenceID){this.propertymarkupXML.setAttribute('summaryimageid',aImageReferenceID);this.SummaryImageID=aImageReferenceID},getImages:function(){var ret=new Array();for(i=0;i<this.propertymarkupXML.childNodes.length;i++)
if(this.propertymarkupXML.childNodes[i].nodeName.toLowerCase()=='images'){var ourNode=this.propertymarkupXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='imagereference')
ret.push(new ImageReference(ourNode.childNodes[j]));break;}
return ret;},setImages:function(imagereferenceList){imagereferenceList=Utl.toArray(imagereferenceList);this.Images=imagereferenceList;var alsNd=null;for(i=0;i<this.propertymarkupXML.childNodes.length;i++)
if(this.propertymarkupXML.childNodes[i].nodeName.toLowerCase()=='images'){alsNd=this.propertymarkupXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('images');this.propertymarkupXML.appendChild(alsNd);}
for(i=0;i<imagereferenceList.length;i++)
alsNd.appendChild(imagereferenceList[i].imagereferenceXML);},getOverviewHTML:function(){return unescape(this.propertymarkupXML.getAttribute('overviewhtml'));},setOverviewHTML:function(val){this.propertymarkupXML.setAttribute('overviewhtml',escape(val));this.OverviewHTML=val;}});var Property=Class.create({propertyXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='property')
this.propertyXML=inputXML;else{this.propertyXML=document.createElement('property');this.id=-1;this.propertyXML.setAttribute('propertyid',-1);}},getID:function(){return this.propertyXML.getAttribute('propertyid');},setID:function(val){this.propertyXML.setAttribute('propertyid',val);this.PropertyID=val;},getDepositAmount:function(){return unescape(this.propertyXML.getAttribute('depositamount'));},setDepositAmount:function(val){this.propertyXML.setAttribute('depositamount',escape(val));this.DepositAmount=val;},getBidIncrement:function(){return unescape(this.propertyXML.getAttribute('bidincrement'));},setBidIncrement:function(val){this.propertyXML.setAttribute('bidincrement',escape(val));this.BidIncrement=val;},getMarketPriceHidden:function(){return unescape(this.propertyXML.getAttribute('marketpricehidden'));},setMarketPriceHidden:function(val){this.propertyXML.setAttribute('marketpricehidden',escape(val));this.MarketPriceHidden=val;},getMarketPrice:function(){return unescape(this.propertyXML.getAttribute('marketprice'));},setMarketPrice:function(val){this.propertyXML.setAttribute('marketprice',escape(val));this.MarketPrice=val;},getReservePriceHidden:function(){return unescape(this.propertyXML.getAttribute('reservepricehidden'));},setReservePriceHidden:function(val){this.propertyXML.setAttribute('reservepricehidden',escape(val));this.ReservePriceHidden=val;},getReservePrice:function(){return unescape(this.propertyXML.getAttribute('reserveprice'));},setReservePrice:function(val){this.propertyXML.setAttribute('reserveprice',escape(val));this.ReservePrice=val;},getInitialPriceHidden:function(){return unescape(this.propertyXML.getAttribute('initialpricehidden'));},setInitialPriceHidden:function(val){this.propertyXML.setAttribute('initialpricehidden',escape(val));this.InitialPriceHidden=val;},getInitialPrice:function(){return unescape(this.propertyXML.getAttribute('initialprice'));},setInitialPrice:function(val){this.propertyXML.setAttribute('initialprice',escape(val));this.InitialPrice=val;},getIsEnabled:function(){return unescape(this.propertyXML.getAttribute('isenabled'));},setIsEnabled:function(val){this.propertyXML.setAttribute('isenabled',escape(val));this.IsEnabled=val;},getIsAuction:function(){return unescape(this.propertyXML.getAttribute('isauction'));},setIsAuction:function(val){this.propertyXML.setAttribute('isauction',escape(val));this.IsAuction=val;},getGeneralAttributes:function(){var ret=new Array();for(i=0;i<this.propertyXML.childNodes.length;i++)
if(this.propertyXML.childNodes[i].nodeName.toLowerCase()=='generalattributes'){var ourNode=this.propertyXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='stringkeyvaluepair')
ret.push(new StringKeyValuePair(ourNode.childNodes[j]));break;}
return ret;},setGeneralAttributes:function(stringkeyvaluepairList){stringkeyvaluepairList=Utl.toArray(stringkeyvaluepairList);this.GeneralAttributes=stringkeyvaluepairList;var alsNd=null;for(i=0;i<this.propertyXML.childNodes.length;i++)
if(this.propertyXML.childNodes[i].nodeName.toLowerCase()=='generalattributes'){alsNd=this.propertyXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('generalattributes');this.propertyXML.appendChild(alsNd);}
for(i=0;i<stringkeyvaluepairList.length;i++)
alsNd.appendChild(stringkeyvaluepairList[i].stringkeyvaluepairXML);},getSqFtAttributes:function(){var ret=new Array();for(i=0;i<this.propertyXML.childNodes.length;i++)
if(this.propertyXML.childNodes[i].nodeName.toLowerCase()=='sqftattributes'){var ourNode=this.propertyXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='intkeyvaluepair')
ret.push(new IntKeyValuePair(ourNode.childNodes[j]));break;}
return ret;},setSqFtAttributes:function(intkeyvaluepairList){intkeyvaluepairList=Utl.toArray(intkeyvaluepairList);this.SqFtAttributes=intkeyvaluepairList;var alsNd=null;for(i=0;i<this.propertyXML.childNodes.length;i++)
if(this.propertyXML.childNodes[i].nodeName.toLowerCase()=='sqftattributes'){alsNd=this.propertyXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('sqftattributes');this.propertyXML.appendChild(alsNd);}
for(i=0;i<intkeyvaluepairList.length;i++)
alsNd.appendChild(intkeyvaluepairList[i].intkeyvaluepairXML);},getStories:function(){return unescape(this.propertyXML.getAttribute('stories'));},setStories:function(val){this.propertyXML.setAttribute('stories',escape(val));this.Stories=val;},getSqFtUnfinsished:function(){return unescape(this.propertyXML.getAttribute('sqftunfinsished'));},setSqFtUnfinsished:function(val){this.propertyXML.setAttribute('sqftunfinsished',escape(val));this.SqFtUnfinsished=val;},getSqFtFinished:function(){return unescape(this.propertyXML.getAttribute('sqftfinished'));},setSqFtFinished:function(val){this.propertyXML.setAttribute('sqftfinished',escape(val));this.SqFtFinished=val;},getSqFtTotal:function(){return unescape(this.propertyXML.getAttribute('sqfttotal'));},setSqFtTotal:function(val){this.propertyXML.setAttribute('sqfttotal',escape(val));this.SqFtTotal=val;},getInventory:function(){return unescape(this.propertyXML.getAttribute('inventory'));},setInventory:function(val){this.propertyXML.setAttribute('inventory',escape(val));this.Inventory=val;},getNumberBathrooms:function(){return unescape(this.propertyXML.getAttribute('numberbathrooms'));},setNumberBathrooms:function(val){this.propertyXML.setAttribute('numberbathrooms',escape(val));this.NumberBathrooms=val;},getNumberBedrooms:function(){return unescape(this.propertyXML.getAttribute('numberbedrooms'));},setNumberBedrooms:function(val){this.propertyXML.setAttribute('numberbedrooms',escape(val));this.NumberBedrooms=val;},getPropertyStatus:function(){return unescape(this.propertyXML.getAttribute('propertystatus'));},setPropertyStatus:function(val){this.propertyXML.setAttribute('propertystatus',escape(val));this.PropertyStatus=val;},getPropertyType:function(){var rslt=null;for(i=0;i<this.propertyXML.childNodes.length;i++)
if(this.propertyXML.childNodes[i].nodeName.toLowerCase()=='propertytype'){for(j=0;j<this.propertyXML.childNodes[i].childNodes.length;j++)
if(this.propertyXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='realestatetag'){rslt=new RealestateTag(this.propertyXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setPropertyType:function(aRealestateTag){var alsNd=null;this.PropertyType=aRealestateTag;for(i=0;i<this.propertyXML.childNodes.length;i++)
if(this.propertyXML.childNodes[i].nodeName.toLowerCase()=='propertytype'){alsNd=this.propertyXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('propertytype');this.propertyXML.appendChild(alsNd);}
alsNd.appendChild(aRealestateTag.realestatetagXML);this.setPropertyTypeID(aRealestateTag.realestatetagXML.getAttribute('realestatetagid'));this.PropertyTypeID=aRealestateTag.RealestateTagID;},getPropertyTypeID:function(){return this.propertyXML.getAttribute('propertytypeid');},setPropertyTypeID:function(aRealestateTagID){this.propertyXML.setAttribute('propertytypeid',aRealestateTagID);this.PropertyTypeID=aRealestateTagID},getSummaryDescription:function(){return unescape(this.propertyXML.getAttribute('summarydescription'));},setSummaryDescription:function(val){this.propertyXML.setAttribute('summarydescription',escape(val));this.SummaryDescription=val;},getPrice:function(){return unescape(this.propertyXML.getAttribute('price'));},setPrice:function(val){this.propertyXML.setAttribute('price',escape(val));this.Price=val;},getPriceOverride:function(){return unescape(this.propertyXML.getAttribute('priceoverride'));},setPriceOverride:function(val){this.propertyXML.setAttribute('priceoverride',escape(val));this.PriceOverride=val;},getStartDate:function(){return unescape(this.propertyXML.getAttribute('startdate'));},setStartDate:function(val){this.propertyXML.setAttribute('startdate',escape(val));this.StartDate=val;},getEndDate:function(){return unescape(this.propertyXML.getAttribute('enddate'));},setEndDate:function(val){this.propertyXML.setAttribute('enddate',escape(val));this.EndDate=val;},getIsRental:function(){return unescape(this.propertyXML.getAttribute('isrental'));},setIsRental:function(val){this.propertyXML.setAttribute('isrental',escape(val));this.IsRental=val;},getName:function(){return unescape(this.propertyXML.getAttribute('name'));},setName:function(val){this.propertyXML.setAttribute('name',escape(val));this.Name=val;}});var FeaturedDevelopment=Class.create({featureddevelopmentXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='featureddevelopment')
this.featureddevelopmentXML=inputXML;else{this.featureddevelopmentXML=document.createElement('featureddevelopment');this.id=-1;this.featureddevelopmentXML.setAttribute('featureddevelopmentid',-1);}},getID:function(){return this.featureddevelopmentXML.getAttribute('featureddevelopmentid');},setID:function(val){this.featureddevelopmentXML.setAttribute('featureddevelopmentid',val);this.FeaturedDevelopmentID=val;},getProductKey:function(){return unescape(this.featureddevelopmentXML.getAttribute('productkey'));},setProductKey:function(val){this.featureddevelopmentXML.setAttribute('productkey',escape(val));this.ProductKey=val;},getDevelopmentID:function(){return unescape(this.featureddevelopmentXML.getAttribute('developmentid'));},setDevelopmentID:function(val){this.featureddevelopmentXML.setAttribute('developmentid',escape(val));this.DevelopmentID=val;}});var DevelopmentMarkup=Class.create({developmentmarkupXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='developmentmarkup')
this.developmentmarkupXML=inputXML;else{this.developmentmarkupXML=document.createElement('developmentmarkup');this.id=-1;this.developmentmarkupXML.setAttribute('developmentmarkupid',-1);}},getID:function(){return this.developmentmarkupXML.getAttribute('developmentmarkupid');},setID:function(val){this.developmentmarkupXML.setAttribute('developmentmarkupid',val);this.DevelopmentMarkupID=val;},getSummaryImage:function(){var rslt=null;for(i=0;i<this.developmentmarkupXML.childNodes.length;i++)
if(this.developmentmarkupXML.childNodes[i].nodeName.toLowerCase()=='summaryimage'){for(j=0;j<this.developmentmarkupXML.childNodes[i].childNodes.length;j++)
if(this.developmentmarkupXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='imagereference'){rslt=new ImageReference(this.developmentmarkupXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setSummaryImage:function(aImageReference){var alsNd=null;this.SummaryImage=aImageReference;for(i=0;i<this.developmentmarkupXML.childNodes.length;i++)
if(this.developmentmarkupXML.childNodes[i].nodeName.toLowerCase()=='summaryimage'){alsNd=this.developmentmarkupXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('summaryimage');this.developmentmarkupXML.appendChild(alsNd);}
alsNd.appendChild(aImageReference.imagereferenceXML);this.setSummaryImageID(aImageReference.imagereferenceXML.getAttribute('imagereferenceid'));this.SummaryImageID=aImageReference.ImageReferenceID;},getSummaryImageID:function(){return this.developmentmarkupXML.getAttribute('summaryimageid');},setSummaryImageID:function(aImageReferenceID){this.developmentmarkupXML.setAttribute('summaryimageid',aImageReferenceID);this.SummaryImageID=aImageReferenceID},getOverviewHTML:function(){return unescape(this.developmentmarkupXML.getAttribute('overviewhtml'));},setOverviewHTML:function(val){this.developmentmarkupXML.setAttribute('overviewhtml',escape(val));this.OverviewHTML=val;}});var Development=Class.create({developmentXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='development')
this.developmentXML=inputXML;else{this.developmentXML=document.createElement('development');this.id=-1;this.developmentXML.setAttribute('developmentid',-1);this.developmentXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.developmentXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.developmentXML.getAttribute('developmentid');},setID:function(val){this.developmentXML.setAttribute('developmentid',val);this.DevelopmentID=val;},getCreateAt:function(){return this.developmentXML.getAttribute('createdat');},getLastModified:function(){return this.developmentXML.getAttribute('lastmodified');},getIsSingleListing:function(){return unescape(this.developmentXML.getAttribute('issinglelisting'));},setIsSingleListing:function(val){this.developmentXML.setAttribute('issinglelisting',escape(val));this.IsSingleListing=val;},getCommentThread:function(){var rslt=null;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='commentthread'){for(j=0;j<this.developmentXML.childNodes[i].childNodes.length;j++)
if(this.developmentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='blogthread'){rslt=new BlogThread(this.developmentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setCommentThread:function(aBlogThread){var alsNd=null;this.CommentThread=aBlogThread;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='commentthread'){alsNd=this.developmentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('commentthread');this.developmentXML.appendChild(alsNd);}
alsNd.appendChild(aBlogThread.blogthreadXML);this.setCommentThreadID(aBlogThread.blogthreadXML.getAttribute('blogthreadid'));this.CommentThreadID=aBlogThread.BlogThreadID;},getCommentThreadID:function(){return this.developmentXML.getAttribute('commentthreadid');},setCommentThreadID:function(aBlogThreadID){this.developmentXML.setAttribute('commentthreadid',aBlogThreadID);this.CommentThreadID=aBlogThreadID},getLocation:function(){var rslt=null;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='location'){for(j=0;j<this.developmentXML.childNodes[i].childNodes.length;j++)
if(this.developmentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='geocode'){rslt=new Geocode(this.developmentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLocation:function(aGeocode){var alsNd=null;this.Location=aGeocode;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='location'){alsNd=this.developmentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('location');this.developmentXML.appendChild(alsNd);}
alsNd.appendChild(aGeocode.geocodeXML);this.setLocationID(aGeocode.geocodeXML.getAttribute('geocodeid'));this.LocationID=aGeocode.GeocodeID;},getLocationID:function(){return this.developmentXML.getAttribute('locationid');},setLocationID:function(aGeocodeID){this.developmentXML.setAttribute('locationid',aGeocodeID);this.LocationID=aGeocodeID},getProperties:function(){var ret=new Array();for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='properties'){var ourNode=this.developmentXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='property')
ret.push(new Property(ourNode.childNodes[j]));break;}
return ret;},setProperties:function(propertyList){propertyList=Utl.toArray(propertyList);this.Properties=propertyList;var alsNd=null;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='properties'){alsNd=this.developmentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('properties');this.developmentXML.appendChild(alsNd);}
for(i=0;i<propertyList.length;i++)
alsNd.appendChild(propertyList[i].propertyXML);},getPresentationData:function(){var rslt=null;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='presentationdata'){for(j=0;j<this.developmentXML.childNodes[i].childNodes.length;j++)
if(this.developmentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='developmentmarkup'){rslt=new DevelopmentMarkup(this.developmentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setPresentationData:function(aDevelopmentMarkup){var alsNd=null;this.PresentationData=aDevelopmentMarkup;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='presentationdata'){alsNd=this.developmentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('presentationdata');this.developmentXML.appendChild(alsNd);}
alsNd.appendChild(aDevelopmentMarkup.developmentmarkupXML);this.setPresentationDataID(aDevelopmentMarkup.developmentmarkupXML.getAttribute('developmentmarkupid'));this.PresentationDataID=aDevelopmentMarkup.DevelopmentMarkupID;},getPresentationDataID:function(){return this.developmentXML.getAttribute('presentationdataid');},setPresentationDataID:function(aDevelopmentMarkupID){this.developmentXML.setAttribute('presentationdataid',aDevelopmentMarkupID);this.PresentationDataID=aDevelopmentMarkupID},getTags:function(){var ret=new Array();for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='tags'){var ourNode=this.developmentXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='realestatetag')
ret.push(new RealestateTag(ourNode.childNodes[j]));break;}
return ret;},setTags:function(realestatetagList){realestatetagList=Utl.toArray(realestatetagList);this.Tags=realestatetagList;var alsNd=null;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='tags'){alsNd=this.developmentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('tags');this.developmentXML.appendChild(alsNd);}
for(i=0;i<realestatetagList.length;i++)
alsNd.appendChild(realestatetagList[i].realestatetagXML);},getMaxPriceRange:function(){return unescape(this.developmentXML.getAttribute('maxpricerange'));},setMaxPriceRange:function(val){this.developmentXML.setAttribute('maxpricerange',escape(val));this.MaxPriceRange=val;},getMinPriceRange:function(){return unescape(this.developmentXML.getAttribute('minpricerange'));},setMinPriceRange:function(val){this.developmentXML.setAttribute('minpricerange',escape(val));this.MinPriceRange=val;},getSummary:function(){return unescape(this.developmentXML.getAttribute('summary'));},setSummary:function(val){this.developmentXML.setAttribute('summary',escape(val));this.Summary=val;},getName:function(){return unescape(this.developmentXML.getAttribute('name'));},setName:function(val){this.developmentXML.setAttribute('name',escape(val));this.Name=val;},getExternalWeblink:function(){return unescape(this.developmentXML.getAttribute('externalweblink'));},setExternalWeblink:function(val){this.developmentXML.setAttribute('externalweblink',escape(val));this.ExternalWeblink=val;},getName_Short:function(){return unescape(this.developmentXML.getAttribute('name_short'));},setName_Short:function(val){this.developmentXML.setAttribute('name_short',escape(val));this.Name_Short=val;},getPriceOverride:function(){return unescape(this.developmentXML.getAttribute('priceoverride'));},setPriceOverride:function(val){this.developmentXML.setAttribute('priceoverride',escape(val));this.PriceOverride=val;},getIsEnabled:function(){return unescape(this.developmentXML.getAttribute('isenabled'));},setIsEnabled:function(val){this.developmentXML.setAttribute('isenabled',escape(val));this.IsEnabled=val;},getDisplayableAttributes:function(){var ret=new Array();for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='displayableattributes'){var ourNode=this.developmentXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='stringkeyvaluepair')
ret.push(new StringKeyValuePair(ourNode.childNodes[j]));break;}
return ret;},setDisplayableAttributes:function(stringkeyvaluepairList){stringkeyvaluepairList=Utl.toArray(stringkeyvaluepairList);this.DisplayableAttributes=stringkeyvaluepairList;var alsNd=null;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='displayableattributes'){alsNd=this.developmentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('displayableattributes');this.developmentXML.appendChild(alsNd);}
for(i=0;i<stringkeyvaluepairList.length;i++)
alsNd.appendChild(stringkeyvaluepairList[i].stringkeyvaluepairXML);},getOwnerAccount:function(){var rslt=null;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='owneraccount'){for(j=0;j<this.developmentXML.childNodes[i].childNodes.length;j++)
if(this.developmentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='account'){rslt=new Account(this.developmentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setOwnerAccount:function(aAccount){var alsNd=null;this.OwnerAccount=aAccount;for(i=0;i<this.developmentXML.childNodes.length;i++)
if(this.developmentXML.childNodes[i].nodeName.toLowerCase()=='owneraccount'){alsNd=this.developmentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('owneraccount');this.developmentXML.appendChild(alsNd);}
alsNd.appendChild(aAccount.accountXML);this.setOwnerAccountID(aAccount.accountXML.getAttribute('accountid'));this.OwnerAccountID=aAccount.AccountID;},getOwnerAccountID:function(){return this.developmentXML.getAttribute('owneraccountid');},setOwnerAccountID:function(aAccountID){this.developmentXML.setAttribute('owneraccountid',aAccountID);this.OwnerAccountID=aAccountID}});var PdfTemplate=Class.create({pdftemplateXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='pdftemplate')
this.pdftemplateXML=inputXML;else{this.pdftemplateXML=document.createElement('pdftemplate');this.id=-1;this.pdftemplateXML.setAttribute('pdftemplateid',-1);}},getID:function(){return this.pdftemplateXML.getAttribute('pdftemplateid');},setID:function(val){this.pdftemplateXML.setAttribute('pdftemplateid',val);this.PdfTemplateID=val;},getPdfProject:function(){var rslt=null;for(i=0;i<this.pdftemplateXML.childNodes.length;i++)
if(this.pdftemplateXML.childNodes[i].nodeName.toLowerCase()=='pdfproject'){for(j=0;j<this.pdftemplateXML.childNodes[i].childNodes.length;j++)
if(this.pdftemplateXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='pdfproject'){rslt=new PdfProject(this.pdftemplateXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setPdfProject:function(aPdfProject){var alsNd=null;this.PdfProject=aPdfProject;for(i=0;i<this.pdftemplateXML.childNodes.length;i++)
if(this.pdftemplateXML.childNodes[i].nodeName.toLowerCase()=='pdfproject'){alsNd=this.pdftemplateXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('pdfproject');this.pdftemplateXML.appendChild(alsNd);}
alsNd.appendChild(aPdfProject.pdfprojectXML);this.setPdfProjectID(aPdfProject.pdfprojectXML.getAttribute('pdfprojectid'));this.PdfProjectID=aPdfProject.PdfProjectID;},getPdfProjectID:function(){return this.pdftemplateXML.getAttribute('pdfprojectid');},setPdfProjectID:function(aPdfProjectID){this.pdftemplateXML.setAttribute('pdfprojectid',aPdfProjectID);this.PdfProjectID=aPdfProjectID},getExternalPDFTemplateID:function(){return unescape(this.pdftemplateXML.getAttribute('externalpdftemplateid'));},setExternalPDFTemplateID:function(val){this.pdftemplateXML.setAttribute('externalpdftemplateid',escape(val));this.ExternalPDFTemplateID=val;},getPath:function(){return unescape(this.pdftemplateXML.getAttribute('path'));},setPath:function(val){this.pdftemplateXML.setAttribute('path',escape(val));this.Path=val;},getName:function(){return unescape(this.pdftemplateXML.getAttribute('name'));},setName:function(val){this.pdftemplateXML.setAttribute('name',escape(val));this.Name=val;}});var PdfProject=Class.create({pdfprojectXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='pdfproject')
this.pdfprojectXML=inputXML;else{this.pdfprojectXML=document.createElement('pdfproject');this.id=-1;this.pdfprojectXML.setAttribute('pdfprojectid',-1);}},getID:function(){return this.pdfprojectXML.getAttribute('pdfprojectid');},setID:function(val){this.pdfprojectXML.setAttribute('pdfprojectid',val);this.PdfProjectID=val;},getName:function(){return unescape(this.pdfprojectXML.getAttribute('name'));},setName:function(val){this.pdfprojectXML.setAttribute('name',escape(val));this.Name=val;}});var FileType=Class.create({filetypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='filetype')
this.filetypeXML=inputXML;else{this.filetypeXML=document.createElement('filetype');this.id=-1;this.filetypeXML.setAttribute('filetypeid',-1);}},getID:function(){return this.filetypeXML.getAttribute('filetypeid');},setID:function(val){this.filetypeXML.setAttribute('filetypeid',val);this.FileTypeID=val;},getMIMEType:function(){return unescape(this.filetypeXML.getAttribute('mimetype'));},setMIMEType:function(val){this.filetypeXML.setAttribute('mimetype',escape(val));this.MIMEType=val;},getFileTypeName:function(){return unescape(this.filetypeXML.getAttribute('filetypename'));},setFileTypeName:function(val){this.filetypeXML.setAttribute('filetypename',escape(val));this.FileTypeName=val;}});var FileType=Class.create({version:0.1,className:'FileType',initialize:function()
{}});var FileTag=Class.create({filetagXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='filetag')
this.filetagXML=inputXML;else{this.filetagXML=document.createElement('filetag');this.id=-1;this.filetagXML.setAttribute('filetagid',-1);}},getID:function(){return this.filetagXML.getAttribute('filetagid');},setID:function(val){this.filetagXML.setAttribute('filetagid',val);this.FileTagID=val;},getTagValue:function(){return unescape(this.filetagXML.getAttribute('tagvalue'));},setTagValue:function(val){this.filetagXML.setAttribute('tagvalue',escape(val));this.TagValue=val;}});var FileTag=Class.create({version:0.1,className:'FileTag',initialize:function()
{}});var FileInformation=Class.create({fileinformationXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='fileinformation')
this.fileinformationXML=inputXML;else{this.fileinformationXML=document.createElement('fileinformation');this.id=-1;this.fileinformationXML.setAttribute('fileinformationid',-1);this.fileinformationXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.fileinformationXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.fileinformationXML.getAttribute('fileinformationid');},setID:function(val){this.fileinformationXML.setAttribute('fileinformationid',val);this.FileInformationID=val;},getCreateAt:function(){return this.fileinformationXML.getAttribute('createdat');},getLastModified:function(){return this.fileinformationXML.getAttribute('lastmodified');},getDescription:function(){return unescape(this.fileinformationXML.getAttribute('description'));},setDescription:function(val){this.fileinformationXML.setAttribute('description',escape(val));this.Description=val;},getLockExpires:function(){return unescape(this.fileinformationXML.getAttribute('lockexpires'));},setLockExpires:function(val){this.fileinformationXML.setAttribute('lockexpires',escape(val));this.LockExpires=val;},getLocked:function(){return unescape(this.fileinformationXML.getAttribute('locked'));},setLocked:function(val){this.fileinformationXML.setAttribute('locked',escape(val));this.Locked=val;},getFileVersion:function(){return unescape(this.fileinformationXML.getAttribute('fileversion'));},setFileVersion:function(val){this.fileinformationXML.setAttribute('fileversion',escape(val));this.FileVersion=val;},getTags:function(){var ret=new Array();for(i=0;i<this.fileinformationXML.childNodes.length;i++)
if(this.fileinformationXML.childNodes[i].nodeName.toLowerCase()=='tags'){var ourNode=this.fileinformationXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='filetag')
ret.push(new FileTag(ourNode.childNodes[j]));break;}
return ret;},setTags:function(filetagList){filetagList=Utl.toArray(filetagList);this.Tags=filetagList;var alsNd=null;for(i=0;i<this.fileinformationXML.childNodes.length;i++)
if(this.fileinformationXML.childNodes[i].nodeName.toLowerCase()=='tags'){alsNd=this.fileinformationXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('tags');this.fileinformationXML.appendChild(alsNd);}
for(i=0;i<filetagList.length;i++)
alsNd.appendChild(filetagList[i].filetagXML);},getContentType:function(){var rslt=null;for(i=0;i<this.fileinformationXML.childNodes.length;i++)
if(this.fileinformationXML.childNodes[i].nodeName.toLowerCase()=='contenttype'){for(j=0;j<this.fileinformationXML.childNodes[i].childNodes.length;j++)
if(this.fileinformationXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='filetype'){rslt=new FileType(this.fileinformationXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setContentType:function(aFileType){var alsNd=null;this.ContentType=aFileType;for(i=0;i<this.fileinformationXML.childNodes.length;i++)
if(this.fileinformationXML.childNodes[i].nodeName.toLowerCase()=='contenttype'){alsNd=this.fileinformationXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('contenttype');this.fileinformationXML.appendChild(alsNd);}
alsNd.appendChild(aFileType.filetypeXML);this.setContentTypeID(aFileType.filetypeXML.getAttribute('filetypeid'));this.ContentTypeID=aFileType.FileTypeID;},getContentTypeID:function(){return this.fileinformationXML.getAttribute('contenttypeid');},setContentTypeID:function(aFileTypeID){this.fileinformationXML.setAttribute('contenttypeid',aFileTypeID);this.ContentTypeID=aFileTypeID},getFolderPath:function(){return unescape(this.fileinformationXML.getAttribute('folderpath'));},setFolderPath:function(val){this.fileinformationXML.setAttribute('folderpath',escape(val));this.FolderPath=val;},getFileName:function(){return unescape(this.fileinformationXML.getAttribute('filename'));},setFileName:function(val){this.fileinformationXML.setAttribute('filename',escape(val));this.FileName=val;}});if(!window.FileInformation)
{window.FileInformation=Class.create();}
FileInformation.addMethods({initialize:function()
{}});var FileContents=Class.create({filecontentsXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='filecontents')
this.filecontentsXML=inputXML;else{this.filecontentsXML=document.createElement('filecontents');this.id=-1;this.filecontentsXML.setAttribute('filecontentsid',-1);this.filecontentsXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.filecontentsXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.filecontentsXML.getAttribute('filecontentsid');},setID:function(val){this.filecontentsXML.setAttribute('filecontentsid',val);this.FileContentsID=val;},getCreateAt:function(){return this.filecontentsXML.getAttribute('createdat');},getLastModified:function(){return this.filecontentsXML.getAttribute('lastmodified');},getFileInfo:function(){var rslt=null;for(i=0;i<this.filecontentsXML.childNodes.length;i++)
if(this.filecontentsXML.childNodes[i].nodeName.toLowerCase()=='fileinfo'){for(j=0;j<this.filecontentsXML.childNodes[i].childNodes.length;j++)
if(this.filecontentsXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='fileinformation'){rslt=new FileInformation(this.filecontentsXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setFileInfo:function(aFileInformation){var alsNd=null;this.FileInfo=aFileInformation;for(i=0;i<this.filecontentsXML.childNodes.length;i++)
if(this.filecontentsXML.childNodes[i].nodeName.toLowerCase()=='fileinfo'){alsNd=this.filecontentsXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('fileinfo');this.filecontentsXML.appendChild(alsNd);}
alsNd.appendChild(aFileInformation.fileinformationXML);this.setFileInfoID(aFileInformation.fileinformationXML.getAttribute('fileinformationid'));this.FileInfoID=aFileInformation.FileInformationID;},getFileInfoID:function(){return this.filecontentsXML.getAttribute('fileinfoid');},setFileInfoID:function(aFileInformationID){this.filecontentsXML.setAttribute('fileinfoid',aFileInformationID);this.FileInfoID=aFileInformationID},getFileData:function(){return unescape(this.filecontentsXML.getAttribute('filedata'));},setFileData:function(val){this.filecontentsXML.setAttribute('filedata',escape(val));this.FileData=val;}});var FileContents=Class.create({version:0.1,className:'FileContents',initialize:function()
{}});var FaxTransactionType=Class.create({faxtransactiontypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='faxtransactiontype')
this.faxtransactiontypeXML=inputXML;else{this.faxtransactiontypeXML=document.createElement('faxtransactiontype');}},getValue:function(){return unescape(this.faxtransactiontypeXML.getAttribute('value'));},setValue:function(val){this.faxtransactiontypeXML.setAttribute('value',escape(val));this.Value=val;}});var FaxStatusCode=Class.create({faxstatuscodeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='faxstatuscode')
this.faxstatuscodeXML=inputXML;else{this.faxstatuscodeXML=document.createElement('faxstatuscode');this.id=-1;this.faxstatuscodeXML.setAttribute('faxstatuscodeid',-1);}},getID:function(){return this.faxstatuscodeXML.getAttribute('faxstatuscodeid');},setID:function(val){this.faxstatuscodeXML.setAttribute('faxstatuscodeid',val);this.FaxStatusCodeID=val;},getExternalRefID:function(){return unescape(this.faxstatuscodeXML.getAttribute('externalrefid'));},setExternalRefID:function(val){this.faxstatuscodeXML.setAttribute('externalrefid',escape(val));this.ExternalRefID=val;},getLongLabel:function(){return unescape(this.faxstatuscodeXML.getAttribute('longlabel'));},setLongLabel:function(val){this.faxstatuscodeXML.setAttribute('longlabel',escape(val));this.LongLabel=val;},getShortLabel:function(){return unescape(this.faxstatuscodeXML.getAttribute('shortlabel'));},setShortLabel:function(val){this.faxstatuscodeXML.setAttribute('shortlabel',escape(val));this.ShortLabel=val;}});var FaxSent=Class.create({faxsentXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='faxsent')
this.faxsentXML=inputXML;else{this.faxsentXML=document.createElement('faxsent');this.id=-1;this.faxsentXML.setAttribute('faxsentid',-1);this.faxsentXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.faxsentXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.faxsentXML.getAttribute('faxsentid');},setID:function(val){this.faxsentXML.setAttribute('faxsentid',val);this.FaxSentID=val;},getCreateAt:function(){return this.faxsentXML.getAttribute('createdat');},getLastModified:function(){return this.faxsentXML.getAttribute('lastmodified');},getCost:function(){return unescape(this.faxsentXML.getAttribute('cost'));},setCost:function(val){this.faxsentXML.setAttribute('cost',escape(val));this.Cost=val;},getRetries:function(){return unescape(this.faxsentXML.getAttribute('retries'));},setRetries:function(val){this.faxsentXML.setAttribute('retries',escape(val));this.Retries=val;},getFileSize:function(){return unescape(this.faxsentXML.getAttribute('filesize'));},setFileSize:function(val){this.faxsentXML.setAttribute('filesize',escape(val));this.FileSize=val;},getDuration:function(){return unescape(this.faxsentXML.getAttribute('duration'));},setDuration:function(val){this.faxsentXML.setAttribute('duration',escape(val));this.Duration=val;},getDestinationCountryCode:function(){return unescape(this.faxsentXML.getAttribute('destinationcountrycode'));},setDestinationCountryCode:function(val){this.faxsentXML.setAttribute('destinationcountrycode',escape(val));this.DestinationCountryCode=val;},getDestinationNumber:function(){return unescape(this.faxsentXML.getAttribute('destinationnumber'));},setDestinationNumber:function(val){this.faxsentXML.setAttribute('destinationnumber',escape(val));this.DestinationNumber=val;},getToText:function(){return unescape(this.faxsentXML.getAttribute('totext'));},setToText:function(val){this.faxsentXML.setAttribute('totext',escape(val));this.ToText=val;},getNumberOfPages:function(){return unescape(this.faxsentXML.getAttribute('numberofpages'));},setNumberOfPages:function(val){this.faxsentXML.setAttribute('numberofpages',escape(val));this.NumberOfPages=val;},getDeliveredTimeStamp:function(){return unescape(this.faxsentXML.getAttribute('deliveredtimestamp'));},setDeliveredTimeStamp:function(val){this.faxsentXML.setAttribute('deliveredtimestamp',escape(val));this.DeliveredTimeStamp=val;},getReceivedTimeStamp:function(){return unescape(this.faxsentXML.getAttribute('receivedtimestamp'));},setReceivedTimeStamp:function(val){this.faxsentXML.setAttribute('receivedtimestamp',escape(val));this.ReceivedTimeStamp=val;},getReferenceID:function(){return unescape(this.faxsentXML.getAttribute('referenceid'));},setReferenceID:function(val){this.faxsentXML.setAttribute('referenceid',escape(val));this.ReferenceID=val;},getFaxErrorCode:function(){var rslt=null;for(i=0;i<this.faxsentXML.childNodes.length;i++)
if(this.faxsentXML.childNodes[i].nodeName.toLowerCase()=='faxerrorcode'){for(j=0;j<this.faxsentXML.childNodes[i].childNodes.length;j++)
if(this.faxsentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='faxerrorcode'){rslt=new FaxErrorCode(this.faxsentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setFaxErrorCode:function(aFaxErrorCode){var alsNd=null;this.FaxErrorCode=aFaxErrorCode;for(i=0;i<this.faxsentXML.childNodes.length;i++)
if(this.faxsentXML.childNodes[i].nodeName.toLowerCase()=='faxerrorcode'){alsNd=this.faxsentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('faxerrorcode');this.faxsentXML.appendChild(alsNd);}
alsNd.appendChild(aFaxErrorCode.faxerrorcodeXML);this.setFaxErrorCodeID(aFaxErrorCode.faxerrorcodeXML.getAttribute('faxerrorcodeid'));this.FaxErrorCodeID=aFaxErrorCode.FaxErrorCodeID;},getFaxErrorCodeID:function(){return this.faxsentXML.getAttribute('faxerrorcodeid');},setFaxErrorCodeID:function(aFaxErrorCodeID){this.faxsentXML.setAttribute('faxerrorcodeid',aFaxErrorCodeID);this.FaxErrorCodeID=aFaxErrorCodeID},getFaxStatusCode:function(){var rslt=null;for(i=0;i<this.faxsentXML.childNodes.length;i++)
if(this.faxsentXML.childNodes[i].nodeName.toLowerCase()=='faxstatuscode'){for(j=0;j<this.faxsentXML.childNodes[i].childNodes.length;j++)
if(this.faxsentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='faxstatuscode'){rslt=new FaxStatusCode(this.faxsentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setFaxStatusCode:function(aFaxStatusCode){var alsNd=null;this.FaxStatusCode=aFaxStatusCode;for(i=0;i<this.faxsentXML.childNodes.length;i++)
if(this.faxsentXML.childNodes[i].nodeName.toLowerCase()=='faxstatuscode'){alsNd=this.faxsentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('faxstatuscode');this.faxsentXML.appendChild(alsNd);}
alsNd.appendChild(aFaxStatusCode.faxstatuscodeXML);this.setFaxStatusCodeID(aFaxStatusCode.faxstatuscodeXML.getAttribute('faxstatuscodeid'));this.FaxStatusCodeID=aFaxStatusCode.FaxStatusCodeID;},getFaxStatusCodeID:function(){return this.faxsentXML.getAttribute('faxstatuscodeid');},setFaxStatusCodeID:function(aFaxStatusCodeID){this.faxsentXML.setAttribute('faxstatuscodeid',aFaxStatusCodeID);this.FaxStatusCodeID=aFaxStatusCodeID},getSubTransactionID:function(){return unescape(this.faxsentXML.getAttribute('subtransactionid'));},setSubTransactionID:function(val){this.faxsentXML.setAttribute('subtransactionid',escape(val));this.SubTransactionID=val;},getTransactionType:function(){return unescape(this.faxsentXML.getAttribute('transactiontype'));},setTransactionType:function(val){this.faxsentXML.setAttribute('transactiontype',escape(val));this.TransactionType=val;},getFax:function(){var rslt=null;for(i=0;i<this.faxsentXML.childNodes.length;i++)
if(this.faxsentXML.childNodes[i].nodeName.toLowerCase()=='fax'){for(j=0;j<this.faxsentXML.childNodes[i].childNodes.length;j++)
if(this.faxsentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='fax'){rslt=new Fax(this.faxsentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setFax:function(aFax){var alsNd=null;this.Fax=aFax;for(i=0;i<this.faxsentXML.childNodes.length;i++)
if(this.faxsentXML.childNodes[i].nodeName.toLowerCase()=='fax'){alsNd=this.faxsentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('fax');this.faxsentXML.appendChild(alsNd);}
alsNd.appendChild(aFax.faxXML);this.setFaxID(aFax.faxXML.getAttribute('faxid'));this.FaxID=aFax.FaxID;},getFaxID:function(){return this.faxsentXML.getAttribute('faxid');},setFaxID:function(aFaxID){this.faxsentXML.setAttribute('faxid',aFaxID);this.FaxID=aFaxID}});var FaxReceived=Class.create({faxreceivedXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='faxreceived')
this.faxreceivedXML=inputXML;else{this.faxreceivedXML=document.createElement('faxreceived');this.id=-1;this.faxreceivedXML.setAttribute('faxreceivedid',-1);this.faxreceivedXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.faxreceivedXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.faxreceivedXML.getAttribute('faxreceivedid');},setID:function(val){this.faxreceivedXML.setAttribute('faxreceivedid',val);this.FaxReceivedID=val;},getCreateAt:function(){return this.faxreceivedXML.getAttribute('createdat');},getLastModified:function(){return this.faxreceivedXML.getAttribute('lastmodified');},getDuration:function(){return unescape(this.faxreceivedXML.getAttribute('duration'));},setDuration:function(val){this.faxreceivedXML.setAttribute('duration',escape(val));this.Duration=val;},getNumberOfPages:function(){return unescape(this.faxreceivedXML.getAttribute('numberofpages'));},setNumberOfPages:function(val){this.faxreceivedXML.setAttribute('numberofpages',escape(val));this.NumberOfPages=val;},getOriginatingFaxNumber:function(){return unescape(this.faxreceivedXML.getAttribute('originatingfaxnumber'));},setOriginatingFaxNumber:function(val){this.faxreceivedXML.setAttribute('originatingfaxnumber',escape(val));this.OriginatingFaxNumber=val;},getDateFaxReceived:function(){return unescape(this.faxreceivedXML.getAttribute('datefaxreceived'));},setDateFaxReceived:function(val){this.faxreceivedXML.setAttribute('datefaxreceived',escape(val));this.DateFaxReceived=val;},getFax:function(){var rslt=null;for(i=0;i<this.faxreceivedXML.childNodes.length;i++)
if(this.faxreceivedXML.childNodes[i].nodeName.toLowerCase()=='fax'){for(j=0;j<this.faxreceivedXML.childNodes[i].childNodes.length;j++)
if(this.faxreceivedXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='fax'){rslt=new Fax(this.faxreceivedXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setFax:function(aFax){var alsNd=null;this.Fax=aFax;for(i=0;i<this.faxreceivedXML.childNodes.length;i++)
if(this.faxreceivedXML.childNodes[i].nodeName.toLowerCase()=='fax'){alsNd=this.faxreceivedXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('fax');this.faxreceivedXML.appendChild(alsNd);}
alsNd.appendChild(aFax.faxXML);this.setFaxID(aFax.faxXML.getAttribute('faxid'));this.FaxID=aFax.FaxID;},getFaxID:function(){return this.faxreceivedXML.getAttribute('faxid');},setFaxID:function(aFaxID){this.faxreceivedXML.setAttribute('faxid',aFaxID);this.FaxID=aFaxID}});var FaxErrorCode=Class.create({faxerrorcodeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='faxerrorcode')
this.faxerrorcodeXML=inputXML;else{this.faxerrorcodeXML=document.createElement('faxerrorcode');this.id=-1;this.faxerrorcodeXML.setAttribute('faxerrorcodeid',-1);}},getID:function(){return this.faxerrorcodeXML.getAttribute('faxerrorcodeid');},setID:function(val){this.faxerrorcodeXML.setAttribute('faxerrorcodeid',val);this.FaxErrorCodeID=val;},getExternalRefID:function(){return unescape(this.faxerrorcodeXML.getAttribute('externalrefid'));},setExternalRefID:function(val){this.faxerrorcodeXML.setAttribute('externalrefid',escape(val));this.ExternalRefID=val;},getPossibleResolution:function(){return unescape(this.faxerrorcodeXML.getAttribute('possibleresolution'));},setPossibleResolution:function(val){this.faxerrorcodeXML.setAttribute('possibleresolution',escape(val));this.PossibleResolution=val;},getLongLabel:function(){return unescape(this.faxerrorcodeXML.getAttribute('longlabel'));},setLongLabel:function(val){this.faxerrorcodeXML.setAttribute('longlabel',escape(val));this.LongLabel=val;},getShortLabel:function(){return unescape(this.faxerrorcodeXML.getAttribute('shortlabel'));},setShortLabel:function(val){this.faxerrorcodeXML.setAttribute('shortlabel',escape(val));this.ShortLabel=val;}});var FaxAccount=Class.create({faxaccountXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='faxaccount')
this.faxaccountXML=inputXML;else{this.faxaccountXML=document.createElement('faxaccount');this.id=-1;this.faxaccountXML.setAttribute('faxaccountid',-1);}},getID:function(){return this.faxaccountXML.getAttribute('faxaccountid');},setID:function(val){this.faxaccountXML.setAttribute('faxaccountid',val);this.FaxAccountID=val;},getFaxNumber:function(){return unescape(this.faxaccountXML.getAttribute('faxnumber'));},setFaxNumber:function(val){this.faxaccountXML.setAttribute('faxnumber',escape(val));this.FaxNumber=val;},getEmail:function(){return unescape(this.faxaccountXML.getAttribute('email'));},setEmail:function(val){this.faxaccountXML.setAttribute('email',escape(val));this.Email=val;},getPassword:function(){return unescape(this.faxaccountXML.getAttribute('password'));},setPassword:function(val){this.faxaccountXML.setAttribute('password',escape(val));this.Password=val;},getExternalRefID:function(){return unescape(this.faxaccountXML.getAttribute('externalrefid'));},setExternalRefID:function(val){this.faxaccountXML.setAttribute('externalrefid',escape(val));this.ExternalRefID=val;}});var Fax=Class.create({faxXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='fax')
this.faxXML=inputXML;else{this.faxXML=document.createElement('fax');this.id=-1;this.faxXML.setAttribute('faxid',-1);this.faxXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.faxXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.faxXML.getAttribute('faxid');},setID:function(val){this.faxXML.setAttribute('faxid',val);this.FaxID=val;},getCreateAt:function(){return this.faxXML.getAttribute('createdat');},getLastModified:function(){return this.faxXML.getAttribute('lastmodified');},getFaxTransactionType:function(){var rslt=null;for(i=0;i<this.faxXML.childNodes.length;i++)
if(this.faxXML.childNodes[i].nodeName.toLowerCase()=='faxtransactiontype'){for(j=0;j<this.faxXML.childNodes[i].childNodes.length;j++)
if(this.faxXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='faxtransactiontype'){rslt=new FaxTransactionType(this.faxXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setFaxTransactionType:function(aFaxTransactionType){var alsNd=null;this.FaxTransactionType=aFaxTransactionType;for(i=0;i<this.faxXML.childNodes.length;i++)
if(this.faxXML.childNodes[i].nodeName.toLowerCase()=='faxtransactiontype'){alsNd=this.faxXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('faxtransactiontype');this.faxXML.appendChild(alsNd);}
alsNd.appendChild(aFaxTransactionType.faxtransactiontypeXML);},getTransactionID:function(){return unescape(this.faxXML.getAttribute('transactionid'));},setTransactionID:function(val){this.faxXML.setAttribute('transactionid',escape(val));this.TransactionID=val;},getFaxAccount:function(){var rslt=null;for(i=0;i<this.faxXML.childNodes.length;i++)
if(this.faxXML.childNodes[i].nodeName.toLowerCase()=='faxaccount'){for(j=0;j<this.faxXML.childNodes[i].childNodes.length;j++)
if(this.faxXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='faxaccount'){rslt=new FaxAccount(this.faxXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setFaxAccount:function(aFaxAccount){var alsNd=null;this.FaxAccount=aFaxAccount;for(i=0;i<this.faxXML.childNodes.length;i++)
if(this.faxXML.childNodes[i].nodeName.toLowerCase()=='faxaccount'){alsNd=this.faxXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('faxaccount');this.faxXML.appendChild(alsNd);}
alsNd.appendChild(aFaxAccount.faxaccountXML);this.setFaxAccountID(aFaxAccount.faxaccountXML.getAttribute('faxaccountid'));this.FaxAccountID=aFaxAccount.FaxAccountID;},getFaxAccountID:function(){return this.faxXML.getAttribute('faxaccountid');},setFaxAccountID:function(aFaxAccountID){this.faxXML.setAttribute('faxaccountid',aFaxAccountID);this.FaxAccountID=aFaxAccountID}});var BlogThread=Class.create({blogthreadXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='blogthread')
this.blogthreadXML=inputXML;else{this.blogthreadXML=document.createElement('blogthread');this.id=-1;this.blogthreadXML.setAttribute('blogthreadid',-1);this.blogthreadXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.blogthreadXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.blogthreadXML.getAttribute('blogthreadid');},setID:function(val){this.blogthreadXML.setAttribute('blogthreadid',val);this.BlogThreadID=val;},getCreateAt:function(){return this.blogthreadXML.getAttribute('createdat');},getLastModified:function(){return this.blogthreadXML.getAttribute('lastmodified');},getOwnerAccount:function(){var rslt=null;for(i=0;i<this.blogthreadXML.childNodes.length;i++)
if(this.blogthreadXML.childNodes[i].nodeName.toLowerCase()=='owneraccount'){for(j=0;j<this.blogthreadXML.childNodes[i].childNodes.length;j++)
if(this.blogthreadXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='account'){rslt=new Account(this.blogthreadXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setOwnerAccount:function(aAccount){var alsNd=null;this.OwnerAccount=aAccount;for(i=0;i<this.blogthreadXML.childNodes.length;i++)
if(this.blogthreadXML.childNodes[i].nodeName.toLowerCase()=='owneraccount'){alsNd=this.blogthreadXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('owneraccount');this.blogthreadXML.appendChild(alsNd);}
alsNd.appendChild(aAccount.accountXML);this.setOwnerAccountID(aAccount.accountXML.getAttribute('accountid'));this.OwnerAccountID=aAccount.AccountID;},getOwnerAccountID:function(){return this.blogthreadXML.getAttribute('owneraccountid');},setOwnerAccountID:function(aAccountID){this.blogthreadXML.setAttribute('owneraccountid',aAccountID);this.OwnerAccountID=aAccountID},getTitle:function(){return unescape(this.blogthreadXML.getAttribute('title'));},setTitle:function(val){this.blogthreadXML.setAttribute('title',escape(val));this.Title=val;}});var BlogRating=Class.create({blogratingXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='blograting')
this.blogratingXML=inputXML;else{this.blogratingXML=document.createElement('blograting');this.id=-1;this.blogratingXML.setAttribute('blogratingid',-1);this.blogratingXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.blogratingXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.blogratingXML.getAttribute('blogratingid');},setID:function(val){this.blogratingXML.setAttribute('blogratingid',val);this.BlogRatingID=val;},getCreateAt:function(){return this.blogratingXML.getAttribute('createdat');},getLastModified:function(){return this.blogratingXML.getAttribute('lastmodified');},getValue:function(){return unescape(this.blogratingXML.getAttribute('value'));},setValue:function(val){this.blogratingXML.setAttribute('value',escape(val));this.Value=val;},getLogin:function(){var rslt=null;for(i=0;i<this.blogratingXML.childNodes.length;i++)
if(this.blogratingXML.childNodes[i].nodeName.toLowerCase()=='login'){for(j=0;j<this.blogratingXML.childNodes[i].childNodes.length;j++)
if(this.blogratingXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='login'){rslt=new Login(this.blogratingXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLogin:function(aLogin){var alsNd=null;this.Login=aLogin;for(i=0;i<this.blogratingXML.childNodes.length;i++)
if(this.blogratingXML.childNodes[i].nodeName.toLowerCase()=='login'){alsNd=this.blogratingXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('login');this.blogratingXML.appendChild(alsNd);}
alsNd.appendChild(aLogin.loginXML);this.setLoginID(aLogin.loginXML.getAttribute('loginid'));this.LoginID=aLogin.LoginID;},getLoginID:function(){return this.blogratingXML.getAttribute('loginid');},setLoginID:function(aLoginID){this.blogratingXML.setAttribute('loginid',aLoginID);this.LoginID=aLoginID}});var BlogComment=Class.create({blogcommentXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='blogcomment')
this.blogcommentXML=inputXML;else{this.blogcommentXML=document.createElement('blogcomment');this.id=-1;this.blogcommentXML.setAttribute('blogcommentid',-1);this.blogcommentXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.blogcommentXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.blogcommentXML.getAttribute('blogcommentid');},setID:function(val){this.blogcommentXML.setAttribute('blogcommentid',val);this.BlogCommentID=val;},getCreateAt:function(){return this.blogcommentXML.getAttribute('createdat');},getLastModified:function(){return this.blogcommentXML.getAttribute('lastmodified');},getRating:function(){var ret=new Array();for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='rating'){var ourNode=this.blogcommentXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='blograting')
ret.push(new BlogRating(ourNode.childNodes[j]));break;}
return ret;},setRating:function(blogratingList){blogratingList=Utl.toArray(blogratingList);this.Rating=blogratingList;var alsNd=null;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='rating'){alsNd=this.blogcommentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('rating');this.blogcommentXML.appendChild(alsNd);}
for(i=0;i<blogratingList.length;i++)
alsNd.appendChild(blogratingList[i].blogratingXML);},getBody:function(){return unescape(this.blogcommentXML.getAttribute('body'));},setBody:function(val){this.blogcommentXML.setAttribute('body',escape(val));this.Body=val;},getTitle:function(){return unescape(this.blogcommentXML.getAttribute('title'));},setTitle:function(val){this.blogcommentXML.setAttribute('title',escape(val));this.Title=val;},getIsApproved:function(){return unescape(this.blogcommentXML.getAttribute('isapproved'));},setIsApproved:function(val){this.blogcommentXML.setAttribute('isapproved',escape(val));this.IsApproved=val;},getIsEnabled:function(){return unescape(this.blogcommentXML.getAttribute('isenabled'));},setIsEnabled:function(val){this.blogcommentXML.setAttribute('isenabled',escape(val));this.IsEnabled=val;},getParentCommentID:function(){return unescape(this.blogcommentXML.getAttribute('parentcommentid'));},setParentCommentID:function(val){this.blogcommentXML.setAttribute('parentcommentid',escape(val));this.ParentCommentID=val;},getLastEditedByLogin:function(){var rslt=null;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='lasteditedbylogin'){for(j=0;j<this.blogcommentXML.childNodes[i].childNodes.length;j++)
if(this.blogcommentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='login'){rslt=new Login(this.blogcommentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLastEditedByLogin:function(aLogin){var alsNd=null;this.LastEditedByLogin=aLogin;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='lasteditedbylogin'){alsNd=this.blogcommentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('lasteditedbylogin');this.blogcommentXML.appendChild(alsNd);}
alsNd.appendChild(aLogin.loginXML);this.setLastEditedByLoginID(aLogin.loginXML.getAttribute('loginid'));this.LastEditedByLoginID=aLogin.LoginID;},getLastEditedByLoginID:function(){return this.blogcommentXML.getAttribute('lasteditedbyloginid');},setLastEditedByLoginID:function(aLoginID){this.blogcommentXML.setAttribute('lasteditedbyloginid',aLoginID);this.LastEditedByLoginID=aLoginID},getLastEditedByPerson:function(){var rslt=null;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='lasteditedbyperson'){for(j=0;j<this.blogcommentXML.childNodes[i].childNodes.length;j++)
if(this.blogcommentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='person'){rslt=new Person(this.blogcommentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLastEditedByPerson:function(aPerson){var alsNd=null;this.LastEditedByPerson=aPerson;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='lasteditedbyperson'){alsNd=this.blogcommentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('lasteditedbyperson');this.blogcommentXML.appendChild(alsNd);}
alsNd.appendChild(aPerson.personXML);this.setLastEditedByPersonID(aPerson.personXML.getAttribute('personid'));this.LastEditedByPersonID=aPerson.PersonID;},getLastEditedByPersonID:function(){return this.blogcommentXML.getAttribute('lasteditedbypersonid');},setLastEditedByPersonID:function(aPersonID){this.blogcommentXML.setAttribute('lasteditedbypersonid',aPersonID);this.LastEditedByPersonID=aPersonID},getIPAddress:function(){return unescape(this.blogcommentXML.getAttribute('ipaddress'));},setIPAddress:function(val){this.blogcommentXML.setAttribute('ipaddress',escape(val));this.IPAddress=val;},getPosterLogin:function(){var rslt=null;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='posterlogin'){for(j=0;j<this.blogcommentXML.childNodes[i].childNodes.length;j++)
if(this.blogcommentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='login'){rslt=new Login(this.blogcommentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setPosterLogin:function(aLogin){var alsNd=null;this.PosterLogin=aLogin;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='posterlogin'){alsNd=this.blogcommentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('posterlogin');this.blogcommentXML.appendChild(alsNd);}
alsNd.appendChild(aLogin.loginXML);this.setPosterLoginID(aLogin.loginXML.getAttribute('loginid'));this.PosterLoginID=aLogin.LoginID;},getPosterLoginID:function(){return this.blogcommentXML.getAttribute('posterloginid');},setPosterLoginID:function(aLoginID){this.blogcommentXML.setAttribute('posterloginid',aLoginID);this.PosterLoginID=aLoginID},getPosterPerson:function(){var rslt=null;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='posterperson'){for(j=0;j<this.blogcommentXML.childNodes[i].childNodes.length;j++)
if(this.blogcommentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='person'){rslt=new Person(this.blogcommentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setPosterPerson:function(aPerson){var alsNd=null;this.PosterPerson=aPerson;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='posterperson'){alsNd=this.blogcommentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('posterperson');this.blogcommentXML.appendChild(alsNd);}
alsNd.appendChild(aPerson.personXML);this.setPosterPersonID(aPerson.personXML.getAttribute('personid'));this.PosterPersonID=aPerson.PersonID;},getPosterPersonID:function(){return this.blogcommentXML.getAttribute('posterpersonid');},setPosterPersonID:function(aPersonID){this.blogcommentXML.setAttribute('posterpersonid',aPersonID);this.PosterPersonID=aPersonID},getThread:function(){var rslt=null;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='thread'){for(j=0;j<this.blogcommentXML.childNodes[i].childNodes.length;j++)
if(this.blogcommentXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='blogthread'){rslt=new BlogThread(this.blogcommentXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setThread:function(aBlogThread){var alsNd=null;this.Thread=aBlogThread;for(i=0;i<this.blogcommentXML.childNodes.length;i++)
if(this.blogcommentXML.childNodes[i].nodeName.toLowerCase()=='thread'){alsNd=this.blogcommentXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('thread');this.blogcommentXML.appendChild(alsNd);}
alsNd.appendChild(aBlogThread.blogthreadXML);this.setThreadID(aBlogThread.blogthreadXML.getAttribute('blogthreadid'));this.ThreadID=aBlogThread.BlogThreadID;},getThreadID:function(){return this.blogcommentXML.getAttribute('threadid');},setThreadID:function(aBlogThreadID){this.blogcommentXML.setAttribute('threadid',aBlogThreadID);this.ThreadID=aBlogThreadID}});BlogComment.addMethods({getBodyHTML:function()
{return this.Body.replace(/\n/g,"<BR />");},getPosterName:function()
{if(this.PosterPerson)
return this.PosterPerson.FirstName+" "+this.PosterPerson.LastName;else
return"anonymous";},getLastEditedByName:function()
{if(this.LastEditedByPerson)
return this.LastEditedByPerson.FirstName+" "+this.LastEditedByPerson.LastName;else
return"anonymous";},getFormattedLastModified:function()
{return this.LastModified.toShortDateTimeString();},getFormattedCreatedAt:function()
{return this.LastModified.toShortDateTimeString();},getTotalRating:function()
{var total=0;for(var i=0;i<this.Rating.length;i++)
total+=this.Rating[i].Value;return total;},getFormattedTotalRating:function()
{var total=this.getTotalRating();return(total>=0)?"+"+total:total;}});BlogComment.prototype.version=0.1;BlogComment.prototype.className='BlogComment';var StringKeyValuePair=Class.create({stringkeyvaluepairXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='stringkeyvaluepair')
this.stringkeyvaluepairXML=inputXML;else{this.stringkeyvaluepairXML=document.createElement('stringkeyvaluepair');this.id=-1;this.stringkeyvaluepairXML.setAttribute('stringkeyvaluepairid',-1);}},getID:function(){return this.stringkeyvaluepairXML.getAttribute('stringkeyvaluepairid');},setID:function(val){this.stringkeyvaluepairXML.setAttribute('stringkeyvaluepairid',val);this.StringKeyValuePairID=val;},getPairValue:function(){return unescape(this.stringkeyvaluepairXML.getAttribute('pairvalue'));},setPairValue:function(val){this.stringkeyvaluepairXML.setAttribute('pairvalue',escape(val));this.PairValue=val;},getPairKey:function(){return unescape(this.stringkeyvaluepairXML.getAttribute('pairkey'));},setPairKey:function(val){this.stringkeyvaluepairXML.setAttribute('pairkey',escape(val));this.PairKey=val;}});var IntKeyValuePair=Class.create({intkeyvaluepairXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='intkeyvaluepair')
this.intkeyvaluepairXML=inputXML;else{this.intkeyvaluepairXML=document.createElement('intkeyvaluepair');this.id=-1;this.intkeyvaluepairXML.setAttribute('intkeyvaluepairid',-1);}},getID:function(){return this.intkeyvaluepairXML.getAttribute('intkeyvaluepairid');},setID:function(val){this.intkeyvaluepairXML.setAttribute('intkeyvaluepairid',val);this.IntKeyValuePairID=val;},getPairValue:function(){return unescape(this.intkeyvaluepairXML.getAttribute('pairvalue'));},setPairValue:function(val){this.intkeyvaluepairXML.setAttribute('pairvalue',escape(val));this.PairValue=val;},getPairKey:function(){return unescape(this.intkeyvaluepairXML.getAttribute('pairkey'));},setPairKey:function(val){this.intkeyvaluepairXML.setAttribute('pairkey',escape(val));this.PairKey=val;}});var ImageReference=Class.create({imagereferenceXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='imagereference')
this.imagereferenceXML=inputXML;else{this.imagereferenceXML=document.createElement('imagereference');this.id=-1;this.imagereferenceXML.setAttribute('imagereferenceid',-1);}},getID:function(){return this.imagereferenceXML.getAttribute('imagereferenceid');},setID:function(val){this.imagereferenceXML.setAttribute('imagereferenceid',val);this.ImageReferenceID=val;},getTooltip:function(){return unescape(this.imagereferenceXML.getAttribute('tooltip'));},setTooltip:function(val){this.imagereferenceXML.setAttribute('tooltip',escape(val));this.Tooltip=val;},getImagePath:function(){return unescape(this.imagereferenceXML.getAttribute('imagepath'));},setImagePath:function(val){this.imagereferenceXML.setAttribute('imagepath',escape(val));this.ImagePath=val;}});var GeneralMarkup=Class.create({generalmarkupXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='generalmarkup')
this.generalmarkupXML=inputXML;else{this.generalmarkupXML=document.createElement('generalmarkup');this.id=-1;this.generalmarkupXML.setAttribute('generalmarkupid',-1);}},getID:function(){return this.generalmarkupXML.getAttribute('generalmarkupid');},setID:function(val){this.generalmarkupXML.setAttribute('generalmarkupid',val);this.GeneralMarkupID=val;},getValue:function(){return unescape(this.generalmarkupXML.getAttribute('value'));},setValue:function(val){this.generalmarkupXML.setAttribute('value',escape(val));this.Value=val;}});var Color=Class.create({colorXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='color')
this.colorXML=inputXML;else{this.colorXML=document.createElement('color');this.id=-1;this.colorXML.setAttribute('colorid',-1);}},getID:function(){return this.colorXML.getAttribute('colorid');},setID:function(val){this.colorXML.setAttribute('colorid',val);this.ColorID=val;},getBlue:function(){return unescape(this.colorXML.getAttribute('blue'));},setBlue:function(val){this.colorXML.setAttribute('blue',escape(val));this.Blue=val;},getGreen:function(){return unescape(this.colorXML.getAttribute('green'));},setGreen:function(val){this.colorXML.setAttribute('green',escape(val));this.Green=val;},getRed:function(){return unescape(this.colorXML.getAttribute('red'));},setRed:function(val){this.colorXML.setAttribute('red',escape(val));this.Red=val;}});var CacheItem=Class.create({cacheitemXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='cacheitem')
this.cacheitemXML=inputXML;else{this.cacheitemXML=document.createElement('cacheitem');this.id=-1;this.cacheitemXML.setAttribute('cacheitemid',-1);this.cacheitemXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.cacheitemXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.cacheitemXML.getAttribute('cacheitemid');},setID:function(val){this.cacheitemXML.setAttribute('cacheitemid',val);this.CacheItemID=val;},getCreateAt:function(){return this.cacheitemXML.getAttribute('createdat');},getLastModified:function(){return this.cacheitemXML.getAttribute('lastmodified');},getPortalKey:function(){return unescape(this.cacheitemXML.getAttribute('portalkey'));},setPortalKey:function(val){this.cacheitemXML.setAttribute('portalkey',escape(val));this.PortalKey=val;},getVersion:function(){return unescape(this.cacheitemXML.getAttribute('version'));},setVersion:function(val){this.cacheitemXML.setAttribute('version',escape(val));this.Version=val;},getContentBytes:function(){return unescape(this.cacheitemXML.getAttribute('contentbytes'));},setContentBytes:function(val){this.cacheitemXML.setAttribute('contentbytes',escape(val));this.ContentBytes=val;},getContent:function(){return unescape(this.cacheitemXML.getAttribute('content'));},setContent:function(val){this.cacheitemXML.setAttribute('content',escape(val));this.Content=val;},getFilePath:function(){return unescape(this.cacheitemXML.getAttribute('filepath'));},setFilePath:function(val){this.cacheitemXML.setAttribute('filepath',escape(val));this.FilePath=val;},getDurationInMinutes:function(){return unescape(this.cacheitemXML.getAttribute('durationinminutes'));},setDurationInMinutes:function(val){this.cacheitemXML.setAttribute('durationinminutes',escape(val));this.DurationInMinutes=val;}});var TreeNodeAttribute=Class.create({treenodeattributeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='treenodeattribute')
this.treenodeattributeXML=inputXML;else{this.treenodeattributeXML=document.createElement('treenodeattribute');this.id=-1;this.treenodeattributeXML.setAttribute('treenodeattributeid',-1);}},getID:function(){return this.treenodeattributeXML.getAttribute('treenodeattributeid');},setID:function(val){this.treenodeattributeXML.setAttribute('treenodeattributeid',val);this.TreeNodeAttributeID=val;},getAttrValue:function(){return unescape(this.treenodeattributeXML.getAttribute('attrvalue'));},setAttrValue:function(val){this.treenodeattributeXML.setAttribute('attrvalue',escape(val));this.AttrValue=val;},getAttrName:function(){return unescape(this.treenodeattributeXML.getAttribute('attrname'));},setAttrName:function(val){this.treenodeattributeXML.setAttribute('attrname',escape(val));this.AttrName=val;}});var TreeNode=Class.create({treenodeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='treenode')
this.treenodeXML=inputXML;else{this.treenodeXML=document.createElement('treenode');this.id=-1;this.treenodeXML.setAttribute('treenodeid',-1);}},getID:function(){return this.treenodeXML.getAttribute('treenodeid');},setID:function(val){this.treenodeXML.setAttribute('treenodeid',val);this.TreeNodeID=val;},getOriginalID:function(){return unescape(this.treenodeXML.getAttribute('originalid'));},setOriginalID:function(val){this.treenodeXML.setAttribute('originalid',escape(val));this.OriginalID=val;},getParentNodeID:function(){return unescape(this.treenodeXML.getAttribute('parentnodeid'));},setParentNodeID:function(val){this.treenodeXML.setAttribute('parentnodeid',escape(val));this.ParentNodeID=val;},getAttributes:function(){var ret=new Array();for(i=0;i<this.treenodeXML.childNodes.length;i++)
if(this.treenodeXML.childNodes[i].nodeName.toLowerCase()=='attributes'){var ourNode=this.treenodeXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='treenodeattribute')
ret.push(new TreeNodeAttribute(ourNode.childNodes[j]));break;}
return ret;},setAttributes:function(treenodeattributeList){treenodeattributeList=Utl.toArray(treenodeattributeList);this.Attributes=treenodeattributeList;var alsNd=null;for(i=0;i<this.treenodeXML.childNodes.length;i++)
if(this.treenodeXML.childNodes[i].nodeName.toLowerCase()=='attributes'){alsNd=this.treenodeXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('attributes');this.treenodeXML.appendChild(alsNd);}
for(i=0;i<treenodeattributeList.length;i++)
alsNd.appendChild(treenodeattributeList[i].treenodeattributeXML);},getDocumentID:function(){return unescape(this.treenodeXML.getAttribute('documentid'));},setDocumentID:function(val){this.treenodeXML.setAttribute('documentid',escape(val));this.DocumentID=val;},getSortOrder:function(){return unescape(this.treenodeXML.getAttribute('sortorder'));},setSortOrder:function(val){this.treenodeXML.setAttribute('sortorder',escape(val));this.SortOrder=val;},getDepth:function(){return unescape(this.treenodeXML.getAttribute('depth'));},setDepth:function(val){this.treenodeXML.setAttribute('depth',escape(val));this.Depth=val;},getName:function(){return unescape(this.treenodeXML.getAttribute('name'));},setName:function(val){this.treenodeXML.setAttribute('name',escape(val));this.Name=val;}});var TreeDocument=Class.create({treedocumentXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='treedocument')
this.treedocumentXML=inputXML;else{this.treedocumentXML=document.createElement('treedocument');this.id=-1;this.treedocumentXML.setAttribute('treedocumentid',-1);}},getID:function(){return this.treedocumentXML.getAttribute('treedocumentid');},setID:function(val){this.treedocumentXML.setAttribute('treedocumentid',val);this.TreeDocumentID=val;},getOriginalID:function(){return unescape(this.treedocumentXML.getAttribute('originalid'));},setOriginalID:function(val){this.treedocumentXML.setAttribute('originalid',escape(val));this.OriginalID=val;},getName:function(){return unescape(this.treedocumentXML.getAttribute('name'));},setName:function(val){this.treedocumentXML.setAttribute('name',escape(val));this.Name=val;}});var ServiceItemType=Class.create({serviceitemtypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='serviceitemtype')
this.serviceitemtypeXML=inputXML;else{this.serviceitemtypeXML=document.createElement('serviceitemtype');}},getValue:function(){return unescape(this.serviceitemtypeXML.getAttribute('value'));},setValue:function(val){this.serviceitemtypeXML.setAttribute('value',escape(val));this.Value=val;}});var ServiceItemStatus=Class.create({serviceitemstatusXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='serviceitemstatus')
this.serviceitemstatusXML=inputXML;else{this.serviceitemstatusXML=document.createElement('serviceitemstatus');}},getValue:function(){return unescape(this.serviceitemstatusXML.getAttribute('value'));},setValue:function(val){this.serviceitemstatusXML.setAttribute('value',escape(val));this.Value=val;}});var ServiceItem=Class.create({serviceitemXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='serviceitem')
this.serviceitemXML=inputXML;else{this.serviceitemXML=document.createElement('serviceitem');this.id=-1;this.serviceitemXML.setAttribute('serviceitemid',-1);this.serviceitemXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.serviceitemXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.serviceitemXML.getAttribute('serviceitemid');},setID:function(val){this.serviceitemXML.setAttribute('serviceitemid',val);this.ServiceItemID=val;},getCreateAt:function(){return this.serviceitemXML.getAttribute('createdat');},getLastModified:function(){return this.serviceitemXML.getAttribute('lastmodified');},getServiceItemStatus:function(){var rslt=null;for(i=0;i<this.serviceitemXML.childNodes.length;i++)
if(this.serviceitemXML.childNodes[i].nodeName.toLowerCase()=='serviceitemstatus'){for(j=0;j<this.serviceitemXML.childNodes[i].childNodes.length;j++)
if(this.serviceitemXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='serviceitemstatus'){rslt=new ServiceItemStatus(this.serviceitemXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setServiceItemStatus:function(aServiceItemStatus){var alsNd=null;this.ServiceItemStatus=aServiceItemStatus;for(i=0;i<this.serviceitemXML.childNodes.length;i++)
if(this.serviceitemXML.childNodes[i].nodeName.toLowerCase()=='serviceitemstatus'){alsNd=this.serviceitemXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('serviceitemstatus');this.serviceitemXML.appendChild(alsNd);}
alsNd.appendChild(aServiceItemStatus.serviceitemstatusXML);},getServiceItemType:function(){var rslt=null;for(i=0;i<this.serviceitemXML.childNodes.length;i++)
if(this.serviceitemXML.childNodes[i].nodeName.toLowerCase()=='serviceitemtype'){for(j=0;j<this.serviceitemXML.childNodes[i].childNodes.length;j++)
if(this.serviceitemXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='serviceitemtype'){rslt=new ServiceItemType(this.serviceitemXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setServiceItemType:function(aServiceItemType){var alsNd=null;this.ServiceItemType=aServiceItemType;for(i=0;i<this.serviceitemXML.childNodes.length;i++)
if(this.serviceitemXML.childNodes[i].nodeName.toLowerCase()=='serviceitemtype'){alsNd=this.serviceitemXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('serviceitemtype');this.serviceitemXML.appendChild(alsNd);}
alsNd.appendChild(aServiceItemType.serviceitemtypeXML);},getItemID:function(){return unescape(this.serviceitemXML.getAttribute('itemid'));},setItemID:function(val){this.serviceitemXML.setAttribute('itemid',escape(val));this.ItemID=val;}});var StateProvince=Class.create({stateprovinceXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='stateprovince')
this.stateprovinceXML=inputXML;else{this.stateprovinceXML=document.createElement('stateprovince');this.id=-1;this.stateprovinceXML.setAttribute('stateprovinceid',-1);}},getID:function(){return this.stateprovinceXML.getAttribute('stateprovinceid');},setID:function(val){this.stateprovinceXML.setAttribute('stateprovinceid',val);this.StateProvinceID=val;},getCountry:function(){var rslt=null;for(i=0;i<this.stateprovinceXML.childNodes.length;i++)
if(this.stateprovinceXML.childNodes[i].nodeName.toLowerCase()=='country'){for(j=0;j<this.stateprovinceXML.childNodes[i].childNodes.length;j++)
if(this.stateprovinceXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='country'){rslt=new Country(this.stateprovinceXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setCountry:function(aCountry){var alsNd=null;this.Country=aCountry;for(i=0;i<this.stateprovinceXML.childNodes.length;i++)
if(this.stateprovinceXML.childNodes[i].nodeName.toLowerCase()=='country'){alsNd=this.stateprovinceXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('country');this.stateprovinceXML.appendChild(alsNd);}
alsNd.appendChild(aCountry.countryXML);this.setCountryID(aCountry.countryXML.getAttribute('countryid'));this.CountryID=aCountry.CountryID;},getCountryID:function(){return this.stateprovinceXML.getAttribute('countryid');},setCountryID:function(aCountryID){this.stateprovinceXML.setAttribute('countryid',aCountryID);this.CountryID=aCountryID},getAbbreviation:function(){return unescape(this.stateprovinceXML.getAttribute('abbreviation'));},setAbbreviation:function(val){this.stateprovinceXML.setAttribute('abbreviation',escape(val));this.Abbreviation=val;},getName:function(){return unescape(this.stateprovinceXML.getAttribute('name'));},setName:function(val){this.stateprovinceXML.setAttribute('name',escape(val));this.Name=val;}});var Geocode=Class.create({geocodeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='geocode')
this.geocodeXML=inputXML;else{this.geocodeXML=document.createElement('geocode');this.id=-1;this.geocodeXML.setAttribute('geocodeid',-1);}},getID:function(){return this.geocodeXML.getAttribute('geocodeid');},setID:function(val){this.geocodeXML.setAttribute('geocodeid',val);this.GeocodeID=val;},getPostalCode:function(){return unescape(this.geocodeXML.getAttribute('postalcode'));},setPostalCode:function(val){this.geocodeXML.setAttribute('postalcode',escape(val));this.PostalCode=val;},getStreet:function(){return unescape(this.geocodeXML.getAttribute('street'));},setStreet:function(val){this.geocodeXML.setAttribute('street',escape(val));this.Street=val;},getCity:function(){var rslt=null;for(i=0;i<this.geocodeXML.childNodes.length;i++)
if(this.geocodeXML.childNodes[i].nodeName.toLowerCase()=='city'){for(j=0;j<this.geocodeXML.childNodes[i].childNodes.length;j++)
if(this.geocodeXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='city'){rslt=new City(this.geocodeXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setCity:function(aCity){var alsNd=null;this.City=aCity;for(i=0;i<this.geocodeXML.childNodes.length;i++)
if(this.geocodeXML.childNodes[i].nodeName.toLowerCase()=='city'){alsNd=this.geocodeXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('city');this.geocodeXML.appendChild(alsNd);}
alsNd.appendChild(aCity.cityXML);this.setCityID(aCity.cityXML.getAttribute('cityid'));this.CityID=aCity.CityID;},getCityID:function(){return this.geocodeXML.getAttribute('cityid');},setCityID:function(aCityID){this.geocodeXML.setAttribute('cityid',aCityID);this.CityID=aCityID},getLongitude:function(){return unescape(this.geocodeXML.getAttribute('longitude'));},setLongitude:function(val){this.geocodeXML.setAttribute('longitude',escape(val));this.Longitude=val;},getLatitude:function(){return unescape(this.geocodeXML.getAttribute('latitude'));},setLatitude:function(val){this.geocodeXML.setAttribute('latitude',escape(val));this.Latitude=val;},getAddress:function(){return unescape(this.geocodeXML.getAttribute('address'));},setAddress:function(val){this.geocodeXML.setAttribute('address',escape(val));this.Address=val;}});var Country=Class.create({countryXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='country')
this.countryXML=inputXML;else{this.countryXML=document.createElement('country');this.id=-1;this.countryXML.setAttribute('countryid',-1);}},getID:function(){return this.countryXML.getAttribute('countryid');},setID:function(val){this.countryXML.setAttribute('countryid',val);this.CountryID=val;},getAbbreviation:function(){return unescape(this.countryXML.getAttribute('abbreviation'));},setAbbreviation:function(val){this.countryXML.setAttribute('abbreviation',escape(val));this.Abbreviation=val;},getName:function(){return unescape(this.countryXML.getAttribute('name'));},setName:function(val){this.countryXML.setAttribute('name',escape(val));this.Name=val;}});Country.fullCountryList=[{abbreviation:"US",name:"United States"},{abbreviation:"CA",name:"Canada"},{abbreviation:"AF",name:"Afghanistan"},{abbreviation:"AL",name:"Albania"},{abbreviation:"DZ",name:"Algeria"},{abbreviation:"AS",name:"American Samoa"},{abbreviation:"AD",name:"Andorra"},{abbreviation:"AO",name:"Angola"},{abbreviation:"AI",name:"Anguilla"},{abbreviation:"AQ",name:"Antarctica"},{abbreviation:"AG",name:"Antigua and Barbuda"},{abbreviation:"AR",name:"Argentina"},{abbreviation:"AM",name:"Armenia"},{abbreviation:"AW",name:"Aruba"},{abbreviation:"AU",name:"Australia"},{abbreviation:"AT",name:"Austria"},{abbreviation:"AZ",name:"Azerbaijan"},{abbreviation:"BS",name:"Bahamas"},{abbreviation:"BH",name:"Bahrain"},{abbreviation:"BD",name:"Bangladesh"},{abbreviation:"BB",name:"Barbados"},{abbreviation:"BY",name:"Belarus"},{abbreviation:"BE",name:"Belgium"},{abbreviation:"BZ",name:"Belize"},{abbreviation:"BJ",name:"Benin"},{abbreviation:"BM",name:"Bermuda"},{abbreviation:"BT",name:"Bhutan"},{abbreviation:"BO",name:"Bolivia"},{abbreviation:"BA",name:"Bosnia and Herzegovina"},{abbreviation:"BW",name:"Botswana"},{abbreviation:"BV",name:"Bouvet Island"},{abbreviation:"BR",name:"Brazil"},{abbreviation:"IO",name:"British Indian Ocean Territory"},{abbreviation:"BN",name:"Brunei"},{abbreviation:"BG",name:"Bulgaria"},{abbreviation:"BF",name:"Burkina Faso"},{abbreviation:"BI",name:"Burundi"},{abbreviation:"KH",name:"Cambodia"},{abbreviation:"CM",name:"Cameroon"},{abbreviation:"CV",name:"Cape Verde"},{abbreviation:"KY",name:"Cayman Islands"},{abbreviation:"CF",name:"Central African Republic"},{abbreviation:"TD",name:"Chad"},{abbreviation:"CL",name:"Chile"},{abbreviation:"CN",name:"China"},{abbreviation:"CX",name:"Christmas Island"},{abbreviation:"CC",name:"Cocos (Keeling) Islands"},{abbreviation:"CO",name:"Colombia"},{abbreviation:"KM",name:"Comoros"},{abbreviation:"CG",name:"Congo"},{abbreviation:"CD",name:"Congo (DRC)"},{abbreviation:"CK",name:"Cook Islands"},{abbreviation:"CR",name:"Costa Rica"},{abbreviation:"CI",name:"Cote d'Ivoire"},{abbreviation:"HR",name:"Croatia"},{abbreviation:"CY",name:"Cyprus"},{abbreviation:"CZ",name:"Czech Republic"},{abbreviation:"DK",name:"Denmark"},{abbreviation:"DJ",name:"Djibouti"},{abbreviation:"DM",name:"Dominica"},{abbreviation:"DO",name:"Dominican Republic"},{abbreviation:"EC",name:"Ecuador"},{abbreviation:"EG",name:"Egypt"},{abbreviation:"SV",name:"El Salvador"},{abbreviation:"GQ",name:"Equatorial Guinea"},{abbreviation:"ER",name:"Eritrea"},{abbreviation:"EE",name:"Estonia"},{abbreviation:"ET",name:"Ethiopia"},{abbreviation:"FK",name:"Falkland Islands"},{abbreviation:"FO",name:"Faroe Islands"},{abbreviation:"FJ",name:"Fiji Islands"},{abbreviation:"FI",name:"Finland"},{abbreviation:"FR",name:"France"},{abbreviation:"GF",name:"French Guiana"},{abbreviation:"PF",name:"French Polynesia"},{abbreviation:"GA",name:"Gabon"},{abbreviation:"GM",name:"Gambia, The"},{abbreviation:"GE",name:"Georgia"},{abbreviation:"DE",name:"Germany"},{abbreviation:"GH",name:"Ghana"},{abbreviation:"GI",name:"Gibraltar"},{abbreviation:"GR",name:"Greece"},{abbreviation:"GL",name:"Greenland"},{abbreviation:"GD",name:"Grenada"},{abbreviation:"GP",name:"Guadeloupe"},{abbreviation:"GU",name:"Guam"},{abbreviation:"GT",name:"Guatemala"},{abbreviation:"GG",name:"Guernsey"},{abbreviation:"GN",name:"Guinea"},{abbreviation:"GW",name:"Guinea-Bissau"},{abbreviation:"GY",name:"Guyana"},{abbreviation:"HT",name:"Haiti"},{abbreviation:"HM",name:"Heard Island/McDonald Islands"},{abbreviation:"HN",name:"Honduras"},{abbreviation:"HK",name:"Hong Kong SAR"},{abbreviation:"HU",name:"Hungary"},{abbreviation:"IS",name:"Iceland"},{abbreviation:"IN",name:"India"},{abbreviation:"ID",name:"Indonesia"},{abbreviation:"IQ",name:"Iraq"},{abbreviation:"IE",name:"Ireland"},{abbreviation:"IM",name:"Isle of Man"},{abbreviation:"IL",name:"Israel"},{abbreviation:"IT",name:"Italy"},{abbreviation:"JM",name:"Jamaica"},{abbreviation:"JP",name:"Japan"},{abbreviation:"JE",name:"Jersey"},{abbreviation:"JO",name:"Jordan"},{abbreviation:"KZ",name:"Kazakhstan"},{abbreviation:"KE",name:"Kenya"},{abbreviation:"KI",name:"Kiribati"},{abbreviation:"KR",name:"Korea"},{abbreviation:"KW",name:"Kuwait"},{abbreviation:"KG",name:"Kyrgyzstan"},{abbreviation:"LA",name:"Laos"},{abbreviation:"LV",name:"Latvia"},{abbreviation:"LB",name:"Lebanon"},{abbreviation:"LS",name:"Lesotho"},{abbreviation:"LR",name:"Liberia"},{abbreviation:"LY",name:"Libya"},{abbreviation:"LI",name:"Liechtenstein"},{abbreviation:"LT",name:"Lithuania"},{abbreviation:"LU",name:"Luxembourg"},{abbreviation:"MO",name:"Macao SAR"},{abbreviation:"MK",name:"Macedonia"},{abbreviation:"MG",name:"Madagascar"},{abbreviation:"MW",name:"Malawi"},{abbreviation:"MY",name:"Malaysia"},{abbreviation:"MV",name:"Maldives"},{abbreviation:"ML",name:"Mali"},{abbreviation:"MT",name:"Malta"},{abbreviation:"MH",name:"Marshall Islands"},{abbreviation:"MQ",name:"Martinique"},{abbreviation:"MR",name:"Mauritania"},{abbreviation:"MU",name:"Mauritius"},{abbreviation:"YT",name:"Mayotte"},{abbreviation:"MX",name:"Mexico"},{abbreviation:"FM",name:"Micronesia"},{abbreviation:"MD",name:"Moldova"},{abbreviation:"MC",name:"Monaco"},{abbreviation:"MN",name:"Mongolia"},{abbreviation:"ME",name:"Montenegro"},{abbreviation:"MS",name:"Montserrat"},{abbreviation:"MA",name:"Morocco"},{abbreviation:"MZ",name:"Mozambique"},{abbreviation:"MM",name:"Myanmar"},{abbreviation:"NA",name:"Namibia"},{abbreviation:"NR",name:"Nauru"},{abbreviation:"NP",name:"Nepal"},{abbreviation:"NL",name:"Netherlands"},{abbreviation:"AN",name:"Netherlands Antilles"},{abbreviation:"NC",name:"New Caledonia"},{abbreviation:"NZ",name:"New Zealand"},{abbreviation:"NI",name:"Nicaragua"},{abbreviation:"NE",name:"Niger"},{abbreviation:"NG",name:"Nigeria"},{abbreviation:"NU",name:"Niue"},{abbreviation:"NF",name:"Norfolk Island"},{abbreviation:"MP",name:"Northern Mariana Islands"},{abbreviation:"NO",name:"Norway"},{abbreviation:"OM",name:"Oman"},{abbreviation:"PK",name:"Pakistan"},{abbreviation:"PW",name:"Palau"},{abbreviation:"PS",name:"Palestinian Authority"},{abbreviation:"PA",name:"Panama"},{abbreviation:"PG",name:"Papua New Guinea"},{abbreviation:"PY",name:"Paraguay"},{abbreviation:"PE",name:"Peru"},{abbreviation:"PH",name:"Philippines"},{abbreviation:"PN",name:"Pitcairn Islands"},{abbreviation:"PL",name:"Poland"},{abbreviation:"PT",name:"Portugal"},{abbreviation:"PR",name:"Puerto Rico"},{abbreviation:"QA",name:"Qatar"},{abbreviation:"RE",name:"Reunion"},{abbreviation:"RO",name:"Romania"},{abbreviation:"RU",name:"Russia"},{abbreviation:"RW",name:"Rwanda"},{abbreviation:"WS",name:"Samoa"},{abbreviation:"SM",name:"San Marino"},{abbreviation:"ST",name:"Sao Tome and Principe"},{abbreviation:"SA",name:"Saudi Arabia"},{abbreviation:"SN",name:"Senegal"},{abbreviation:"RS",name:"Serbia"},{abbreviation:"SC",name:"Seychelles"},{abbreviation:"SL",name:"Sierra Leone"},{abbreviation:"SG",name:"Singapore"},{abbreviation:"SK",name:"Slovakia"},{abbreviation:"SI",name:"Slovenia"},{abbreviation:"SB",name:"Solomon Islands"},{abbreviation:"SO",name:"Somalia"},{abbreviation:"ZA",name:"South Africa"},{abbreviation:"GS",name:"South Georgia & South Sandwich"},{abbreviation:"ES",name:"Spain"},{abbreviation:"LK",name:"Sri Lanka"},{abbreviation:"SH",name:"St. Helena"},{abbreviation:"KN",name:"St. Kitts and Nevis"},{abbreviation:"LC",name:"St. Lucia"},{abbreviation:"PM",name:"St. Pierre and Miquelon"},{abbreviation:"VC",name:"St. Vincent & the Grenadines"},{abbreviation:"SR",name:"Suriname"},{abbreviation:"SJ",name:"Svalbard and Jan Mayen"},{abbreviation:"SZ",name:"Swaziland"},{abbreviation:"SE",name:"Sweden"},{abbreviation:"CH",name:"Switzerland"},{abbreviation:"TW",name:"Taiwan"},{abbreviation:"TJ",name:"Tajikistan"},{abbreviation:"TZ",name:"Tanzania"},{abbreviation:"TH",name:"Thailand"},{abbreviation:"TP",name:"Timor-Leste (East Timor)"},{abbreviation:"TG",name:"Togo"},{abbreviation:"TK",name:"Tokelau"},{abbreviation:"TO",name:"Tonga"},{abbreviation:"TT",name:"Trinidad and Tobago"},{abbreviation:"TN",name:"Tunisia"},{abbreviation:"TR",name:"Turkey"},{abbreviation:"TM",name:"Turkmenistan"},{abbreviation:"TC",name:"Turks and Caicos Islands"},{abbreviation:"TV",name:"Tuvalu"},{abbreviation:"UG",name:"Uganda"},{abbreviation:"UA",name:"Ukraine"},{abbreviation:"AE",name:"United Arab Emirates"},{abbreviation:"UK",name:"United Kingdom"},{abbreviation:"US",name:"United States"},{abbreviation:"UM",name:"US Minor Outlying Islands"},{abbreviation:"UY",name:"Uruguay"},{abbreviation:"UZ",name:"Uzbekistan"},{abbreviation:"VU",name:"Vanuatu"},{abbreviation:"VA",name:"Vatican City"},{abbreviation:"VE",name:"Venezuela"},{abbreviation:"VN",name:"Vietnam"},{abbreviation:"VI",name:"Virgin Islands, U.S."},{abbreviation:"VG",name:"Virgin Islands, British"},{abbreviation:"WF",name:"Wallis and Futuna"},{abbreviation:"YE",name:"Yemen"},{abbreviation:"ZM",name:"Zambia"},{abbreviation:"ZW",name:"Zimbabwe"}];var City=Class.create({cityXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='city')
this.cityXML=inputXML;else{this.cityXML=document.createElement('city');this.id=-1;this.cityXML.setAttribute('cityid',-1);}},getID:function(){return this.cityXML.getAttribute('cityid');},setID:function(val){this.cityXML.setAttribute('cityid',val);this.CityID=val;},getStateProv:function(){var rslt=null;for(i=0;i<this.cityXML.childNodes.length;i++)
if(this.cityXML.childNodes[i].nodeName.toLowerCase()=='stateprov'){for(j=0;j<this.cityXML.childNodes[i].childNodes.length;j++)
if(this.cityXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='stateprovince'){rslt=new StateProvince(this.cityXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setStateProv:function(aStateProvince){var alsNd=null;this.StateProv=aStateProvince;for(i=0;i<this.cityXML.childNodes.length;i++)
if(this.cityXML.childNodes[i].nodeName.toLowerCase()=='stateprov'){alsNd=this.cityXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('stateprov');this.cityXML.appendChild(alsNd);}
alsNd.appendChild(aStateProvince.stateprovinceXML);this.setStateProvID(aStateProvince.stateprovinceXML.getAttribute('stateprovinceid'));this.StateProvID=aStateProvince.StateProvinceID;},getStateProvID:function(){return this.cityXML.getAttribute('stateprovid');},setStateProvID:function(aStateProvinceID){this.cityXML.setAttribute('stateprovid',aStateProvinceID);this.StateProvID=aStateProvinceID},getCityName:function(){return unescape(this.cityXML.getAttribute('cityname'));},setCityName:function(val){this.cityXML.setAttribute('cityname',escape(val));this.CityName=val;}});var Portal=Class.create({portalXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='portal')
this.portalXML=inputXML;else{this.portalXML=document.createElement('portal');this.id=-1;this.portalXML.setAttribute('portalid',-1);}},getID:function(){return this.portalXML.getAttribute('portalid');},setID:function(val){this.portalXML.setAttribute('portalid',val);this.PortalID=val;},getPortalKey:function(){return unescape(this.portalXML.getAttribute('portalkey'));},setPortalKey:function(val){this.portalXML.setAttribute('portalkey',escape(val));this.PortalKey=val;},getPortalName:function(){return unescape(this.portalXML.getAttribute('portalname'));},setPortalName:function(val){this.portalXML.setAttribute('portalname',escape(val));this.PortalName=val;}});var Person=Class.create({personXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='person')
this.personXML=inputXML;else{this.personXML=document.createElement('person');this.id=-1;this.personXML.setAttribute('personid',-1);this.personXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.personXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.personXML.getAttribute('personid');},setID:function(val){this.personXML.setAttribute('personid',val);this.PersonID=val;},getCreateAt:function(){return this.personXML.getAttribute('createdat');},getLastModified:function(){return this.personXML.getAttribute('lastmodified');},getNameSuffix:function(){return unescape(this.personXML.getAttribute('namesuffix'));},setNameSuffix:function(val){this.personXML.setAttribute('namesuffix',escape(val));this.NameSuffix=val;},getSSN:function(){return unescape(this.personXML.getAttribute('ssn'));},setSSN:function(val){this.personXML.setAttribute('ssn',escape(val));this.SSN=val;},getGender:function(){var rslt=null;for(i=0;i<this.personXML.childNodes.length;i++)
if(this.personXML.childNodes[i].nodeName.toLowerCase()=='gender'){for(j=0;j<this.personXML.childNodes[i].childNodes.length;j++)
if(this.personXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='gender'){rslt=new Gender(this.personXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setGender:function(aGender){var alsNd=null;this.Gender=aGender;for(i=0;i<this.personXML.childNodes.length;i++)
if(this.personXML.childNodes[i].nodeName.toLowerCase()=='gender'){alsNd=this.personXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('gender');this.personXML.appendChild(alsNd);}
alsNd.appendChild(aGender.genderXML);},getDateOfBirth:function(){return unescape(this.personXML.getAttribute('dateofbirth'));},setDateOfBirth:function(val){this.personXML.setAttribute('dateofbirth',escape(val));this.DateOfBirth=val;},getLastName:function(){return unescape(this.personXML.getAttribute('lastname'));},setLastName:function(val){this.personXML.setAttribute('lastname',escape(val));this.LastName=val;},getMiddleName:function(){return unescape(this.personXML.getAttribute('middlename'));},setMiddleName:function(val){this.personXML.setAttribute('middlename',escape(val));this.MiddleName=val;},getFirstName:function(){return unescape(this.personXML.getAttribute('firstname'));},setFirstName:function(val){this.personXML.setAttribute('firstname',escape(val));this.FirstName=val;}});var Gender=Class.create({genderXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='gender')
this.genderXML=inputXML;else{this.genderXML=document.createElement('gender');}},getValue:function(){return unescape(this.genderXML.getAttribute('value'));},setValue:function(val){this.genderXML.setAttribute('value',escape(val));this.Value=val;}});if(!window.Gender)
window.Gender=Class.create();Gender.values={Unknown:"Unknown",Male:"Male",Female:"Female"};var CRMReference=Class.create({crmreferenceXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='crmreference')
this.crmreferenceXML=inputXML;else{this.crmreferenceXML=document.createElement('crmreference');this.id=-1;this.crmreferenceXML.setAttribute('crmreferenceid',-1);}},getID:function(){return this.crmreferenceXML.getAttribute('crmreferenceid');},setID:function(val){this.crmreferenceXML.setAttribute('crmreferenceid',val);this.CRMReferenceID=val;},getCRMType:function(){return unescape(this.crmreferenceXML.getAttribute('crmtype'));},setCRMType:function(val){this.crmreferenceXML.setAttribute('crmtype',escape(val));this.CRMType=val;},getAccount:function(){var rslt=null;for(i=0;i<this.crmreferenceXML.childNodes.length;i++)
if(this.crmreferenceXML.childNodes[i].nodeName.toLowerCase()=='account'){for(j=0;j<this.crmreferenceXML.childNodes[i].childNodes.length;j++)
if(this.crmreferenceXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='account'){rslt=new Account(this.crmreferenceXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setAccount:function(aAccount){var alsNd=null;this.Account=aAccount;for(i=0;i<this.crmreferenceXML.childNodes.length;i++)
if(this.crmreferenceXML.childNodes[i].nodeName.toLowerCase()=='account'){alsNd=this.crmreferenceXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('account');this.crmreferenceXML.appendChild(alsNd);}
alsNd.appendChild(aAccount.accountXML);this.setAccountID(aAccount.accountXML.getAttribute('accountid'));this.AccountID=aAccount.AccountID;},getAccountID:function(){return this.crmreferenceXML.getAttribute('accountid');},setAccountID:function(aAccountID){this.crmreferenceXML.setAttribute('accountid',aAccountID);this.AccountID=aAccountID},getConnectURL:function(){return unescape(this.crmreferenceXML.getAttribute('connecturl'));},setConnectURL:function(val){this.crmreferenceXML.setAttribute('connecturl',escape(val));this.ConnectURL=val;},getName:function(){return unescape(this.crmreferenceXML.getAttribute('name'));},setName:function(val){this.crmreferenceXML.setAttribute('name',escape(val));this.Name=val;}});var ContactAttribute=Class.create({contactattributeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='contactattribute')
this.contactattributeXML=inputXML;else{this.contactattributeXML=document.createElement('contactattribute');this.id=-1;this.contactattributeXML.setAttribute('contactattributeid',-1);}},getID:function(){return this.contactattributeXML.getAttribute('contactattributeid');},setID:function(val){this.contactattributeXML.setAttribute('contactattributeid',val);this.ContactAttributeID=val;},getAttrKey:function(){return unescape(this.contactattributeXML.getAttribute('attrkey'));},setAttrKey:function(val){this.contactattributeXML.setAttribute('attrkey',escape(val));this.AttrKey=val;},getAttrValue:function(){return unescape(this.contactattributeXML.getAttribute('attrvalue'));},setAttrValue:function(val){this.contactattributeXML.setAttribute('attrvalue',escape(val));this.AttrValue=val;}});var Contact=Class.create({contactXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='contact')
this.contactXML=inputXML;else{this.contactXML=document.createElement('contact');this.id=-1;this.contactXML.setAttribute('contactid',-1);this.contactXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.contactXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.contactXML.getAttribute('contactid');},setID:function(val){this.contactXML.setAttribute('contactid',val);this.ContactID=val;},getCreateAt:function(){return this.contactXML.getAttribute('createdat');},getLastModified:function(){return this.contactXML.getAttribute('lastmodified');},getPhoneNumbers:function(){var ret=new Array();for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='phonenumbers'){var ourNode=this.contactXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='phonenumber')
ret.push(new PhoneNumber(ourNode.childNodes[j]));break;}
return ret;},setPhoneNumbers:function(phonenumberList){phonenumberList=Utl.toArray(phonenumberList);this.PhoneNumbers=phonenumberList;var alsNd=null;for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='phonenumbers'){alsNd=this.contactXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('phonenumbers');this.contactXML.appendChild(alsNd);}
for(i=0;i<phonenumberList.length;i++)
alsNd.appendChild(phonenumberList[i].phonenumberXML);},getMailingAddresses:function(){var ret=new Array();for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='mailingaddresses'){var ourNode=this.contactXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='mailingaddress')
ret.push(new MailingAddress(ourNode.childNodes[j]));break;}
return ret;},setMailingAddresses:function(mailingaddressList){mailingaddressList=Utl.toArray(mailingaddressList);this.MailingAddresses=mailingaddressList;var alsNd=null;for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='mailingaddresses'){alsNd=this.contactXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('mailingaddresses');this.contactXML.appendChild(alsNd);}
for(i=0;i<mailingaddressList.length;i++)
alsNd.appendChild(mailingaddressList[i].mailingaddressXML);},getEmailAddresses:function(){var ret=new Array();for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='emailaddresses'){var ourNode=this.contactXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='emailaddress')
ret.push(new EmailAddress(ourNode.childNodes[j]));break;}
return ret;},setEmailAddresses:function(emailaddressList){emailaddressList=Utl.toArray(emailaddressList);this.EmailAddresses=emailaddressList;var alsNd=null;for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='emailaddresses'){alsNd=this.contactXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('emailaddresses');this.contactXML.appendChild(alsNd);}
for(i=0;i<emailaddressList.length;i++)
alsNd.appendChild(emailaddressList[i].emailaddressXML);},getPersonalInfo:function(){var rslt=null;for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='personalinfo'){for(j=0;j<this.contactXML.childNodes[i].childNodes.length;j++)
if(this.contactXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='person'){rslt=new Person(this.contactXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setPersonalInfo:function(aPerson){var alsNd=null;this.PersonalInfo=aPerson;for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='personalinfo'){alsNd=this.contactXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('personalinfo');this.contactXML.appendChild(alsNd);}
alsNd.appendChild(aPerson.personXML);this.setPersonalInfoID(aPerson.personXML.getAttribute('personid'));this.PersonalInfoID=aPerson.PersonID;},getPersonalInfoID:function(){return this.contactXML.getAttribute('personalinfoid');},setPersonalInfoID:function(aPersonID){this.contactXML.setAttribute('personalinfoid',aPersonID);this.PersonalInfoID=aPersonID},getAttributes:function(){var ret=new Array();for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='attributes'){var ourNode=this.contactXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='contactattribute')
ret.push(new ContactAttribute(ourNode.childNodes[j]));break;}
return ret;},setAttributes:function(contactattributeList){contactattributeList=Utl.toArray(contactattributeList);this.Attributes=contactattributeList;var alsNd=null;for(i=0;i<this.contactXML.childNodes.length;i++)
if(this.contactXML.childNodes[i].nodeName.toLowerCase()=='attributes'){alsNd=this.contactXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('attributes');this.contactXML.appendChild(alsNd);}
for(i=0;i<contactattributeList.length;i++)
alsNd.appendChild(contactattributeList[i].contactattributeXML);}});var AccountNotification=Class.create({accountnotificationXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='accountnotification')
this.accountnotificationXML=inputXML;else{this.accountnotificationXML=document.createElement('accountnotification');this.id=-1;this.accountnotificationXML.setAttribute('accountnotificationid',-1);}},getID:function(){return this.accountnotificationXML.getAttribute('accountnotificationid');},setID:function(val){this.accountnotificationXML.setAttribute('accountnotificationid',val);this.AccountNotificationID=val;},getAccount:function(){var rslt=null;for(i=0;i<this.accountnotificationXML.childNodes.length;i++)
if(this.accountnotificationXML.childNodes[i].nodeName.toLowerCase()=='account'){for(j=0;j<this.accountnotificationXML.childNodes[i].childNodes.length;j++)
if(this.accountnotificationXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='account'){rslt=new Account(this.accountnotificationXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setAccount:function(aAccount){var alsNd=null;this.Account=aAccount;for(i=0;i<this.accountnotificationXML.childNodes.length;i++)
if(this.accountnotificationXML.childNodes[i].nodeName.toLowerCase()=='account'){alsNd=this.accountnotificationXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('account');this.accountnotificationXML.appendChild(alsNd);}
alsNd.appendChild(aAccount.accountXML);this.setAccountID(aAccount.accountXML.getAttribute('accountid'));this.AccountID=aAccount.AccountID;},getAccountID:function(){return this.accountnotificationXML.getAttribute('accountid');},setAccountID:function(aAccountID){this.accountnotificationXML.setAttribute('accountid',aAccountID);this.AccountID=aAccountID},getContact:function(){var rslt=null;for(i=0;i<this.accountnotificationXML.childNodes.length;i++)
if(this.accountnotificationXML.childNodes[i].nodeName.toLowerCase()=='contact'){for(j=0;j<this.accountnotificationXML.childNodes[i].childNodes.length;j++)
if(this.accountnotificationXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='contact'){rslt=new Contact(this.accountnotificationXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setContact:function(aContact){var alsNd=null;this.Contact=aContact;for(i=0;i<this.accountnotificationXML.childNodes.length;i++)
if(this.accountnotificationXML.childNodes[i].nodeName.toLowerCase()=='contact'){alsNd=this.accountnotificationXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('contact');this.accountnotificationXML.appendChild(alsNd);}
alsNd.appendChild(aContact.contactXML);this.setContactID(aContact.contactXML.getAttribute('contactid'));this.ContactID=aContact.ContactID;},getContactID:function(){return this.accountnotificationXML.getAttribute('contactid');},setContactID:function(aContactID){this.accountnotificationXML.setAttribute('contactid',aContactID);this.ContactID=aContactID}});var Account=Class.create({accountXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='account')
this.accountXML=inputXML;else{this.accountXML=document.createElement('account');this.id=-1;this.accountXML.setAttribute('accountid',-1);this.accountXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.accountXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.accountXML.getAttribute('accountid');},setID:function(val){this.accountXML.setAttribute('accountid',val);this.AccountID=val;},getCreateAt:function(){return this.accountXML.getAttribute('createdat');},getLastModified:function(){return this.accountXML.getAttribute('lastmodified');},getIsEnabled:function(){return unescape(this.accountXML.getAttribute('isenabled'));},setIsEnabled:function(val){this.accountXML.setAttribute('isenabled',escape(val));this.IsEnabled=val;},getIsDefaultPortalAccount:function(){return unescape(this.accountXML.getAttribute('isdefaultportalaccount'));},setIsDefaultPortalAccount:function(val){this.accountXML.setAttribute('isdefaultportalaccount',escape(val));this.IsDefaultPortalAccount=val;},getAssociatedPortal:function(){var rslt=null;for(i=0;i<this.accountXML.childNodes.length;i++)
if(this.accountXML.childNodes[i].nodeName.toLowerCase()=='associatedportal'){for(j=0;j<this.accountXML.childNodes[i].childNodes.length;j++)
if(this.accountXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='portal'){rslt=new Portal(this.accountXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setAssociatedPortal:function(aPortal){var alsNd=null;this.AssociatedPortal=aPortal;for(i=0;i<this.accountXML.childNodes.length;i++)
if(this.accountXML.childNodes[i].nodeName.toLowerCase()=='associatedportal'){alsNd=this.accountXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('associatedportal');this.accountXML.appendChild(alsNd);}
alsNd.appendChild(aPortal.portalXML);this.setAssociatedPortalID(aPortal.portalXML.getAttribute('portalid'));this.AssociatedPortalID=aPortal.PortalID;},getAssociatedPortalID:function(){return this.accountXML.getAttribute('associatedportalid');},setAssociatedPortalID:function(aPortalID){this.accountXML.setAttribute('associatedportalid',aPortalID);this.AssociatedPortalID=aPortalID},getParentAccountID:function(){return unescape(this.accountXML.getAttribute('parentaccountid'));},setParentAccountID:function(val){this.accountXML.setAttribute('parentaccountid',escape(val));this.ParentAccountID=val;},getDescription:function(){return unescape(this.accountXML.getAttribute('description'));},setDescription:function(val){this.accountXML.setAttribute('description',escape(val));this.Description=val;},getName:function(){return unescape(this.accountXML.getAttribute('name'));},setName:function(val){this.accountXML.setAttribute('name',escape(val));this.Name=val;}});var PhoneNumberType=Class.create({phonenumbertypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='phonenumbertype')
this.phonenumbertypeXML=inputXML;else{this.phonenumbertypeXML=document.createElement('phonenumbertype');}},getValue:function(){return unescape(this.phonenumbertypeXML.getAttribute('value'));},setValue:function(val){this.phonenumbertypeXML.setAttribute('value',escape(val));this.Value=val;}});if(!window.PhoneNumberType)
window.PhoneNumberType=Class.create();PhoneNumberType.values={PrimaryNumber:"Primary",OfficeNumber:"Work",MobileNumber:"Mobile",HomeNumber:"Home",Fax:"Fax",Pager:"Pager",OtherNumber:"Other"};var PhoneNumber=Class.create({phonenumberXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='phonenumber')
this.phonenumberXML=inputXML;else{this.phonenumberXML=document.createElement('phonenumber');this.id=-1;this.phonenumberXML.setAttribute('phonenumberid',-1);}},getID:function(){return this.phonenumberXML.getAttribute('phonenumberid');},setID:function(val){this.phonenumberXML.setAttribute('phonenumberid',val);this.PhoneNumberID=val;},getNumberType:function(){var rslt=null;for(i=0;i<this.phonenumberXML.childNodes.length;i++)
if(this.phonenumberXML.childNodes[i].nodeName.toLowerCase()=='numbertype'){for(j=0;j<this.phonenumberXML.childNodes[i].childNodes.length;j++)
if(this.phonenumberXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='phonenumbertype'){rslt=new PhoneNumberType(this.phonenumberXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setNumberType:function(aPhoneNumberType){var alsNd=null;this.NumberType=aPhoneNumberType;for(i=0;i<this.phonenumberXML.childNodes.length;i++)
if(this.phonenumberXML.childNodes[i].nodeName.toLowerCase()=='numbertype'){alsNd=this.phonenumberXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('numbertype');this.phonenumberXML.appendChild(alsNd);}
alsNd.appendChild(aPhoneNumberType.phonenumbertypeXML);},getNumber:function(){return unescape(this.phonenumberXML.getAttribute('number'));},setNumber:function(val){this.phonenumberXML.setAttribute('number',escape(val));this.Number=val;}});var NotificationType=Class.create({notificationtypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='notificationtype')
this.notificationtypeXML=inputXML;else{this.notificationtypeXML=document.createElement('notificationtype');}},getValue:function(){return unescape(this.notificationtypeXML.getAttribute('value'));},setValue:function(val){this.notificationtypeXML.setAttribute('value',escape(val));this.Value=val;}});var NotificationAudit=Class.create({notificationauditXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='notificationaudit')
this.notificationauditXML=inputXML;else{this.notificationauditXML=document.createElement('notificationaudit');this.id=-1;this.notificationauditXML.setAttribute('notificationauditid',-1);this.notificationauditXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.notificationauditXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.notificationauditXML.getAttribute('notificationauditid');},setID:function(val){this.notificationauditXML.setAttribute('notificationauditid',val);this.NotificationAuditID=val;},getCreateAt:function(){return this.notificationauditXML.getAttribute('createdat');},getLastModified:function(){return this.notificationauditXML.getAttribute('lastmodified');},getSummary:function(){return unescape(this.notificationauditXML.getAttribute('summary'));},setSummary:function(val){this.notificationauditXML.setAttribute('summary',escape(val));this.Summary=val;},getNotificationBlob:function(){return unescape(this.notificationauditXML.getAttribute('notificationblob'));},setNotificationBlob:function(val){this.notificationauditXML.setAttribute('notificationblob',escape(val));this.NotificationBlob=val;},getFromProfileID:function(){return unescape(this.notificationauditXML.getAttribute('fromprofileid'));},setFromProfileID:function(val){this.notificationauditXML.setAttribute('fromprofileid',escape(val));this.FromProfileID=val;},getDevelopmentID:function(){return unescape(this.notificationauditXML.getAttribute('developmentid'));},setDevelopmentID:function(val){this.notificationauditXML.setAttribute('developmentid',escape(val));this.DevelopmentID=val;},getAccountID:function(){return unescape(this.notificationauditXML.getAttribute('accountid'));},setAccountID:function(val){this.notificationauditXML.setAttribute('accountid',escape(val));this.AccountID=val;}});var MailingAddressType=Class.create({mailingaddresstypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='mailingaddresstype')
this.mailingaddresstypeXML=inputXML;else{this.mailingaddresstypeXML=document.createElement('mailingaddresstype');}},getValue:function(){return unescape(this.mailingaddresstypeXML.getAttribute('value'));},setValue:function(val){this.mailingaddresstypeXML.setAttribute('value',escape(val));this.Value=val;}});if(!window.MailingAddressType)
window.MailingAddressType=Class.create();MailingAddressType.values={PrimaryAddress:"Primary",BillingAddress:"Billing",ShippingAddress:"Shipping",OtherAddress:"Other"};var MailingAddress=Class.create({mailingaddressXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='mailingaddress')
this.mailingaddressXML=inputXML;else{this.mailingaddressXML=document.createElement('mailingaddress');this.id=-1;this.mailingaddressXML.setAttribute('mailingaddressid',-1);}},getID:function(){return this.mailingaddressXML.getAttribute('mailingaddressid');},setID:function(val){this.mailingaddressXML.setAttribute('mailingaddressid',val);this.MailingAddressID=val;},getLongitude:function(){return unescape(this.mailingaddressXML.getAttribute('longitude'));},setLongitude:function(val){this.mailingaddressXML.setAttribute('longitude',escape(val));this.Longitude=val;},getLatitude:function(){return unescape(this.mailingaddressXML.getAttribute('latitude'));},setLatitude:function(val){this.mailingaddressXML.setAttribute('latitude',escape(val));this.Latitude=val;},getZipPostal:function(){return unescape(this.mailingaddressXML.getAttribute('zippostal'));},setZipPostal:function(val){this.mailingaddressXML.setAttribute('zippostal',escape(val));this.ZipPostal=val;},getCountry:function(){return unescape(this.mailingaddressXML.getAttribute('country'));},setCountry:function(val){this.mailingaddressXML.setAttribute('country',escape(val));this.Country=val;},getProvince:function(){return unescape(this.mailingaddressXML.getAttribute('province'));},setProvince:function(val){this.mailingaddressXML.setAttribute('province',escape(val));this.Province=val;},getCity:function(){return unescape(this.mailingaddressXML.getAttribute('city'));},setCity:function(val){this.mailingaddressXML.setAttribute('city',escape(val));this.City=val;},getAddress3:function(){return unescape(this.mailingaddressXML.getAttribute('address3'));},setAddress3:function(val){this.mailingaddressXML.setAttribute('address3',escape(val));this.Address3=val;},getAddress2:function(){return unescape(this.mailingaddressXML.getAttribute('address2'));},setAddress2:function(val){this.mailingaddressXML.setAttribute('address2',escape(val));this.Address2=val;},getAddress1:function(){return unescape(this.mailingaddressXML.getAttribute('address1'));},setAddress1:function(val){this.mailingaddressXML.setAttribute('address1',escape(val));this.Address1=val;},getUserLocation:function(){return unescape(this.mailingaddressXML.getAttribute('userlocation'));},setUserLocation:function(val){this.mailingaddressXML.setAttribute('userlocation',escape(val));this.UserLocation=val;},getLocation:function(){var rslt=null;for(i=0;i<this.mailingaddressXML.childNodes.length;i++)
if(this.mailingaddressXML.childNodes[i].nodeName.toLowerCase()=='location'){for(j=0;j<this.mailingaddressXML.childNodes[i].childNodes.length;j++)
if(this.mailingaddressXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='geocode'){rslt=new Geocode(this.mailingaddressXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLocation:function(aGeocode){var alsNd=null;this.Location=aGeocode;for(i=0;i<this.mailingaddressXML.childNodes.length;i++)
if(this.mailingaddressXML.childNodes[i].nodeName.toLowerCase()=='location'){alsNd=this.mailingaddressXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('location');this.mailingaddressXML.appendChild(alsNd);}
alsNd.appendChild(aGeocode.geocodeXML);this.setLocationID(aGeocode.geocodeXML.getAttribute('geocodeid'));this.LocationID=aGeocode.GeocodeID;},getLocationID:function(){return this.mailingaddressXML.getAttribute('locationid');},setLocationID:function(aGeocodeID){this.mailingaddressXML.setAttribute('locationid',aGeocodeID);this.LocationID=aGeocodeID},getPhoneNumbers:function(){var ret=new Array();for(i=0;i<this.mailingaddressXML.childNodes.length;i++)
if(this.mailingaddressXML.childNodes[i].nodeName.toLowerCase()=='phonenumbers'){var ourNode=this.mailingaddressXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='phonenumber')
ret.push(new PhoneNumber(ourNode.childNodes[j]));break;}
return ret;},setPhoneNumbers:function(phonenumberList){phonenumberList=Utl.toArray(phonenumberList);this.PhoneNumbers=phonenumberList;var alsNd=null;for(i=0;i<this.mailingaddressXML.childNodes.length;i++)
if(this.mailingaddressXML.childNodes[i].nodeName.toLowerCase()=='phonenumbers'){alsNd=this.mailingaddressXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('phonenumbers');this.mailingaddressXML.appendChild(alsNd);}
for(i=0;i<phonenumberList.length;i++)
alsNd.appendChild(phonenumberList[i].phonenumberXML);},getAddressType:function(){var rslt=null;for(i=0;i<this.mailingaddressXML.childNodes.length;i++)
if(this.mailingaddressXML.childNodes[i].nodeName.toLowerCase()=='addresstype'){for(j=0;j<this.mailingaddressXML.childNodes[i].childNodes.length;j++)
if(this.mailingaddressXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='mailingaddresstype'){rslt=new MailingAddressType(this.mailingaddressXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setAddressType:function(aMailingAddressType){var alsNd=null;this.AddressType=aMailingAddressType;for(i=0;i<this.mailingaddressXML.childNodes.length;i++)
if(this.mailingaddressXML.childNodes[i].nodeName.toLowerCase()=='addresstype'){alsNd=this.mailingaddressXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('addresstype');this.mailingaddressXML.appendChild(alsNd);}
alsNd.appendChild(aMailingAddressType.mailingaddresstypeXML);}});var EmailType=Class.create({emailtypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='emailtype')
this.emailtypeXML=inputXML;else{this.emailtypeXML=document.createElement('emailtype');}},getValue:function(){return unescape(this.emailtypeXML.getAttribute('value'));},setValue:function(val){this.emailtypeXML.setAttribute('value',escape(val));this.Value=val;}});if(!window.EmailType)
window.EmailType=Class.create();EmailType.values={PrimaryEmail:"Primary",HomeEmail:"Home",WorkEmail:"Work",OtherEmail:"Other"};var EmailAddress=Class.create({emailaddressXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='emailaddress')
this.emailaddressXML=inputXML;else{this.emailaddressXML=document.createElement('emailaddress');this.id=-1;this.emailaddressXML.setAttribute('emailaddressid',-1);}},getID:function(){return this.emailaddressXML.getAttribute('emailaddressid');},setID:function(val){this.emailaddressXML.setAttribute('emailaddressid',val);this.EmailAddressID=val;},getAddressType:function(){var rslt=null;for(i=0;i<this.emailaddressXML.childNodes.length;i++)
if(this.emailaddressXML.childNodes[i].nodeName.toLowerCase()=='addresstype'){for(j=0;j<this.emailaddressXML.childNodes[i].childNodes.length;j++)
if(this.emailaddressXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='emailtype'){rslt=new EmailType(this.emailaddressXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setAddressType:function(aEmailType){var alsNd=null;this.AddressType=aEmailType;for(i=0;i<this.emailaddressXML.childNodes.length;i++)
if(this.emailaddressXML.childNodes[i].nodeName.toLowerCase()=='addresstype'){alsNd=this.emailaddressXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('addresstype');this.emailaddressXML.appendChild(alsNd);}
alsNd.appendChild(aEmailType.emailtypeXML);},getAddress:function(){return unescape(this.emailaddressXML.getAttribute('address'));},setAddress:function(val){this.emailaddressXML.setAttribute('address',escape(val));this.Address=val;}});var RoleType=Class.create({roletypeXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='roletype')
this.roletypeXML=inputXML;else{this.roletypeXML=document.createElement('roletype');}},getValue:function(){return unescape(this.roletypeXML.getAttribute('value'));},setValue:function(val){this.roletypeXML.setAttribute('value',escape(val));this.Value=val;}});var Role=Class.create({roleXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='role')
this.roleXML=inputXML;else{this.roleXML=document.createElement('role');this.id=-1;this.roleXML.setAttribute('roleid',-1);}},getID:function(){return this.roleXML.getAttribute('roleid');},setID:function(val){this.roleXML.setAttribute('roleid',val);this.RoleID=val;},getDescription:function(){return unescape(this.roleXML.getAttribute('description'));},setDescription:function(val){this.roleXML.setAttribute('description',escape(val));this.Description=val;},getName:function(){return unescape(this.roleXML.getAttribute('name'));},setName:function(val){this.roleXML.setAttribute('name',escape(val));this.Name=val;},getAccount:function(){var rslt=null;for(i=0;i<this.roleXML.childNodes.length;i++)
if(this.roleXML.childNodes[i].nodeName.toLowerCase()=='account'){for(j=0;j<this.roleXML.childNodes[i].childNodes.length;j++)
if(this.roleXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='account'){rslt=new Account(this.roleXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setAccount:function(aAccount){var alsNd=null;this.Account=aAccount;for(i=0;i<this.roleXML.childNodes.length;i++)
if(this.roleXML.childNodes[i].nodeName.toLowerCase()=='account'){alsNd=this.roleXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('account');this.roleXML.appendChild(alsNd);}
alsNd.appendChild(aAccount.accountXML);this.setAccountID(aAccount.accountXML.getAttribute('accountid'));this.AccountID=aAccount.AccountID;},getAccountID:function(){return this.roleXML.getAttribute('accountid');},setAccountID:function(aAccountID){this.roleXML.setAttribute('accountid',aAccountID);this.AccountID=aAccountID},getType:function(){var rslt=null;for(i=0;i<this.roleXML.childNodes.length;i++)
if(this.roleXML.childNodes[i].nodeName.toLowerCase()=='type'){for(j=0;j<this.roleXML.childNodes[i].childNodes.length;j++)
if(this.roleXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='roletype'){rslt=new RoleType(this.roleXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setType:function(aRoleType){var alsNd=null;this.Type=aRoleType;for(i=0;i<this.roleXML.childNodes.length;i++)
if(this.roleXML.childNodes[i].nodeName.toLowerCase()=='type'){alsNd=this.roleXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('type');this.roleXML.appendChild(alsNd);}
alsNd.appendChild(aRoleType.roletypeXML);}});var LoginRetrievalQuestion=Class.create({loginretrievalquestionXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='loginretrievalquestion')
this.loginretrievalquestionXML=inputXML;else{this.loginretrievalquestionXML=document.createElement('loginretrievalquestion');this.id=-1;this.loginretrievalquestionXML.setAttribute('loginretrievalquestionid',-1);this.loginretrievalquestionXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.loginretrievalquestionXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.loginretrievalquestionXML.getAttribute('loginretrievalquestionid');},setID:function(val){this.loginretrievalquestionXML.setAttribute('loginretrievalquestionid',val);this.LoginRetrievalQuestionID=val;},getCreateAt:function(){return this.loginretrievalquestionXML.getAttribute('createdat');},getLastModified:function(){return this.loginretrievalquestionXML.getAttribute('lastmodified');},getAnswer:function(){return unescape(this.loginretrievalquestionXML.getAttribute('answer'));},setAnswer:function(val){this.loginretrievalquestionXML.setAttribute('answer',escape(val));this.Answer=val;},getQuestion:function(){return unescape(this.loginretrievalquestionXML.getAttribute('question'));},setQuestion:function(val){this.loginretrievalquestionXML.setAttribute('question',escape(val));this.Question=val;}});if(!window.LoginRetrievalQuestion)
window.LoginRetrievalQuestion=Class.create();LoginRetrievalQuestion.values=new Array
({value:'Mother\'s birthplace:',display:'Mother\'s birthplace'},{value:'Best childhood friend:',display:'Best childhood friend'},{value:'Name of first pet:',display:'Name of first pet'},{value:'Favorite teacher:',display:'Favorite teacher'},{value:'Favorite historical person:',display:'Favorite historical person'},{value:'Grandfather\'s occupation:',display:'Grandfather\'s occupation'});var Login=Class.create({loginXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='login')
this.loginXML=inputXML;else{this.loginXML=document.createElement('login');this.id=-1;this.loginXML.setAttribute('loginid',-1);this.loginXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.loginXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.loginXML.getAttribute('loginid');},setID:function(val){this.loginXML.setAttribute('loginid',val);this.LoginID=val;},getCreateAt:function(){return this.loginXML.getAttribute('createdat');},getLastModified:function(){return this.loginXML.getAttribute('lastmodified');},getLoginAttempt:function(){return unescape(this.loginXML.getAttribute('loginattempt'));},setLoginAttempt:function(val){this.loginXML.setAttribute('loginattempt',escape(val));this.LoginAttempt=val;},getLastLoginAttempt:function(){return unescape(this.loginXML.getAttribute('lastloginattempt'));},setLastLoginAttempt:function(val){this.loginXML.setAttribute('lastloginattempt',escape(val));this.LastLoginAttempt=val;},getPasswordExpiry:function(){return unescape(this.loginXML.getAttribute('passwordexpiry'));},setPasswordExpiry:function(val){this.loginXML.setAttribute('passwordexpiry',escape(val));this.PasswordExpiry=val;},getConfirmationCode:function(){return unescape(this.loginXML.getAttribute('confirmationcode'));},setConfirmationCode:function(val){this.loginXML.setAttribute('confirmationcode',escape(val));this.ConfirmationCode=val;},getLoginRetrieval:function(){var rslt=null;for(i=0;i<this.loginXML.childNodes.length;i++)
if(this.loginXML.childNodes[i].nodeName.toLowerCase()=='loginretrieval'){for(j=0;j<this.loginXML.childNodes[i].childNodes.length;j++)
if(this.loginXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='loginretrievalquestion'){rslt=new LoginRetrievalQuestion(this.loginXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setLoginRetrieval:function(aLoginRetrievalQuestion){var alsNd=null;this.LoginRetrieval=aLoginRetrievalQuestion;for(i=0;i<this.loginXML.childNodes.length;i++)
if(this.loginXML.childNodes[i].nodeName.toLowerCase()=='loginretrieval'){alsNd=this.loginXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('loginretrieval');this.loginXML.appendChild(alsNd);}
alsNd.appendChild(aLoginRetrievalQuestion.loginretrievalquestionXML);this.setLoginRetrievalID(aLoginRetrievalQuestion.loginretrievalquestionXML.getAttribute('loginretrievalquestionid'));this.LoginRetrievalID=aLoginRetrievalQuestion.LoginRetrievalQuestionID;},getLoginRetrievalID:function(){return this.loginXML.getAttribute('loginretrievalid');},setLoginRetrievalID:function(aLoginRetrievalQuestionID){this.loginXML.setAttribute('loginretrievalid',aLoginRetrievalQuestionID);this.LoginRetrievalID=aLoginRetrievalQuestionID},getRoles:function(){var ret=new Array();for(i=0;i<this.loginXML.childNodes.length;i++)
if(this.loginXML.childNodes[i].nodeName.toLowerCase()=='roles'){var ourNode=this.loginXML.childNodes[i];for(j=0;j<ourNode.childNodes.length;j++)
if(ourNode.childNodes[j].nodeName.toLowerCase()=='role')
ret.push(new Role(ourNode.childNodes[j]));break;}
return ret;},setRoles:function(roleList){roleList=Utl.toArray(roleList);this.Roles=roleList;var alsNd=null;for(i=0;i<this.loginXML.childNodes.length;i++)
if(this.loginXML.childNodes[i].nodeName.toLowerCase()=='roles'){alsNd=this.loginXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('roles');this.loginXML.appendChild(alsNd);}
for(i=0;i<roleList.length;i++)
alsNd.appendChild(roleList[i].roleXML);},getPasswordHash:function(){return unescape(this.loginXML.getAttribute('passwordhash'));},setPasswordHash:function(val){this.loginXML.setAttribute('passwordhash',escape(val));this.PasswordHash=val;},getLoginName:function(){return unescape(this.loginXML.getAttribute('loginname'));},setLoginName:function(val){this.loginXML.setAttribute('loginname',escape(val));this.LoginName=val;}});var AuditPriority=Class.create({auditpriorityXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='auditpriority')
this.auditpriorityXML=inputXML;else{this.auditpriorityXML=document.createElement('auditpriority');}},getValue:function(){return unescape(this.auditpriorityXML.getAttribute('value'));},setValue:function(val){this.auditpriorityXML.setAttribute('value',escape(val));this.Value=val;}});var AuditEntry=Class.create({auditentryXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='auditentry')
this.auditentryXML=inputXML;else{this.auditentryXML=document.createElement('auditentry');this.id=-1;this.auditentryXML.setAttribute('auditentryid',-1);this.auditentryXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.auditentryXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.auditentryXML.getAttribute('auditentryid');},setID:function(val){this.auditentryXML.setAttribute('auditentryid',val);this.AuditEntryID=val;},getCreateAt:function(){return this.auditentryXML.getAttribute('createdat');},getLastModified:function(){return this.auditentryXML.getAttribute('lastmodified');},getContext:function(){var rslt=null;for(i=0;i<this.auditentryXML.childNodes.length;i++)
if(this.auditentryXML.childNodes[i].nodeName.toLowerCase()=='context'){for(j=0;j<this.auditentryXML.childNodes[i].childNodes.length;j++)
if(this.auditentryXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='auditcontext'){rslt=new AuditContext(this.auditentryXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setContext:function(aAuditContext){var alsNd=null;this.Context=aAuditContext;for(i=0;i<this.auditentryXML.childNodes.length;i++)
if(this.auditentryXML.childNodes[i].nodeName.toLowerCase()=='context'){alsNd=this.auditentryXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('context');this.auditentryXML.appendChild(alsNd);}
alsNd.appendChild(aAuditContext.auditcontextXML);this.setContextID(aAuditContext.auditcontextXML.getAttribute('auditcontextid'));this.ContextID=aAuditContext.AuditContextID;},getContextID:function(){return this.auditentryXML.getAttribute('contextid');},setContextID:function(aAuditContextID){this.auditentryXML.setAttribute('contextid',aAuditContextID);this.ContextID=aAuditContextID},getMessage:function(){return unescape(this.auditentryXML.getAttribute('message'));},setMessage:function(val){this.auditentryXML.setAttribute('message',escape(val));this.Message=val;},getPriority:function(){var rslt=null;for(i=0;i<this.auditentryXML.childNodes.length;i++)
if(this.auditentryXML.childNodes[i].nodeName.toLowerCase()=='priority'){for(j=0;j<this.auditentryXML.childNodes[i].childNodes.length;j++)
if(this.auditentryXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='auditpriority'){rslt=new AuditPriority(this.auditentryXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setPriority:function(aAuditPriority){var alsNd=null;this.Priority=aAuditPriority;for(i=0;i<this.auditentryXML.childNodes.length;i++)
if(this.auditentryXML.childNodes[i].nodeName.toLowerCase()=='priority'){alsNd=this.auditentryXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('priority');this.auditentryXML.appendChild(alsNd);}
alsNd.appendChild(aAuditPriority.auditpriorityXML);},getLineNumber:function(){return unescape(this.auditentryXML.getAttribute('linenumber'));},setLineNumber:function(val){this.auditentryXML.setAttribute('linenumber',escape(val));this.LineNumber=val;},getCodeFilePath:function(){return unescape(this.auditentryXML.getAttribute('codefilepath'));},setCodeFilePath:function(val){this.auditentryXML.setAttribute('codefilepath',escape(val));this.CodeFilePath=val;},getMethod:function(){return unescape(this.auditentryXML.getAttribute('method'));},setMethod:function(val){this.auditentryXML.setAttribute('method',escape(val));this.Method=val;},getClassName:function(){return unescape(this.auditentryXML.getAttribute('classname'));},setClassName:function(val){this.auditentryXML.setAttribute('classname',escape(val));this.ClassName=val;},getNamespace:function(){return unescape(this.auditentryXML.getAttribute('namespace'));},setNamespace:function(val){this.auditentryXML.setAttribute('namespace',escape(val));this.Namespace=val;},getParentAudit:function(){var rslt=null;for(i=0;i<this.auditentryXML.childNodes.length;i++)
if(this.auditentryXML.childNodes[i].nodeName.toLowerCase()=='parentaudit'){for(j=0;j<this.auditentryXML.childNodes[i].childNodes.length;j++)
if(this.auditentryXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='audit'){rslt=new Audit(this.auditentryXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setParentAudit:function(aAudit){var alsNd=null;this.ParentAudit=aAudit;for(i=0;i<this.auditentryXML.childNodes.length;i++)
if(this.auditentryXML.childNodes[i].nodeName.toLowerCase()=='parentaudit'){alsNd=this.auditentryXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('parentaudit');this.auditentryXML.appendChild(alsNd);}
alsNd.appendChild(aAudit.auditXML);this.setParentAuditID(aAudit.auditXML.getAttribute('auditid'));this.ParentAuditID=aAudit.AuditID;},getParentAuditID:function(){return this.auditentryXML.getAttribute('parentauditid');},setParentAuditID:function(aAuditID){this.auditentryXML.setAttribute('parentauditid',aAuditID);this.ParentAuditID=aAuditID}});var AuditContext=Class.create({auditcontextXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='auditcontext')
this.auditcontextXML=inputXML;else{this.auditcontextXML=document.createElement('auditcontext');this.id=-1;this.auditcontextXML.setAttribute('auditcontextid',-1);}},getID:function(){return this.auditcontextXML.getAttribute('auditcontextid');},setID:function(val){this.auditcontextXML.setAttribute('auditcontextid',val);this.AuditContextID=val;},getContextData:function(){return unescape(this.auditcontextXML.getAttribute('contextdata'));},setContextData:function(val){this.auditcontextXML.setAttribute('contextdata',escape(val));this.ContextData=val;}});var Audit=Class.create({auditXML:null,initialize:function(inputXML){if(inputXML&&inputXML.nodeName.toLowerCase()=='audit')
this.auditXML=inputXML;else{this.auditXML=document.createElement('audit');this.id=-1;this.auditXML.setAttribute('auditid',-1);this.auditXML.setAttribute('createdat',Utl.toSafeDateTimeString(new Date()));this.auditXML.setAttribute('lastmodified',Utl.toSafeDateTimeString(new Date()));}},getID:function(){return this.auditXML.getAttribute('auditid');},setID:function(val){this.auditXML.setAttribute('auditid',val);this.AuditID=val;},getCreateAt:function(){return this.auditXML.getAttribute('createdat');},getLastModified:function(){return this.auditXML.getAttribute('lastmodified');},getAppKey:function(){return unescape(this.auditXML.getAttribute('appkey'));},setAppKey:function(val){this.auditXML.setAttribute('appkey',escape(val));this.AppKey=val;},getEventCount:function(){return unescape(this.auditXML.getAttribute('eventcount'));},setEventCount:function(val){this.auditXML.setAttribute('eventcount',escape(val));this.EventCount=val;},getServerName:function(){return unescape(this.auditXML.getAttribute('servername'));},setServerName:function(val){this.auditXML.setAttribute('servername',escape(val));this.ServerName=val;},getTaskMessage:function(){return unescape(this.auditXML.getAttribute('taskmessage'));},setTaskMessage:function(val){this.auditXML.setAttribute('taskmessage',escape(val));this.TaskMessage=val;},getPriority:function(){var rslt=null;for(i=0;i<this.auditXML.childNodes.length;i++)
if(this.auditXML.childNodes[i].nodeName.toLowerCase()=='priority'){for(j=0;j<this.auditXML.childNodes[i].childNodes.length;j++)
if(this.auditXML.childNodes[i].childNodes[j].nodeName.toLowerCase()=='auditpriority'){rslt=new AuditPriority(this.auditXML.childNodes[i].childNodes[j]);break;}}
return rslt;},setPriority:function(aAuditPriority){var alsNd=null;this.Priority=aAuditPriority;for(i=0;i<this.auditXML.childNodes.length;i++)
if(this.auditXML.childNodes[i].nodeName.toLowerCase()=='priority'){alsNd=this.auditXML.childNodes[i];while(alsNd.childNodes.length>0)
alsNd.removeChild(alsNd.childNodes[0]);break;}
if(alsNd==null){alsNd=document.createElement('priority');this.auditXML.appendChild(alsNd);}
alsNd.appendChild(aAuditPriority.auditpriorityXML);},getThreadID:function(){return unescape(this.auditXML.getAttribute('threadid'));},setThreadID:function(val){this.auditXML.setAttribute('threadid',escape(val));this.ThreadID=val;},getAuthName:function(){return unescape(this.auditXML.getAttribute('authname'));},setAuthName:function(val){this.auditXML.setAttribute('authname',escape(val));this.AuthName=val;},getAuthID:function(){return unescape(this.auditXML.getAttribute('authid'));},setAuthID:function(val){this.auditXML.setAttribute('authid',escape(val));this.AuthID=val;},getRequestingIP:function(){return unescape(this.auditXML.getAttribute('requestingip'));},setRequestingIP:function(val){this.auditXML.setAttribute('requestingip',escape(val));this.RequestingIP=val;}});Neighbourhood.LoadCityScapeNeighbourhoods=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/thirdparty/cityscape.asmx/loadCityScapeNeighbourhoods',{validationNodeName:'Neighbourhood',evalJSON:true,onSuccess:callback});}
Development.addMethods({save:function(notify,callback)
{if(!notify)
notify='false';Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/saveDevelopment',{postBody:'notify='+notify+'&xml='+Utl.convertXmlToString(this.developmentXML),onSuccess:callback,evalJSON:true,method:'post'});}});Development.LoadDevelopment=function(developmentID,callback,updateSearchResultsCookie)
{if(!updateSearchResultsCookie)
updateSearchResultsCookie='false';Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getDevelopmentFullJSON?developmentID='+developmentID+'&updateSearchCookie='+updateSearchResultsCookie,{evalJSON:true,onSuccess:callback});}
Development.LoadFeaturedDevelopmentsAsList=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getDevelopmentsFeaturedLightJSON',{onSuccess:callback,validationNodeName:'featureddevelopments',evalJSON:true});}
Development.LoadLightDevelopmentsAsList=function(csvDevelopmentIds,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getDevelopmentsLightJSON',{postBody:'developmentIDs='+csvDevelopmentIds,onSuccess:callback,method:'post',evalJSON:true,validationNodeName:'developments'});}
Development.LoadDevelopmentsByAccount=function(accountIDs,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getDevelopmentListByAccount',{postBody:'accountIDs='+accountIDs,onSuccess:callback,method:'post',evalJSON:true,validationNodeName:'developments'});}
Development.LoadLightDevelopmentsByAccount=function(accountIDs,callback,cachable)
{cachable=cachable||false;Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getLightDevelopmentListByAccount?accountIDs='+accountIDs+'&cachable='+cachable,{onSuccess:callback,method:'get',evalJSON:true,validationNodeName:'developments'});}
Development.LoadDevelopmentIDsAndNames=function(productkey,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getDevelopmentIDsAndNamesJSON?productkey='+productkey,{method:'get',evalJSON:true,validationNodeName:'developments',onSuccess:callback});}
Development.LoadMarkerInfo=function(marker,objectIDs,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getDevelopmentMarkerInfo?developmentIDs='+objectIDs,{evalJSON:true,onSuccess:function(response){callback(marker,response);}});}
Development.LoadMarkerInfoByProperty=function(marker,objectIDs,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getMarkerInfoByProperty?propertyIDs='+objectIDs,{evalJSON:true,onSuccess:function(response){callback(marker,response);}});}
Development.IsSold=function(development)
{if(!development)return false;if(development.priceoverride!=undefined)
return development.priceoverride.toLowerCase().indexOf('sold')>=0||development.tags.find(function(n){return n.value.toLowerCase()=='sold';})!=null;if(development.PriceOverride!=undefined)
return development.PriceOverride.toLowerCase().indexOf('sold')>=0||development.Tags.find(function(n){return n.Value.toLowerCase()=='sold';})!=null;return false;}
Development.LoadLightDevelopmentsWithAuctionablePropertiesByAccount=function(accountIDs,callback,cachable)
{cachable=cachable||false;Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getLightDevelopmentsWithAuctionablePropertiesByAccount?accountIDs='+accountIDs+'&cachable='+cachable,{onSuccess:callback,method:'get',evalJSON:true,validationNodeName:'developments'});}
Development.LoadLightDevelopmentsWithPropertiesByPropertyIDs=function(propertyIDs,callback,cachable)
{cachable=cachable||false;Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getLightDevelopmentsWithPropertiesByPropertyIDs?propertyIDs='+propertyIDs+'&cachable='+cachable,{onSuccess:callback,method:'get',evalJSON:true,validationNodeName:'developments'});}
FeaturedDevelopment.LoadFeaturedDevelopmentIDs=function(productkey,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getFeatureDevelopmentIDsJSON?productkey='+productkey,{method:'get',evalJSON:true,validationNodeName:'featureddevelopmentIds',onSuccess:callback});}
FeaturedDevelopment.SaveFeatureIDs=function(productkey,idsAsCSV,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/saveFeatureDevelopmentIDs?idsAsCSV='+idsAsCSV+'&productkey='+productkey,{method:'get',evalJSON:true,onSuccess:callback});}
Property.LoadPropertiesByDevelopment=function(developmentID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/assets.asmx/getPropertiesByDevelopment?developmentID='+developmentID,{method:'get',evalJSON:true,validationNodeName:'properties',onSuccess:callback});}
UserProfile.Authenticate=function(username,password,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/Auth.asmx/Authenticate',{postBody:'userName='+username+'&password='+password,method:'post',evalJSON:true,onSuccess:callback});}
UserProfile.AuthenticateConfirmation=function(username,confirmationCode,extraParams,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/Auth.asmx/AuthenticateConfirmation',{postBody:'loginName='+username+'&confirmationCode='+confirmationCode+extraParams,method:'post',evalJSON:true,onSuccess:callback});}
UserProfile.SendNewPassword=function(loginName,secretAnswer,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/Auth.asmx/sendNewPassword?loginName='+loginName+'&passwordRetrievalAnswer='+secretAnswer,{method:'get',onSuccess:callback,evalJSON:true});}
UserProfile.ResendConfirmation=function(loginName,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/Auth.asmx/resendConfirmation',{postBody:'loginName='+loginName,method:'post',evalJSON:true,onSuccess:callback});}
UserProfile.Unauthenticate=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/Auth.asmx/Unauthenticate',{method:'post',onSuccess:callback});}
UserProfile.GetSecretQuestion=function(loginName,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/Auth.asmx/RetrieveSecretQuestion?loginName='+loginName,{method:'get',onSuccess:callback,evalJSON:true});}
UserProfile.ChangePassword=function(loginName,oldPassword,newPassword,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/Auth.asmx/ChangePassword',{postBody:'loginName='+loginName+'&oldPassword='+oldPassword+'&newPassword='+newPassword,method:'post',evalJSON:true,onSuccess:callback});}
AuctionItem.LoadByItemID=function(itemID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadAuctionItemByItemId?itemID='+itemID,{onSuccess:callback,method:'get',evalJSON:true});}
AuctionItem.PlaceBid=function(auctionItemID,bid,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/PlaceBid',{postBody:'auctionItemID='+auctionItemID
+'&bidXml='+Utl.convertXmlToString(bid.bidXML),onSuccess:callback,method:'post',evalJSON:true});}
AuctionItem.PlaceBids=function(bidder,broker,items,auctionID,callback)
{var itemsXML=new StringBuilder();itemsXML.append('<_auctionitems>');for(var i=0;i<items.length;i++)
itemsXML.append(Utl.convertXmlToString(items[i].auctionitemXML));itemsXML.append('</_auctionitems>');Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/PlaceBids',{postBody:'bidderXML='+Utl.convertXmlToString(bidder.userprofileXML)+'&brokerXml='+(broker?Utl.convertXmlToString(broker.userprofileXML):'')+'&itemsXml='+itemsXML+'&auctionID='+auctionID,onSuccess:callback,method:'post',evalJSON:true});}
AuctionItem.GetTopBid=function(ai)
{if(!ai||!ai.Bids)return;var topBid=null;ai.Bids.each(function(bid){if(topBid==null||parseInt(topBid.Amount)<parseInt(bid.Amount))
topBid=bid;});return topBid;}
AuctionItem.GetTopBidAmount=function(ai)
{var amount=0;var bid=AuctionItem.GetTopBid(ai);if(bid)
amount=bid.Amount;return amount;}
AuctionItem.GetMinimumNextBid=function(ai)
{var amount=AuctionItem.GetTopBidAmount(ai)
if(parseInt(ai.InitialPrice)>parseInt(amount))
return ai.InitialPrice;return(parseInt(amount)+parseInt(ai.BidIncrement));}
Auction.LoadAuctionsAsList=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadAuctionsAsList',{onSuccess:callback,method:'get',evalJSON:true,validationNodeName:'auctions'});}
Auction.LoadAuctionsByAccount=function(accountIDs,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadAuctionsAsListByOwner',{postBody:'accountIDs='+accountIDs,onSuccess:callback,method:'post',evalJSON:true,validationNodeName:'auctions'});}
Auction.LoadAuction=function(auctionID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadAuctionById?auctionID='+auctionID,{onSuccess:callback,method:'get',evalJSON:true});}
Auction.LoadMyAuction=function(auctionID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadMyAuctionById?auctionID='+auctionID,{onSuccess:callback,method:'get',evalJSON:true});}
Auction.LoadByItemID=function(itemID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadAuctionByItemId?itemID='+itemID,{onSuccess:callback,method:'get',evalJSON:true});}
Auction.LoadByAuctionItemID=function(auctionItemID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadAuctionByAuctionItemId?auctionItemID='+auctionItemID,{onSuccess:callback,method:'get',evalJSON:true});}
Auction.LoadMyAuctionsAsList=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadMyAuctionsAsList',{onSuccess:callback,method:'get',evalJSON:true,validationNodeName:'auctions'});}
Auction.LoadAuctionDevelopmentsAsList=function(auctionID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/getDevelopmentListByAuction?auctionID='+auctionID,{onSuccess:callback,method:'get',evalJSON:true,validationNodeName:'developments'});}
Auction.RegisterProfile=function(auctionID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/RegisterForAuction?auctionID='+auctionID,{onSuccess:callback,method:'get',evalJSON:true});}
Auction.addMethods({save:function(notify,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/saveAuction',{postBody:'notify='+notify+'&xml='+Utl.convertXmlToString(this.auctionXML),onSuccess:callback,evalJSON:true,method:'post'});}});Auction.containsItemID=function(auction,itemID)
{return Auction.getAuctionItemByItemID(auction,itemID)!=null;}
Auction.getAuctionItemByItemID=function(auction,itemID)
{if(!auction||!auction.AuctionItems||!itemID)return null;for(var i=0;i<auction.AuctionItems.length;i++)
if(auction.AuctionItems[i].itemid==itemID)
return auction.AuctionItems[i];return null;}
Auction.AuctionStatus={Upcoming:'Upcoming',Current:'Current',Past:'Past'};Auction.getAuctionStatus=function(anAuction,offset)
{offset=offset||0;if(new Date(anAuction.EndDate)<new Date().addTime(0,0,0,offset))
return Auction.AuctionStatus.Past;if(new Date(anAuction.StartDate)>new Date().addTime(0,0,0,offset))
return Auction.AuctionStatus.Upcoming;return Auction.AuctionStatus.Current;};Auction.GetCurrentAuctions=function(auctions)
{var now=new Date();var currAuctions=new Array();for(var i=0;i<auctions.length;i++)
if(auctions[i].IsEnabled&&new Date(auctions[i].StartDate).daysElapsed(now)<=0&&new Date(auctions[i].EndDate).daysElapsed(now)>-1)
currAuctions.push(auctions[i]);return currAuctions;};Auction.GetUpcomingAuctions=function(auctions)
{var now=new Date();var upAuctions=new Array();for(var i=0;i<auctions.length;i++)
if(auctions[i].IsEnabled&&new Date(auctions[i].StartDate).daysElapsed(now)>0&&new Date(auctions[i].EndDate).daysElapsed(now)>-1)
upAuctions.push(auctions[i]);return upAuctions;};Auction.GetPastAuctions=function(auctions)
{var now=new Date();var pastAuctions=new Array();for(var i=0;i<auctions.length;i++)
if(auctions[i].IsEnabled&&now.daysElapsed(new Date(auctions[i].EndDate))>-1)
pastAuctions.push(auctions[i]);return pastAuctions;};CartProduct.LoadProductsByIDs=function(productIDs,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadProductsByIDs?productIDs='+productIDs,{onSuccess:callback,method:'get',evalJSON:true});};CartOrder.Checkout=function(user,creditCardName,creditCardNumber,expMonth,expYear,csc,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/CartCheckout',{postBody:'userXML='+Utl.convertXmlToString(user.userprofileXML)+'&creditCardName='+creditCardName+'&creditCardNumber='+creditCardNumber+'&expMonth='+expMonth+'&expYear='+expYear+'&csc='+csc,onSuccess:callback,method:'post',evalJSON:true});};CartOrder.LoadsUserOrders=function(profileID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/financial.asmx/LoadUserOrders?profileID='+profileID,{onSuccess:callback,method:'get',evalJSON:true});};UserProfile.LoginNames_AutoComplete_Path='/webservices/cmaeon/realestate/profile.asmx/getAutoCompleteLoginNames';UserProfile.addMethods({createNew:function(source,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/createNewProfile',{postBody:'source='+source+'&userProfileXML='+Utl.convertXmlToString(this.userprofileXML),onSuccess:callback,method:'post',evalJSON:true});},createNewListing:function(dev,source,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/createNewListing',{postBody:'source='+source+'&userProfileXML='+Utl.convertXmlToString(this.userprofileXML)+'&developmentXML='+Utl.convertXmlToString(dev.developmentXML),onSuccess:callback,method:'post',evalJSON:true});},save:function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/saveUserProfile',{postBody:'xml='+Utl.convertXmlToString(this.userprofileXML),onSuccess:callback,method:'post',evalJSON:true});},sendInfoRequest:function(questionXML,devID,message,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/sendInfoRequest',{onSuccess:callback,postBody:'userProfileXML='+Utl.convertXmlToString(this.userprofileXML)+'&questionXML='+Utl.convertXmlToString(questionXML)+'&message='+message+'&devid='+devID,method:'post',evalJSON:true});}});UserProfile.LoadProfile=function(userprofileid,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/getUserProfileXML?loginId='+userprofileid,{onSuccess:callback});}
UserProfile.LoadProfileJSON=function(loginId,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/getUserProfileJSON?loginId='+loginId,{onSuccess:callback,evalJSON:true,validationNodeName:'json'});}
UserProfile.LoadProfileByLoginNameJSON_=function(loginName,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/getUserProfileJSON_?loginName='+loginName,{onSuccess:function(up)
{Object.extend(up,UserProfile.prototype);callback(up);},evalJSON:true,validationNodeName:'json'});}
UserProfile.LoadFavoritesAsList=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/getFavoriteDevelopmentsImageJSON',{onSuccess:callback,validationNodeName:'developments',evalJSON:true});}
UserProfile.SecureProfile=function(securityToken,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/secureUserProfile?securityToken='+securityToken,{onSuccess:callback,evalJSON:true});}
UserProfile.AddFavoriteDevelopment=function(developmentid)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/addFavoriteDevelopment?developmentID='+developmentid,{});}
UserProfile.RemoveFavoriteDevelopment=function(developmentid)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/removeFavoriteDevelopment?developmentID='+developmentid,{});}
UserProfile.LoadSavedSearches=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/getSavedSearchesJSON',{evalJSON:true,onSuccess:callback,validationNodeName:'searches'});}
UserProfile.AddFavoriteSearch=function(searchQueryID,queryName)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/addFavoriteSearch?queryID='+searchQueryID+'&queryName='+queryName,{});}
UserProfile.RemoveFavoriteSearch=function(searchQueryID)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/removeFavoriteSearch?queryID='+searchQueryID,{});}
UserProfile.LoadWatchlistSearches=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/getWatchlistSearchesJSON',{evalJSON:true,onSuccess:callback,validationNodeName:'searches'});}
UserProfile.AddWatchlistSearch=function(searchQueryID)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/addWatchlistSearch?queryID='+searchQueryID,{});}
UserProfile.RemoveWatchlistSearch=function(searchQueryID)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/removeWatchlistSearch?queryID='+searchQueryID,{});}
UserProfile.GetProfileAttributes=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/getProfileAttributesJSON',{evalJSON:true,onSuccess:callback,validationNodeName:'attributes'});}
UserProfile.LoadMessageHeaders=function(pageNumber,pageSize,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/profile.asmx/getMessageHeadersJSON?pageSize='+pageSize+'&pageNumber='+pageNumber,{onSuccess:callback,validationNodeName:'headers',evalJSON:true});}
UserProfile.GetURLForMessageBodyAsHTML=function(notificationauditid,folder)
{return Utl.getAppNamePrefixedURL('/webservices/cmaeon/realestate/profile.asmx/getMessageBodyHTML?naid='+notificationauditid);}
SearchQuery.LoadInputOptions=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/search.asmx/getSearchInputOptionsJSON',{validationNodeName:'searchcategories',evalJSON:true,onSuccess:callback});}
SearchQuery.LoadSearchResults=function(searchQuery,sortParam,pageNumber,pageSize,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/search.asmx/getDevelopmentsBySearchLightJSON',{postBody:'searchQueryXML='+Utl.convertXmlToString(searchQuery.searchqueryXML)+'&sort='+sortParam+'&pageNum='+pageNumber+'&pageSize='+pageSize+'&returnJSONType=0',method:'post',evalJSON:true,onSuccess:callback});}
SearchQuery.LoadPointSearchResults=function(searchQuery,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/search.asmx/getDevelopmentsBySearchLightJSON',{postBody:'searchQueryXML='+Utl.convertXmlToString(searchQuery.searchqueryXML)+'&sort=default DESC&pageNum=1&pageSize=1000&returnJSONType=2',method:'post',evalJSON:true,onSuccess:callback});}
SearchQuery.GetFullResultsAsIDList=function(searchQuery,sortParam,callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/search.asmx/getDevelopmentIDsBySearchJSON',{postBody:'searchQueryXML='+Utl.convertXmlToString(searchQuery.searchqueryXML)+'&sort='+sortParam,method:'post',evalJSON:true,onSuccess:callback});}
RealestateTag.AutoComplete_Path='/webservices/cmaeon/realestate/tags.asmx/getAutoCompleteTags';RealestateTag.LoadPropertyTypes=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/tags.asmx/getTagsAsListJSON?type=PropertyType',{validationNodeName:'PropertyType',evalJSON:true,onSuccess:callback});}
RealestateTag.LoadNeighbourhoods=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/realestate/tags.asmx/getTagsAsListJSON?type=Neighbourhood',{validationNodeName:'Neighbourhood',evalJSON:true,onSuccess:callback});}
BlogComment.LoadCommentsByThreadJSON_=function(threadID,callback)
{Utl.runAjaxCall('/webservices/blogger.asmx/LoadCommentsByThreadJSON_?threadID='+threadID,{method:'get',onSuccess:function(comments)
{if(comments)
for(var i=0;i<comments.length;i++)
comments[i]=Object.extend(comments[i],BlogComment.prototype);else
comments=[];callback(comments);},evalJSON:true});};BlogComment.PostComment=function(comment,callback)
{Utl.runAjaxCall('/webservices/blogger.asmx/PostComment',{method:'post',postBody:'jsonComment='+escape(Object.toJSON(comment)),onSuccess:function(response){if(response.comments)
for(var i=0;i<response.comments.length;i++)
response.comments[i]=Object.extend(response.comments[i],BlogComment.prototype);callback(response);},evalJSON:true});};BlogComment.EditComment=function(comment,callback)
{Utl.runAjaxCall('/webservices/blogger.asmx/EditComment',{method:'post',postBody:'jsonComment='+escape(Object.toJSON(comment)),onSuccess:function(response){if(response.comment)
response.comment=Object.extend(response.comment,BlogComment.prototype);callback(response);},evalJSON:true});};BlogComment.DeleteComment=function(commentID,callback)
{Utl.runAjaxCall('/webservices/blogger.asmx/DeleteComment',{method:'post',postBody:'commentID='+commentID,onSuccess:function(response)
{if(response.comments)
for(var i=0;i<response.comments.length;i++)
response.comments[i]=Object.extend(response.comments[i],BlogComment.prototype);else
response.comments=[];callback(response);},evalJSON:true});};BlogComment.RateComment=function(commentID,modUp,callback)
{Utl.runAjaxCall('/webservices/blogger.asmx/RateComment',{method:'post',postBody:'commentID='+commentID+'&modUp='+modUp,onSuccess:function(response){if(response.comment)
response.comment=Object.extend(response.comment,BlogComment.prototype);callback(response);},evalJSON:true});};window.FileServer_ImagePath='/webservices/cmaeon/modules/fileserver.asmx/getImage?imagePath=';window.FileServer_FilePath='/webservices/cmaeon/modules/fileserver.asmx/getFile?filePath=';var FileManager={LoadFilesInFolderAsList:function(folder,ignorecache,callback)
{var url='/webservices/cmaeon/modules/fileserver.asmx/getFilesInFolderAsList?folder='+folder+'&v='+Math.random();if(ignorecache==true)
{var date=new Date();url+='&nugget='+date.getHours()+date.getMinutes()+date.getSeconds()+date.getMilliseconds();}
Utl.runAjaxCall(url,{evalJSON:true,validationNodeName:'filelist',onSuccess:callback});},LoadFilesInFolderAsList_:function(folder,callback)
{Utl.runAjaxCall(FileServer_FilePath+folder+'.js?v='+Math.random(),{evalJSON:true,validationNodeName:'filelist',onSuccess:callback});},DeleteFile:function(folder,filename,callback)
{Utl.runAjaxCall('/webservices/cmaeon/modules/fileserver.asmx/deleteFile?folder='+folder+'&filename='+filename,{evalJSON:true,onSuccess:callback});},SortFileListByTag:function(fileList)
{var sortOrderPrefix='SORT_ORDER_';fileList.sort(function(a,b)
{if(!a.tags.length<1||!b.tags.length<1){return 0;}
a=a.tags.find(function(tag){return tag.tagvalue.indexOf(sortOrderPrefix)==0;});b=b.tags.find(function(tag){return tag.tagvalue.indexOf(sortOrderPrefix)==0;});if(!a||!b){return 0;}
a=a.tagvalue.replace(sortOrderPrefix,'')*1;b=b.tagvalue.replace(sortOrderPrefix,'')*1;if(a<b){return-1;}
if(a>b){return 1;}
return 0;});},CropThumbs:function(imagePath,bounds,callback)
{Utl.runAjaxCall('/webservices/cmaeon/modules/fileserver.asmx/cropThumb'+'?filePath='+imagePath+'&x1='+bounds.x1+'&y1='+bounds.y1+'&x2='+bounds.x2+'&y2='+bounds.y2,{evalJSON:true,onSuccess:callback});}}
Account.LoadAccountByID=function(accountid,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/accounts.asmx/getAccountByID?accountid='+accountid,{evalJSON:true,onSuccess:callback});}
Account.LoadMyAccounts=function(roleTypeFilter,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/accounts.asmx/getMyAccountsAsListJSON?roleTypeFilter='+roleTypeFilter,{validationNodeName:'accounts',evalJSON:true,onSuccess:callback});}
Account.LoadNotifications=function(accountid,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/accounts.asmx/getAccountNoticationsByAccountID?accountid='+accountid,{validationNodeName:'notifications',evalJSON:true,onSuccess:callback});}
Account.LoadRoleLogins=function(accountid,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/accounts.asmx/getAccountLoginsByAccountID?accountid='+accountid,{validationNodeName:'logins',evalJSON:true,onSuccess:callback});}
Account.LoadRoles=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/accounts.asmx/getRolesForAssignment',{evalJSON:true,onSuccess:callback});}
Account.SaveAccountInfo=function(account,notifications,callback)
{var notificationsXML=document.createElement('notifications');for(var i=0;i<notifications.length;i++)
notificationsXML.appendChild(notifications[i].accountnotificationXML);Utl.runAjaxCall('/webservices/cmaeon/common/accounts.asmx/saveAccountInfo',{evalJSON:true,postBody:'accountXML='+Utl.convertXmlToString(account.accountXML)+'&notificationsXML='+Utl.convertXmlToString(notificationsXML),onSuccess:callback,method:'post'});}
Login.Authenticate=function(username,password,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/Auth.asmx/Authenticate',{postBody:'userName='+username+'&password='+password,method:'post',evalJSON:true,onSuccess:callback});}
Login.Unauthenticate=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/Auth.asmx/Unauthenticate',{method:'post',onSuccess:callback});}
Login.GetSecretQuestion=function(loginName,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/Auth.asmx/RetrieveSecretQuestion?loginName='+loginName,{method:'get',onSuccess:callback,evalJSON:true});}
Login.ChangePassword=function(loginName,oldPassword,newPassword,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/Auth.asmx/ChangePassword',{postBody:'loginName='+loginName+'&oldPassword='+oldPassword+'&newPassword='+newPassword,method:'post',evalJSON:true,onSuccess:callback});}
Country.LoadCountries=function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/location.asmx/getCountriesJSON',{onSuccess:callback,validationNodeName:'countries',evalJSON:true});}
Country.addMethods({save:function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/location.asmx/saveCountry',{postBody:'xml='+Utl.convertXmlToString(this.countryXML),onSuccess:callback,evalJSON:true,method:'post'});}});StateProvince.LoadStateProvincesByCountry=function(countryID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/location.asmx/getStateProvincesByCountryJSON?countryID='+countryID,{validationNodeName:'stateprovs',evalJSON:true,onSuccess:callback});}
StateProvince.LoadStateProvincesByCountryName=function(countryName,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/location.asmx/getStateProvincesByCountryNameJSON?countryName='+countryName,{validationNodeName:'stateprovs',evalJSON:true,onSuccess:callback});}
City.LoadCitiesByStateProv=function(spID,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/location.asmx/getCitiesByStateProvinceJSON?stateprovID='+spID,{validationNodeName:'cities',evalJSON:true,onSuccess:callback});}
City.LoadCitiesByStateProvName=function(spName,countryName,callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/location.asmx/getCitiesByStateProvinceNameJSON?stateprovName='+spName+"&countryName="+countryName,{validationNodeName:'cities',evalJSON:true,onSuccess:callback});}
var Utilities={GetServerTimeJSON:function(callback)
{Utl.runAjaxCall('/webservices/cmaeon/common/utilities.asmx/GetServerTimeJSON',{validationNodeName:'time',evalJSON:true,onSuccess:callback});},GetPairWithKey:function(list,key)
{for(var i=0;i<list.length;i++)
if(list[i].pairkey==key)
return list[i];}};if(!window.Formatter){Formatter={};}
Formatter.formatAuction=function(anAuction,templateid,appendObj,hide,updateTemplate)
{var i=0;var attributesDiv;if(!updateTemplate)
{ourInstance=Utl.getInstanceOfTemplate(templateid,true,hide);}
else
{ourInstance=$(templateid);}
if(ourInstance===null){return $(document.createElement('div'));}
if(!anAuction||!anAuction.id)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_auction_title','');attributesDiv=ourInstance.select('.dyn_auction_attributes');if(attributesDiv.length>0)
{Utl.clearAllChildren(attributesDiv[0]);}
return;}
if(appendObj)
{ourInstance.auction=anAuction;}
ourInstance.addClassName(anAuction.TagName);UtilPop.setFieldsByClassName(ourInstance,'dyn_auction_title',anAuction.Name);ourInstance.select('.dyn_auction_description').each(function(item){item.innerHTML=anAuction.Summary;});ourInstance.select('.dyn_auction_legalinfo').each(function(item){item.innerHTML=anAuction.LegalInfo.OverviewHTML;});ourInstance.select('.dyn_auc_link').each(function(link){link.href='/auction/'+anAuction.id;});var dateRange=new Date(anAuction.StartDate).ToReadableDateString();if(new Date(anAuction.StartDate).ToReadableDateString()!=new Date(anAuction.EndDate).ToReadableDateString())
{dateRange=new Date(anAuction.StartDate).ToReadableDateString()+' - '+new Date(anAuction.EndDate).ToReadableDateString();}
UtilPop.setFieldsByClassName(ourInstance,'dyn_auction_daterange',dateRange);if(anAuction.Note)
{ourInstance.select('.dyn_auc_thumb').each(function(ele){ele.src=FileServer_ImagePath+'thumbs/auc/'+anAuction.id+'/images/'+imgUtl.forceForwardSlash(anAuction.Note);ele.show();});ourInstance.select('.dyn_auc_largethumb').each(function(ele){ele.src=FileServer_ImagePath+'large_thumbs/auc/'+anAuction.id+'/images/'+imgUtl.forceForwardSlash(anAuction.Note);ele.show();});ourInstance.select('.dyn_auc_image').each(function(ele){ele.src=FileServer_ImagePath+'auc/'+anAuction.id+'/images/'+imgUtl.forceForwardSlash(anAuction.Note);ele.show();});}
if(ourInstance.select('.dyn_auc_time_remaining').length>0)
{var setTimeRemaining=function(pe)
{if(Auction.getAuctionStatus(anAuction,fwk.SERVER_TIME_DIFF)==Auction.AuctionStatus.Past)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_auc_time_remaining','Auction Closed: '+new Date(anAuction.EndDate).formatDate('MMM d h:mm a'));if(pe){pe.stop();}}
else if(Auction.getAuctionStatus(anAuction,fwk.SERVER_TIME_DIFF)==Auction.AuctionStatus.Upcoming)
{if(Auction.getAuctionStatus(new Date(anAuction.StartDate).addTime(15*24),fwk.SERVER_TIME_DIFF)!=Auction.AuctionStatus.Upcoming)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_auc_time_remaining','Opens: '+new Date(anAuction.StartDate).formatDate('MMM ddd h:mm a')+'; Closes: '+new Date(anAuction.EndDate).formatDate('MMM ddd h:mm a'));if(pe){pe.stop();}}
else
{UtilPop.setFieldsByClassName(ourInstance,'dyn_auc_time_remaining','Opens: '+new Date(anAuction.StartDate).timeElapsedFormatted(new Date().addTime(0,0,0,fwk.SERVER_TIME_DIFF)));}}
else
{if(Auction.getAuctionStatus(new Date(anAuction.EndDate).addTime(15*24),fwk.SERVER_TIME_DIFF)==Auction.AuctionStatus.Current)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_auc_time_remaining','Closes: '+new Date(anAuction.EndDate).formatDate('MMM d h:mm a'));if(pe){pe.stop();}}
else
{UtilPop.setFieldsByClassName(ourInstance,'dyn_auc_time_remaining','Closes: '+new Date(anAuction.EndDate).timeElapsedFormatted(new Date().addTime(0,0,0,fwk.SERVER_TIME_DIFF)));}}};setTimeRemaining();var pe=new PeriodicalExecuter(setTimeRemaining,1);}
ourInstance.select('.dyn_emailtofriend_auction').each(function(emailtofriendLink)
{Event.observe(emailtofriendLink,'click',function(event)
{event.stop();TemplatedDialogue.Show_EmailToFriend(anAuction,'Auction');});});if(anAuction.AuctionItems.length>0)
{UtilPop.observeLinksByClassName(ourInstance,'dyn_auction_properties',null,function(link){Event.observe(link,'click',function(args){SearchInput.performSingleKeywordSearch(anAuction.TagName,'list');});});UtilPop.setVisibleByClassName(ourInstance,'dyn_auction_properties',true);UtilPop.observeLinksByClassName(ourInstance,'dyn_auction_openhouses',null,function(link){Event.observe(link,'click',function(args){SearchInput.performSingleKeywordSearch(anAuction.TagName+',Open House','list');});});UtilPop.setVisibleByClassName(ourInstance,'dyn_auction_openhouses',true);}
else
{UtilPop.setVisibleByClassName(ourInstance,'dyn_coming_soon',true);}
attributesDiv=ourInstance.select('.dyn_auction_attributes');if(attributesDiv.length>0)
{attributesDiv=attributesDiv[0];Utl.clearAllChildren(attributesDiv);if(anAuction.DisplayableAttributes.length===0)
{attributesDiv.hide();}
for(i=0;i<anAuction.DisplayableAttributes.length;i++)
{var key=anAuction.DisplayableAttributes[i].PairKey;var val=anAuction.DisplayableAttributes[i].PairValue;if(key.toLowerCase().indexOf("mainimage")>=0)
{continue;}
var attr_p=$(document.createElement('li'));var attr_title=$(document.createElement('span'));var attr_value=$(document.createElement('span'));attr_p.appendChild(attr_title);attr_p.appendChild(attr_value);attributesDiv.appendChild(attr_p);attr_p.addClassName('attr_wrap');attr_title.addClassName('attr_title');if(key.indexOf('html_')===0)
{UtilPop.setFieldInnerHTML(attr_title,key.substr(5));}
else
{UtilPop.setFieldInnerHTML(attr_title,key);}
attr_value.addClassName('attr_value');if(key.indexOf('html_')===0)
{attr_value.innerHTML=val;}
else
{UtilPop.setFieldInnerHTML(attr_value,val);}}}
FileMan.loadAuctionFiles(anAuction.id,ourInstance);return ourInstance;};Formatter.formatAuctionItemBids=function(arrBids,wrapper)
{wrapper=$(wrapper);if(!wrapper){return;}
Utl.clearAllChildren(wrapper);for(var i=arrBids.length-1;i>=0;i--)
{var bid=arrBids[i];var itemInstance=Utl.getInstanceOfTemplate('template_auction_bid_entry',true,false);UtilPop.setFieldsByClassName(itemInstance,'dyn_bidamount',Utl.formatCurrency(bid.Amount));UtilPop.setFieldsByClassName(itemInstance,'dyn_biddername_short',bid.BidderName);UtilPop.setFieldsByClassName(itemInstance,'dyn_createdat',new Date(bid.CreatedAt).toExtraLongDateTimeString());if(wrapper.childElements().length%2===0)
{itemInstance.addClassName('alt_row');}
wrapper.appendChild(itemInstance);}};Formatter.formatAuctionDevelopments=function(anAuction,wrapper)
{wrapper=$(wrapper);Utl.clearAllChildren(wrapper);aItems=anAuction.AuctionItems.sortBy(function(s)
{return s.Location.City.StateProv.Country.Name+' '+s.Location.City.StateProv.Name+' '+s.Location.City.CityName;});for(var i=0;i<aItems.length;i++)
{var itemInstance=Utl.getInstanceOfTemplate('template_item_auction',true,false);Formatter.formatAuctionItem(anAuction,aItems[i],itemInstance);if(i%2===0)
{itemInstance.addClassName('alt_row');}
wrapper.appendChild(itemInstance);}
return wrapper;};Formatter.formatAuctionItem=function(anAuction,anAuctionItem,itemInstance)
{if(!itemInstance){return;}
if(location.hash.indexOf('itemid='+anAuctionItem.id)>=0)
{itemInstance.addClassName('highlight');}
UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_name',anAuctionItem.Name);UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_id',anAuctionItem.id);UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_bid_count',anAuctionItem.Bids.length);UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_buyout_price',Utl.formatCurrency(anAuctionItem.BuyoutPrice));UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_deposit',anAuctionItem.DepositAmount?Utl.formatCurrency(anAuctionItem.DepositAmount):'N/A');UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_closing_date',new Date(anAuction.EndDate).toExtraLongDateTimeString());UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_current_bid',Utl.formatCurrency(AuctionItem.GetTopBidAmount(anAuctionItem)));UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_min_bid',Utl.formatCurrency(AuctionItem.GetMinimumNextBid(anAuctionItem)));UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_description',anAuctionItem.Description);UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_initial_price',Utl.formatCurrency(anAuctionItem.InitialPrice));UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_market_price',Utl.formatCurrency(anAuctionItem.MarketPrice));UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_prop_type',anAuctionItem.PropertyType?anAuctionItem.PropertyType.Value:'unspecified');UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_reserve_price',AuctionItem.GetTopBidAmount(anAuctionItem)>anAuctionItem.ReservePrice?'Met':'Not Met');UtilPop.setFieldsByClassName(itemInstance,'dyn_auc_item_shortlocation',anAuctionItem.Location.City.CityName+', '+anAuctionItem.Location.City.StateProv.Name+', '+anAuctionItem.Location.City.StateProv.Country.Name);itemInstance.select('.dyn_auc_deposit_help').each(function(item){item.observe('click',function(event){event.stop();Dlg.Show('What is a bid deposit?','A bid deposit is must be received by the seller prior to any bids being accepted or posted online.');});});Formatter.bindAuctionItemLinks(itemInstance,anAuction,anAuctionItem);itemInstance.select('.dyn_emailtofriend_auctionitem').each(function(emailtofriendLink)
{Event.observe(emailtofriendLink,'click',function(event)
{event.stop();TemplatedDialogue.Show_EmailToFriend(anAuctionItem,'AuctionItem');});});itemInstance.select('.dyn_auc_item_image').each(function(item)
{item.src=FileServer_ImagePath+imgUtl.forceForwardSlash(anAuctionItem.Thumb.ImagePath);item.alt=anAuctionItem.Name;item.title=anAuctionItem.Name;});itemInstance.select('.dyn_auc_item_image_thumb').each(function(item)
{item.src=FileServer_ImagePath+'large_thumbs/'+imgUtl.forceForwardSlash(anAuctionItem.Thumb.ImagePath);item.alt=anAuctionItem.Name;item.title=anAuctionItem.Name;});itemInstance.select('.dyn_auc_item_image_link').each(function(item)
{item.rel='lightbox[auc_images]';item.href=FileServer_ImagePath+imgUtl.forceForwardSlash(anAuctionItem.Thumb.ImagePath);item.title=anAuctionItem.Name;});return itemInstance;};Formatter.bindAuctionItemLinks=function(itemInstance,anAuction,anAuctionItem)
{itemInstance.select('.dyn_auc_item_link').each(function(link)
{var linkLocation='/auction/'+anAuction.id+'/'+anAuctionItem.id;if(link.className.indexOf('requestinfo')>=0)
{linkLocation+='#requestinfo';}
Event.observe(link,'click',function(event)
{event.stop();if(Identity.GetLoginID()===null)
{TemplatedDialogue.Show_Restricted('AUCTION_REGISTER',null,function(){window.location=linkLocation;});}
else
{window.location=linkLocation;}});});};if(!window.Formatter){Formatter={};}
Formatter.formatCartOrder=function(order,templateID,orderItemTemplateID,appendObj,hide,updateTemplate)
{var ourInstance;if(!updateTemplate)
{ourInstance=Utl.getInstanceOfTemplate(templateID,true,hide);}
else
{ourInstance=$(templateID);}
if(ourInstance===null)
{return $(document.createElement('div'));}
if(appendObj)
{ourInstance.cartOrder=order;}
UtilPop.setFieldsByClassName(ourInstance,'dyn_order_date',order.CreatedAt.toShortDateTimeString());var orderItemsWrapper=ourInstance.select('.order_item_wrapper');if(orderItemsWrapper.length<1)
{return;}
orderItemsWrapper=orderItemsWrapper[0];for(var i=0;i<order.OrderItems.length;i++)
{orderItemsWrapper.appendChild(Formatter.formatCartOrderItem(order.OrderItems[i],orderItemTemplateID,true,hide,false));}
return ourInstance;};Formatter.formatCartOrderItem=function(orderItem,templateid,appendObj,hide,updateTemplate)
{var ourInstance;if(!updateTemplate)
{ourInstance=Utl.getInstanceOfTemplate(templateid,true,hide);}
else
{ourInstance=$(templateid);}
if(ourInstance===null)
{return $(document.createElement('div'));}
if(appendObj)
{ourInstance.cartOrderItem=orderItem;}
var updateItem=function(productID)
{var item=CartMan.GetItemByProductID(productID);var price=item.PurchasePrice||item.Product.Price-item.Product.Discount;UtilPop.setFieldsByClassName(ourInstance,'dyn_order_item_quantity',item.Quantity);UtilPop.setFieldsByClassName(ourInstance,'dyn_order_item_total',item.ProductID?Utl.formatCurrency(price*item.Quantity,true):0);if(item.Quantity>0)
{ourInstance.select('.dyn_order_item_quantity_toggle').each(function(ele){ele.addClassName('remove_item');ele.removeClassName('add_item');});ourInstance.select('.checkout').each(Element.show);if(item.ProductID==3)
{ourInstance.select('.checkout').each(function(ele){ele.href='/sell/';});}}
else
{ourInstance.select('.dyn_order_item_quantity_toggle').each(function(ele){ele.addClassName('add_item');ele.removeClassName('remove_item');});ourInstance.select('.checkout').each(Element.hide);}
return item;};if(orderItem.Product.Discount)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_order_item_price',Utl.formatCurrency(orderItem.Product.Price,true));UtilPop.setFieldsByClassName(ourInstance,'dyn_order_item_discount',Utl.formatCurrency(orderItem.Product.Discount,true));}
else
{ourInstance.select('.dyn_order_item_discount_section').each(Element.hide);}
if(orderItem.Product.MaxInCart==1)
{ourInstance.select('.quantity_section').each(Element.hide);}
ourInstance.select('.dyn_order_item_product_link').each(function(link){link.href='/product/'+orderItem.ProductID;});UtilPop.setFieldsByClassName(ourInstance,'dyn_order_item_name',orderItem.Product.Name);UtilPop.setFieldsByClassName(ourInstance,'dyn_order_item_purchase_price',Utl.formatCurrency(orderItem.PurchasePrice,true));UtilPop.setFieldsByClassName(ourInstance,'dyn_order_item_final_price',Utl.formatCurrency(orderItem.Product.Price-orderItem.Product.Discount,true));UtilPop.setFieldsByClassName(ourInstance,'dyn_order_item_summary',orderItem.Product.Summary);if(orderItem.Product.Description)
{ourInstance.select('.dyn_order_item_description').each(function(ele){ele.update(orderItem.Product.Description.Value);});}
updateItem(orderItem.ProductID);ourInstance.select('.dyn_order_item_quantity_toggle').each(function(button)
{button.observe('click',function(event)
{var item=CartMan.GetItemByProductID(orderItem.ProductID);if(!item||item.Quantity===0)
{CartMan.AddItem(item.ProductID);}
else
{CartMan.RemoveItem(item.ProductID,true);}
updateItem(orderItem.ProductID);});});ourInstance.select('.dyn_order_item_quantity_increase').each(function(button)
{button.observe('click',function(event)
{CartMan.AddItem(orderItem.ProductID);updateItem(orderItem.ProductID);});});ourInstance.select('.dyn_order_item_quantity_decrease').each(function(button)
{button.observe('click',function(event)
{CartMan.RemoveItem(orderItem.ProductID);updateItem(orderItem.ProductID);if(ourInstance.className.indexOf('removable')>0)
{ourInstance.remove();}});});ourInstance.select('.dyn_order_item_remove').each(function(button)
{button.observe('click',function(event)
{var item=CartMan.GetItemByProductID(orderItem.ProductID)||orderItem;CartMan.RemoveItem(item.ProductID,true);ourInstance.remove();CartMan.CheckForEmptyCart();});});ourInstance.select('.dyn_order_item_image').each(function(item)
{item.src=FileServer_ImagePath+imgUtl.forceForwardSlash(orderItem.Product.MainImage);item.alt=orderItem.Product.Name;item.title=orderItem.Product.Name;});ourInstance.select('.dyn_order_item_thumb').each(function(item)
{item.src=FileServer_ImagePath+'thumbs/'+imgUtl.forceForwardSlash(orderItem.Product.MainImage);item.alt=orderItem.Product.Name;item.title=orderItem.Product.Name;});ourInstance.select('.dyn_order_item_thumb_large').each(function(item)
{item.src=FileServer_ImagePath+'large_thumbs/'+imgUtl.forceForwardSlash(orderItem.Product.MainImage);item.alt=orderItem.Product.Name;item.title=orderItem.Product.Name;});ourInstance.select('.dyn_order_item_image_link').each(function(item)
{item.rel='lightbox[order_item_images_'+orderItem.id+']';item.href=FileServer_ImagePath+imgUtl.forceForwardSlash(orderItem.Product.MainImage);});return ourInstance;};if(!window.Formatter){Formatter={};}
Formatter.formatContact=function(contact,templateid,appendObject,hide)
{var details=contact;if(!details)
{return;}
var ourInstance=$(templateid);if(ourInstance===null)
{return $(document.createElement('div'));}
var personalinfo=details.personalinfo[0];UtilPop.setFieldsByClassName(ourInstance,'register_email',details.emailaddresses[0].address);UtilPop.setFieldsByClassName(ourInstance,'register_first_name',personalinfo.firstname);UtilPop.setFieldsByClassName(ourInstance,'register_middle_name',personalinfo.middlename);UtilPop.setFieldsByClassName(ourInstance,'register_last_name',personalinfo.lastname);UtilPop.setFieldsByClassName(ourInstance,'register_gender',personalinfo.gender[0].value);var dbString='';if(personalinfo.dateofbirth)
{var db=new Date(personalinfo.dateofbirth);dbString=(db.getMonth()+1)+'/'+db.getDate()+'/'+db.getFullYear();}
UtilPop.setFieldsByClassName(ourInstance,'register_dateOfBirth',dbString);if(details.mailingaddresses.length>0)
{var fullAddress=details.mailingaddresses[0].userlocation.split('\n');UtilPop.setFieldsByClassName(ourInstance,'register_address1',fullAddress[0]);UtilPop.setFieldsByClassName(ourInstance,'register_city',fullAddress[1]);UtilPop.setFieldsByClassName(ourInstance,'register_province',fullAddress[2]);UtilPop.setFieldsByClassName(ourInstance,'register_country',fullAddress[3]);UtilPop.setFieldsByClassName(ourInstance,'register_zippostal',details.mailingaddresses[0].zippostal);var phoneNumbers=details.mailingaddresses[0].phonenumbers;for(var phnIdx=0;phnIdx<phoneNumbers.length;phnIdx++)
{if(phoneNumbers[phnIdx].numbertype[0].value=='PrimaryNumber')
{UtilPop.setFieldsByClassName(ourInstance,'register_primaryPhone',phoneNumbers[phnIdx].number);}
else if(phoneNumbers[phnIdx].numbertype[0].value=='OtherNumber')
{UtilPop.setFieldsByClassName(ourInstance,'register_secondaryPhone',phoneNumbers[phnIdx].number);}
else if(phoneNumbers[phnIdx].numbertype[0].value=='OfficeNumber')
{UtilPop.setFieldsByClassName(ourInstance,'register_officePhone',phoneNumbers[phnIdx].number);}
else if(phoneNumbers[phnIdx].numbertype[0].value=='Fax')
{UtilPop.setFieldsByClassName(ourInstance,'register_fax',phoneNumbers[phnIdx].number);}}}
else
{UtilPop.setFieldsByClassName(ourInstance,'register_address1','');UtilPop.setFieldsByClassName(ourInstance,'register_city','');UtilPop.setFieldsByClassName(ourInstance,'register_province','');UtilPop.setFieldsByClassName(ourInstance,'register_country','');UtilPop.setFieldsByClassName(ourInstance,'register_zippostal','');UtilPop.setFieldsByClassName(ourInstance,'register_primaryPhone','');UtilPop.setFieldsByClassName(ourInstance,'register_secondaryPhone','');UtilPop.setFieldsByClassName(ourInstance,'register_officePhone','');UtilPop.setFieldsByClassName(ourInstance,'register_fax','');}
for(var i=0;i<details.attributes.length;i++)
{if(details.attributes[i].attrkey.toLowerCase()=='brokernumber')
{UtilPop.setFieldsByClassName(ourInstance,'register_broker_number',details.attributes[i].attrvalue);}
else if(details.attributes[i].attrkey.toLowerCase()=='company')
{UtilPop.setFieldsByClassName(ourInstance,'register_company',details.attributes[i].attrvalue);}
else if(details.attributes[i].attrkey.toLowerCase()=='licensenumber')
{UtilPop.setFieldsByClassName(ourInstance,'register_license_number',details.attributes[i].attrvalue);}
else if(details.attributes[i].attrkey.toLowerCase()=='taxid')
{UtilPop.setFieldsByClassName(ourInstance,'register_tax_id',details.attributes[i].attrvalue);}}
return ourInstance;};if(!window.Formatter){Formatter={};}
Formatter.getDevelopmentLink=function(aDevelopment)
{if(!aDevelopment.location&&!aDevelopment.Location)
{return'/property/'+aDevelopment.developmentid;}
if(aDevelopment.developmentid)
{return'/'+aDevelopment.location[0].city[0].cityname.replace(/ /g,'-')+'-'+aDevelopment.location[0].city[0].stateprov[0].name.replace(/ /g,'-')+'-'+aDevelopment.name.replace(/ /g,'-')+'/property/'+aDevelopment.developmentid;}
else
{return'/'+aDevelopment.Location.City.CityName.replace(/ /g,'-')+'-'+aDevelopment.Location.City.StateProv.Name.replace(/ /g,'-')+'-'+aDevelopment.Name.replace(/ /g,'-')+'/property/'+aDevelopment.id;}};Formatter.bindContactDevLink=function(link,aDevelopment)
{var url=Formatter.getDevelopmentLink(aDevelopment);if(link.tagName=='A'||link.nodeName=='A')
{link.href=url;}
else
{Event.observe(link,'click',function(args){location.href=url;});}};Formatter.bindViewDevLink=function(link,aDevelopment)
{var url=Formatter.getDevelopmentLink(aDevelopment);if(link.tagName=='A'||link.nodeName=='A')
{link.href=url;}
else
{Event.observe(link,'click',function(args){location.href=url;});}};Formatter.showContactDevMessage=function(aDevelopment)
{if(!aDevelopment.developeraccount||aDevelopment.developeraccount.length===0)
{Dlg.Show('Cannot contact the developer!','The developer is not configured to recieve notifications');}
else
{var defaultSubject="Inquiring about: "+aDevelopment.name;TemplatedDialogue.Show_MessageCompose(aDevelopment.name,aDevelopment.developeraccount,defaultSubject);}};Formatter.format_development=function(aDevelopment,templateID,appendDevToInstance,hide,updateTemplate)
{var i=0;var ourInstance=null;if(!updateTemplate)
{ourInstance=Utl.getInstanceOfTemplate(templateID,true,hide);}
else
{ourInstance=$(templateID);}
if(ourInstance===null)
{return $(document.createElement('div'));}
if(appendDevToInstance)
{ourInstance.development=aDevelopment;}
var favoriteObj={};if(aDevelopment.presentationdata&&aDevelopment.presentationdata.length>0&&aDevelopment.presentationdata[0].summaryimage&&aDevelopment.presentationdata[0].summaryimage.length>0&&aDevelopment.presentationdata[0].summaryimage[0].imagepath)
{favoriteObj={developmentid:aDevelopment.developmentid,name:aDevelopment.name,imagepath:imgUtl.forceForwardSlash(aDevelopment.presentationdata[0].summaryimage[0].imagepath)};}
var location='';UtilPop.setFieldsByClassName(ourInstance,'dyn_added',aDevelopment.createdat.replace(/ .*/,''));UtilPop.setFieldsByClassName(ourInstance,'dyn_modified',aDevelopment.lastmodified.replace(/ .*/,''));UtilPop.setFieldsByClassName(ourInstance,'dyn_name',aDevelopment.name+location);UtilPop.setFieldsByClassName(ourInstance,'dyn_name_abbr',((aDevelopment.name_short&&aDevelopment.name_short.length>0)?aDevelopment.name_short:aDevelopment.name),aDevelopment.name);UtilPop.setFieldsByClassName(ourInstance,'dyn_price',Formatter.formatDevelopmentPrice(aDevelopment));UtilPop.setFieldsByClassName(ourInstance,'dyn_price_nooverride',Formatter.formatDevelopmentPrice(aDevelopment,true));if(aDevelopment.priceoverride)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_price_override',aDevelopment.priceoverride);}
else if(ourInstance.select('.dyn_price_override').length>0)
{ourInstance.select('.dyn_price_override')[0].up().hide();}
UtilPop.setFieldsByClassName(ourInstance,'dyn_id',Utl.padString(aDevelopment.developmentid,'0',6));UtilPop.setFieldsByClassName(ourInstance,'dyn_summary_text',aDevelopment.summary);if(window.ViewMan)
{ourInstance.select('.dyn_summary_text')[0].innerHTML+='<a onclick="ViewMan.tabManager.gotoTab(\'tabOverview\'); Effect.ScrollTo(ViewMan.tabManager.tabContainer);" class="dyn_moreinfo fakelink">(more)</a>';}
ourInstance.select('.dyn_link_view').each(function(link){link.href=Formatter.getDevelopmentLink(aDevelopment);});UtilPop.observeLinksByClassName(ourInstance,'dyn_link_dev',aDevelopment,Formatter.bindContactDevLink);ourInstance.select('.dyn_dev_apply').each(function(link)
{var url='/forms/1003.aspx?devID='+aDevelopment.id;switch(fwk.PROD_NAME)
{case'Overland Mortgage Corporation':url='https://overland.1to1real.com'+url;break;default:url='https://lenderkey.1to1real.com'+url;break;}
link.href=url;});ourInstance.select('.dyn_emailtofriend').each(function(emailtofriendLink)
{Event.observe(emailtofriendLink,'click',function(event)
{event.stop();TemplatedDialogue.Show_EmailToFriend(aDevelopment,'Development');});});UtilPop.observeLinksByClassName(ourInstance,'dyn_link_save',favoriteObj,FavMan.bindLink);if(aDevelopment.location&&aDevelopment.location.length>0)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_location',aDevelopment.location[0].address);UtilPop.setFieldsByClassName(ourInstance,'dyn_city',aDevelopment.location[0].city[0].cityname);UtilPop.setFieldsByClassName(ourInstance,'dyn_state',aDevelopment.location[0].city[0].stateprov[0].name);UtilPop.setFieldsByClassName(ourInstance,'dyn_country',aDevelopment.location[0].city[0].stateprov[0].country[0].name);}
var auctionLink=ourInstance.select('.dyn_link_auction');if(auctionLink.length>0&&AucMan.auctions&&AucMan.auctions.length>0)
{for(var aucIdx=0;aucIdx<AucMan.auctions.length;aucIdx++)
{if(Auction.containsItemID(AucMan.auctions[aucIdx],aDevelopment.developmentid))
{AucMan.bindAuctionLink(auctionLink[0],AucMan.auctions[aucIdx],aDevelopment);}}}
var externalURLLinks=ourInstance.select('.dyn_link_externalurl');externalURLLinks.each(function(externalURLLink)
{if(aDevelopment.externalweblink&&aDevelopment.externalweblink.length>0&&aDevelopment.externalweblink.indexOf('/')!==0&&aDevelopment.externalweblink.indexOf('realestock.com')<0)
{externalURLLink.show();var linkLocation='/external.aspx?link='+aDevelopment.externalweblink;if(fwk.PROD_KEY=='LHA')
{Event.observe(externalURLLink,'click',function(args)
{if(Identity.GetLoginID()===null)
{TemplatedDialogue.Show_Restricted('VIEW_EXTERNAL',favoriteObj.developmentid,function(){window.open(linkLocation,'external');});}
else
{window.open(linkLocation,'external');}});}
else
{externalURLLink.href=linkLocation;}}
else
{externalURLLink.hide();}});if(Development.IsSold(aDevelopment))
{ourInstance.select('.dyn_dev_sold').each(Element.show);}
else
{ourInstance.select('.dyn_dev_sold').each(Element.hide);}
if(Utl.filterEnumList(aDevelopment.tags,'value','Auction').length>0)
{ourInstance.select('.dyn_dev_auction').each(Element.show);}
else
{ourInstance.select('.dyn_dev_auction').each(Element.hide);}
if(Utl.filterEnumList(aDevelopment.tags,'value','Reserve below 50').length>0)
{ourInstance.select('.dyn_dev_reserve').each(Element.show);}
else
{ourInstance.select('.dyn_dev_reserve').each(Element.hide);}
if(Utl.filterEnumList(aDevelopment.tags,'value','Absolute Auction').length>0)
{ourInstance.select('.dyn_dev_sellingabsolute').each(Element.show);}
else
{ourInstance.select('.dyn_dev_sellingabsolute').each(Element.hide);}
if(aDevelopment.presentationdata&&aDevelopment.presentationdata[0]&&aDevelopment.presentationdata[0].summaryimage[0])
{ourInstance.select('.dyn_thumbnail').each(function(thumbnail)
{thumbnail.src=FileServer_ImagePath+'thumbs/'+imgUtl.forceForwardSlash(aDevelopment.presentationdata[0].summaryimage[0].imagepath);thumbnail.title=aDevelopment.presentationdata[0].summaryimage[0].tooltip;});ourInstance.select('.dyn_large_thumbnail').each(function(thumbnail)
{thumbnail.src=FileServer_ImagePath+'large_thumbs/'+imgUtl.forceForwardSlash(aDevelopment.presentationdata[0].summaryimage[0].imagepath);thumbnail.title=aDevelopment.presentationdata[0].summaryimage[0].tooltip;});}
ourInstance.select('.dyn_draggable').each(function(draggable)
{draggable.favoriteObj=favoriteObj;});var attributesDiv=ourInstance.select('.dyn_attributes');if(attributesDiv.length>0)
{if(Utl.filterEnumList(aDevelopment.displayableattributes,'pairkey','Property Type:').length===0)
{var pts=Utl.filterEnumList(aDevelopment.tags,'typeid',RealestateTagType.values.PropertyType);var ptString='N/A';if(pts.length>0)
{var propTypesValue=new StringBuilder();for(i=0;i<pts.length;i++)
{propTypesValue.append(pts[i].value);propTypesValue.append(', ');}
propTypesValue.popLast();ptString=propTypesValue.toString();var ptAttr={pairkey:'Property Type:',pairvalue:ptString};aDevelopment.displayableattributes.unshift(ptAttr);}}
if(aDevelopment.location&&aDevelopment.location.length>0)
{var locAttr={pairkey:'Location:',pairvalue:aDevelopment.location[0].address};aDevelopment.displayableattributes.unshift(locAttr);}
var columns=2;if(window.DAOverride)
{columns=window.DAOverride.columns;}
attributesDiv=attributesDiv[0];Utl.clearAllChildren(attributesDiv);if(aDevelopment.displayableattributes.length===0)
{attributesDiv.hide();}
var curRowCount=0;var curAttrCount=0;var currentRowWrapper=$(document.createElement('div'));for(i=0;i<aDevelopment.displayableattributes.length;i++)
{if(window.DAExcludes&&DAExcludes.find(function(n){return n==aDevelopment.displayableattributes[i].pairkey;}))
{continue;}
if(curAttrCount%columns===0)
{currentRowWrapper=$(document.createElement('div'));if(Utl.isEven(curRowCount))
{currentRowWrapper.addClassName('alt_row');}
currentRowWrapper.addClassName('attr_row clearfix');attributesDiv.appendChild(currentRowWrapper);curRowCount++;}
var attrWrapper=Formatter.createDAWrapper(aDevelopment.displayableattributes[i]);currentRowWrapper.appendChild(attrWrapper);curAttrCount++;}}
if(ourInstance.down('.dyn_attributes')&&ourInstance.down('.dyn_attributes').childElements().length===0)
{ourInstance.select('.dyn_link_details').each(Element.hide);}
return ourInstance;};Formatter.createDAWrapper=function(displayableAttribute)
{var attr_p=$(document.createElement('div'));var attr_title=$(document.createElement('span'));var attr_value=$(document.createElement('span'));attr_p.appendChild(attr_title);attr_p.appendChild(attr_value);attr_title.addClassName('attr_title');UtilPop.setFieldInnerHTML(attr_title,displayableAttribute.pairkey);if(window.ViewMan&&displayableAttribute.pairkey=='Location:'&&ViewMan.development&&ViewMan.development.location&&(ViewMan.development.location.latitude!==0||ViewMan.development.location.longitude!==0))
{attr_title.innerHTML+=' <a onclick="ViewMan.tabManager.gotoTab(\'tabLocation\');Effect.ScrollTo(ViewMan.tabManager.tabContainer);" class="dyn_viewmap fakelink">View map</a>';}
attr_value.addClassName('attr_value');displayableAttribute.pairvalue=Utl.trim(displayableAttribute.pairvalue);if(displayableAttribute.pairvalue.match(/^[A-Z0-9._%+\-]+@[A-Z0-9.\-]+\.[A-Z]{2,4}$/i))
{attr_value.innerHTML='<a href="mailto:'+displayableAttribute.pairvalue+'">'+displayableAttribute.pairvalue+'</a>';}
else if(displayableAttribute.pairkey=='Presented By:')
{attr_value.innerHTML=displayableAttribute.pairvalue;}
else
{UtilPop.setFieldInnerHTML(attr_value,displayableAttribute.pairvalue);}
attr_p.addClassName('attr_wrap');return attr_p;};Formatter.formatDevelopmentPrice=function(aDevelopment,noOverride)
{var priceString;if(fwk.PROD_KEY=='LA')
{if(!Development.IsSold(aDevelopment))
{priceString='Open for investment';}
else
{priceString='Fully subscribed';}}
else if(aDevelopment.priceoverride&&aDevelopment.priceoverride.length>0&&!noOverride)
{priceString=aDevelopment.priceoverride;}
else if(aDevelopment.minpricerange>1&&aDevelopment.maxpricerange>1)
{priceString=Utl.formatCurrency(aDevelopment.minpricerange)+' to '+Utl.formatCurrency(aDevelopment.maxpricerange);}
else if(aDevelopment.minpricerange>1)
{priceString='Starting from '+Utl.formatCurrency(aDevelopment.minpricerange);}
else if(aDevelopment.maxpricerange>1)
{priceString=Utl.formatCurrency(aDevelopment.maxpricerange);}
else
{priceString='Pricing Available Upon Request';}
return priceString;};Formatter.format_development_=function(aDevelopment,templateID,appendDevToInstance,hide,updateTemplate)
{var i=0;var ourInstance=null;if(!updateTemplate)
{ourInstance=Utl.getInstanceOfTemplate(templateID,true,hide);}
else
{ourInstance=$(templateID);}
if(ourInstance===null)
{return $(document.createElement('div'));}
if(appendDevToInstance)
{ourInstance.development=aDevelopment;}
var favoriteObj=null;if(aDevelopment.PresentationData&&aDevelopment.PresentationData.SummaryImage&&aDevelopment.PresentationData.SummaryImage.ImagePath)
{favoriteObj={developmentid:aDevelopment.id,name:aDevelopment.Name,imagepath:aDevelopment.PresentationData.SummaryImage.ImagePath};}
var location='';if(aDevelopment.CreatedAt)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_added',aDevelopment.CreatedAt.toShortString());}
if(aDevelopment.LastModified)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_modified',aDevelopment.LastModified.toShortString());}
UtilPop.setFieldsByClassName(ourInstance,'dyn_name',aDevelopment.Name+location);UtilPop.setFieldsByClassName(ourInstance,'dyn_name_abbr',aDevelopment.Name_Short,aDevelopment.Name);UtilPop.setFieldsByClassName(ourInstance,'dyn_price',Formatter.formatDevelopmentPrice_(aDevelopment));UtilPop.setFieldsByClassName(ourInstance,'dyn_price_nooverride',Formatter.formatDevelopmentPrice_(aDevelopment,true));UtilPop.setFieldsByClassName(ourInstance,'dyn_price_override',aDevelopment.PriceOverride);UtilPop.setFieldsByClassName(ourInstance,'dyn_id',Utl.padString(aDevelopment.id,'0',6));if(aDevelopment.Summary)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_summary_text',aDevelopment.Summary);}
if(window.ViewMan)
{ourInstance.select('.dyn_summary_text')[0].innerHTML+='<a onclick="ViewMan.tabManager.gotoTab(\'tabOverview\'); Effect.ScrollTo(ViewMan.tabManager.tabContainer);" class="dyn_moreinfo fakelink">(more)</a>';}
UtilPop.setLinksByClassName(ourInstance,'dyn_link_view',Formatter.getDevelopmentLink(aDevelopment));if(favoriteObj)
{UtilPop.observeLinksByClassName(ourInstance,'dyn_link_save',favoriteObj,FavMan.bindLink);}
UtilPop.observeLinksByClassName(ourInstance,'dyn_link_dev',aDevelopment,Formatter.bindContactDevLink);if(aDevelopment.Location)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_location',aDevelopment.Location.Address);UtilPop.setFieldsByClassName(ourInstance,'dyn_shortlocation',aDevelopment.Location.City.CityName+', '+aDevelopment.Location.City.StateProv.Name+', '+aDevelopment.Location.City.StateProv.Country.Name);}
ourInstance.select('.dyn_link_externalurl').each(function(externalURLLink)
{if(aDevelopment.ExternalWeblink&&aDevelopment.ExternalWeblink.length>0)
{externalURLLink.href='/external.aspx?link='+aDevelopment.ExternalWeblink;}
else
{externalURLLinks[i].hide();}});if(Utl.filterEnumList(aDevelopment.Tags,'value','Sold').length>0)
{ourInstance.select('.dyn_sold').each(function(tag)
{tag.show();});}
if(Utl.filterEnumList(aDevelopment.Tags,'value','Reserve below 50').length>0)
{ourInstance.select('.dyn_reserve').each(function(tag)
{tag.show();});}
if(Utl.filterEnumList(aDevelopment.Tags,'value','Absolute Auction').length>0)
{ourInstance.select('.dyn_sellingabsolute').each(function(tag)
{tag.show();});}
ourInstance.select('.dyn_thumbnail').each(function(thumbnail)
{if(aDevelopment.PresentationData&&aDevelopment.PresentationData.SummaryImage)
{thumbnail.src=FileServer_ImagePath+'thumbs/'+imgUtl.forceForwardSlash(aDevelopment.PresentationData.SummaryImage.ImagePath);thumbnail.title=aDevelopment.PresentationData.SummaryImage.Tooltip;}});ourInstance.select('.dyn_large_thumbnail').each(function(thumbnail)
{if(aDevelopment.PresentationData&&aDevelopment.PresentationData.SummaryImage)
{thumbnail.src=FileServer_ImagePath+'large_thumbs/'+imgUtl.forceForwardSlash(aDevelopment.PresentationData.SummaryImage.ImagePath);thumbnail.title=aDevelopment.PresentationData.SummaryImage.Tooltip;}});var draggable=ourInstance.down('.dyn_draggable');if(draggable)
{draggable=draggable;draggable.favoriteObj=favoriteObj;}
var attributesDiv=ourInstance.down('.dyn_attributes');if(attributesDiv)
{if(Utl.filterEnumList(aDevelopment.DisplayableAttributes,'pairkey','Property Type:').length===0)
{var pts=Utl.filterEnumList(aDevelopment.Tags,'typeid',RealestateTagType.values.PropertyType);var ptString='N/A';if(pts.length>0)
{var propTypesValue=new StringBuilder();for(i=0;i<pts.length;i++)
{propTypesValue.append(pts[i].value);propTypesValue.append(', ');}
propTypesValue.popLast();ptString=propTypesValue.toString();var ptAttr={pairkey:'Property Type:',pairvalue:ptString};aDevelopment.DisplayableAttributes.unshift(ptAttr);}}
if(fwk.PROD_KEY=='RS')
{var accts=Utl.filterEnumList(aDevelopment.Tags,'typeid',RealestateTagType.values.Account);var acctString='N/A';if(accts.length>0)
{var acctsValue=new StringBuilder();for(i=0;i<accts.length;i++)
{if(accts[i].value=='Not Available'||accts[i].value.indexOf('Cmaeon')>=0)
{continue;}
var pattern=' \\(\\d+\\)';var stringtomatch=accts[i].value;var re=new RegExp(pattern);var results=re.exec(stringtomatch);if(results&&results.length>0)
{acctsValue.append(UtilPop.escapeHTML(accts[i].value.substring(0,accts[i].value.length-results[0].length)));}
else
{acctsValue.append(UtilPop.escapeHTML(accts[i].value));}
acctsValue.append(' &amp; ');}
acctsValue.popLast();acctString=acctsValue.toString();}
var acctAttr={pairkey:'Presented By:',pairvalue:acctString};aDevelopment.DisplayableAttributes.unshift(acctAttr);}
if(aDevelopment.Location)
{var locAttr={pairkey:'Location:',pairvalue:aDevelopment.Location.Address};aDevelopment.DisplayableAttributes.unshift(locAttr);}
var columns=window.DAOverride?window.DAOverride:2;Utl.clearAllChildren(attributesDiv);if(aDevelopment.DisplayableAttributes.length===0)
{attributesDiv.hide();}
var curRowCount=0;var curAttrCount=0;var currentRowWrapper=$(document.createElement('div'));for(i=0;i<aDevelopment.DisplayableAttributes.length;i++)
{if(window.DAExcludes&&DAExcludes.find(function(n){return n==aDevelopment.DisplayableAttributes[i].pairkey;}))
{continue;}
if(curAttrCount%columns===0)
{currentRowWrapper=$(document.createElement('div'));if(Utl.isEven(curRowCount))
{currentRowWrapper.addClassName('alt_row');}
currentRowWrapper.addClassName('attr_row clearfix');attributesDiv.appendChild(currentRowWrapper);curRowCount++;}
var attrWrapper=Formatter.createDAWrapper_(aDevelopment.DisplayableAttributes[i]);currentRowWrapper.appendChild(attrWrapper);curAttrCount++;}}
if(ourInstance.down('.dyn_attributes')&&ourInstance.down('.dyn_attributes').childElements().length===0)
{ourInstance.select('.dyn_link_details').each(Element.hide);}
return ourInstance;};Formatter.createDAWrapper_=function(displayableAttribute)
{var attr_p=$(document.createElement('div'));var attr_title=$(document.createElement('span'));var attr_value=$(document.createElement('span'));attr_p.appendChild(attr_title);attr_p.appendChild(attr_value);attr_title.addClassName('attr_title');UtilPop.setFieldInnerHTML(attr_title,displayableAttribute.pairkey);if(window.ViewMan&&displayableAttribute.pairkey=='Location:'&&ViewMan.development&&ViewMan.development.location&&(ViewMan.development.location.latitude!==0||ViewMan.development.location.longitude!==0))
{attr_title.innerHTML+=' <a onclick="ViewMan.tabManager.gotoTab(\'tabLocation\'); Effect.ScrollTo(ViewMan.tabManager.tabContainer);" class="dyn_viewmap fakelink">View map</a>';}
attr_value.addClassName('attr_value');displayableAttribute.pairvalue=Utl.trim(displayableAttribute.pairvalue);if(displayableAttribute.pairvalue.match(/^[A-Z0-9._%+\-]+@[A-Z0-9.\-]+\.[A-Z]{2,4}$/i))
{attr_value.innerHTML='<a href="mailto:'+displayableAttribute.pairvalue+'">'+displayableAttribute.pairvalue+'</a>';}
else if(displayableAttribute.pairkey=='Presented By:')
{attr_value.innerHTML=displayableAttribute.pairvalue;}
else
{UtilPop.setFieldInnerHTML(attr_value,displayableAttribute.pairvalue);}
attr_p.addClassName('attr_wrap');return attr_p;};Formatter.formatDevelopmentPrice_=function(aDevelopment,noOverride)
{var priceString;if(fwk.PROD_KEY=='LA')
{if(!Development.IsSold(aDevelopment))
{priceString='Open for investment';}
else
{priceString='Fully subscribed';}}
else if(aDevelopment.PriceOverride&&aDevelopment.PriceOverride.length>0&&!noOverride)
{priceString=aDevelopment.PriceOverride;}
else if(aDevelopment.MinPriceRange>1&&aDevelopment.MaxPriceRange>1)
{priceString=Utl.formatCurrency(aDevelopment.MinPriceRange)+' to '+Utl.formatCurrency(aDevelopment.MaxPriceRange);}
else if(aDevelopment.MinPriceRange>1)
{priceString='Starting from '+Utl.formatCurrency(aDevelopment.MinPriceRange);}
else if(aDevelopment.MaxPriceRange>1)
{priceString=Utl.formatCurrency(aDevelopment.MaxPriceRange);}
else
{priceString='Pricing Available Upon Request';}
return priceString;};if(!window.Formatter){Formatter={};}
Formatter.formatnotificationAuditheader=function(auditHeader,templateid,appendHeader,hide)
{var ourInstance=Utl.getInstanceOfTemplate(templateid,true,hide);if(ourInstance===null)
{return $(document.createElement('div'));}
if(appendHeader)
{ourInstance.header=auditHeader;}
UtilPop.setFieldsByClassName(ourInstance,'dyn_subject',auditHeader.summary);UtilPop.setFieldsByClassName(ourInstance,'dyn_date',auditHeader.createdat);UtilPop.observeLinksByClassName(ourInstance,'dyn_select_message',auditHeader.notificationauditid,mypCommsMan.bindSelectMessageLink);return ourInstance;};Formatter.formatEmailheader=function(emailHeader,templateid,appendHeader,hide)
{var ourInstance=Utl.getInstanceOfTemplate(templateid,true,hide);if(ourInstance===null)
{return $(document.createElement('div'));}
if(appendHeader)
{ourInstance.header=emailHeader;}
if(emailHeader.mime_message[0].isnew=='true')
{ourInstance.addClassName("newMessage");}
var subjectLine=emailHeader.mime_message[0].subject;if(subjectLine.length>50)
{subjectLine=subjectLine.substring(0,50)+'...';}
UtilPop.setFieldsByClassName(ourInstance,'dyn_subject',subjectLine);UtilPop.setFieldsByClassName(ourInstance,'dyn_from',emailHeader.mime_message[0].from_name);UtilPop.setFieldsByClassName(ourInstance,'dyn_date',emailHeader.mime_message[0].receive_date);UtilPop.observeLinksByClassName(ourInstance,'dyn_select_message',emailHeader.mime_message[0].message_id,mypCommsMan.bindSelectMessageLink);return ourInstance;};if(!window.Formatter){Formatter={};}
Formatter.format_properties=function(wrapper,aProperties,templateID,appendPropToInstance,hide)
{var propertiesWrapper=wrapper.down('.dyn_properties_wrapper');if(!propertiesWrapper)
{return;}
if(!aProperties||aProperties.length<=0)
{propertiesWrapper.hide();return;}
else
{propertiesWrapper.show();}
Utl.clearAllChildren(propertiesWrapper);var matchedProperties=[];var enabledProperties=[];aProperties.each(function(aProperty)
{if(aProperty.isenabled=='True')
{enabledProperties.push(aProperty);}});var searchQuery=SearchInput.convertRawSearchQueryToJSON(SearchInput.readSearchQueryCookie());if(!searchQuery||fwk.PROD_KEY!='BM')
{matchedProperties=enabledProperties;}
else
{enabledProperties.each(function(aProperty)
{if(searchQuery.baths&&searchQuery.baths>aProperty.numberbathrooms){return;}
if(searchQuery.beds&&searchQuery.beds>aProperty.numberbedrooms){return;}
if(searchQuery.minP&&searchQuery.minP>aProperty.price){return;}
if(searchQuery.maxP&&searchQuery.maxP<aProperty.price){return;}
if(searchQuery.pt&&!searchQuery.pt.find(function(item){return aProperty.propertytypeid==item;})){return;}
if(searchQuery.view)
{var views=aProperty.generalattributes.find(function(item){return item.pairkey=='general_Views';});if(views&&!searchQuery.view.find(function(item){return views.pairvalue.toLowerCase().indexOf(item)>=0;}))
{return;}}
matchedProperties.push(aProperty);});}
UtilPop.setFieldsByClassName(wrapper,'dyn_properties_matched_count',matchedProperties.length);var i=0;var initPropNum=(fwk.PROD_KEY=='1AM'||fwk.PROD_KEY=='LK'||fwk.PROD_KEY=='OM'?50:5);var matchedCount=0;enabledProperties.each(function(aProperty)
{var newElement=Formatter.format_property(aProperty,templateID,appendPropToInstance,hide,false);if(matchedCount>=initPropNum)
{newElement.hide();newElement.addClassName('dyn_properties_overflow');}
if(matchedProperties.find(function(prop){return prop.propertyid==aProperty.propertyid;}))
{newElement.addClassName('prop_matched_search');matchedCount++;}
else
{newElement.addClassName('prop_not_matched_search');}
propertiesWrapper.appendChild(newElement);i++;});if(matchedCount>=initPropNum)
{var expandLink=$(document.createElement('div'));expandLink.innerHTML='show all units';expandLink.addClassName('expand_prop_link');expandLink.addClassName('fakelink');expandLink.observe('click',function(event)
{var element=Event.element(event);if(element.innerHTML=='show all units')
{element.innerHTML='show top units';propertiesWrapper.select('.dyn_properties_overflow').each(Element.show);}
else
{element.innerHTML='show all units';propertiesWrapper.select('.dyn_properties_overflow').each(Element.hide);}});propertiesWrapper.appendChild(expandLink);}
propertiesWrapper.propertiesAccordion=new Accordion(propertiesWrapper,{clickpane:'acc_prop_title',bodypane:'acc_prop_body',closable:true,multiple:true,openpane:'noshow',allowopencheck:function(ele)
{var _wrapper=ele.up('.dyn_property_wrapper');if(!_wrapper.daDataLoaded)
{Formatter.formatPropertyExtendedData(_wrapper,_wrapper.property);}
return true;}});return propertiesWrapper;};Formatter.format_property=function(aProperty,templateID,appendPropToInstance,hide,updateTemplate)
{var ourInstance=null;if(!updateTemplate)
{ourInstance=Utl.getInstanceOfTemplate(templateID,true,hide);}
else
{ourInstance=$(templateID);}
if(ourInstance===null)
{return $(document.createElement('div'));}
if(appendPropToInstance)
{ourInstance.property=aProperty;}
if(!aProperty)
{return ourInstance;}
UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_id',aProperty.id);UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_stories',aProperty.stories||aProperty.Stories,'N/A');UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_sqftunfinished',aProperty.sqftunfinished||aProperty.SqFtUnfinished,'N/A');UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_sqftfinished',aProperty.sqftfinished||aProperty.SqFtFinished,'N/A');UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_sqfttotal',aProperty.sqfttotal||aProperty.SqFtTotal,'N/A');UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_numberbathrooms',aProperty.numberbathrooms||aProperty.NumberBathrooms);UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_numberbedrooms',aProperty.numberbedrooms||aProperty.NumberBedrooms);UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_numberbedroomsbathrooms',(aProperty.numberbedrooms||aProperty.NumberBedrooms)+' / '+(aProperty.numberbathrooms||aProperty.numberbedrooms));UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_propertystatus',aProperty.propertystatus||aProperty.PropertyStatus);UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_propertytype',aProperty.propertytype?aProperty.propertytype[0].value:aProperty.PropertyType.Value);ourInstance.select('.dyn_prop_summarydescription').each(function(ele){ele.innerHTML=aProperty.summarydescription||aProperty.SummaryDescription;});UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_name',(aProperty.name||aProperty.Name||'').replace(' - Sold','').replace(' - Pending',''));UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_price',Formatter.formatPropertyPrice(aProperty));if((aProperty.name||aProperty.Name||'').toLowerCase().indexOf('sold')>=0||(aProperty.name||aProperty.Name||'').toLowerCase().indexOf('pending')>=0||(aProperty.propertystatus||aProperty.PropertyStatus||'').toLowerCase().indexOf('sold')>=0)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_price_nooverride','Sold!');}
else
{UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_price_nooverride',Formatter.formatPropertyPrice(aProperty,true));}
if(aProperty.priceoverride)
{UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_price_override',aProperty.priceoverride||aProperty.PriceOverride);}
else if(ourInstance.select('.dyn_prop_price_override').length>0)
{ourInstance.select('.dyn_prop_price_override')[0].next().hide();}
UtilPop.setFieldsByClassName(ourInstance,'dyn_prop_isrental',aProperty.isrental||aProperty.IsRental?'Yes':'No');ourInstance.select('.dyn_prop_req_info').each(function(link)
{link.href='javascript:DevCompose.onClickedPropertyRequestInfo('+aProperty.id+')';});ourInstance.select('.dyn_prop_apply').each(function(link)
{var url='/forms/1003.aspx?propID='+aProperty.id;switch(fwk.PROD_NAME)
{case'Overland Mortgage Corporation':url='https://overland.1to1real.com'+url;break;default:url='https://lenderkey.1to1real.com'+url;break;}
link.href=url;});if(AucMan&&AucMan.currentAuction)
{var auctionItem=(AucMan.currentAuction.auctionitems||AucMan.currentAuction.AuctionItems).find(function(ai){return ai.itemid==aProperty.id;});if(auctionItem)
{Formatter.bindAuctionItemLinks(ourInstance,AucMan.currentAuction,auctionItem);}}
ourInstance.select('.dyn_unit_num_chk').each(function(item){item.name=(aProperty.name||aProperty.Name);item.id=aProperty.id;});return ourInstance;};Formatter.formatPropertyExtendedData=function(ourInstance,aProperty)
{FileMan.loadPropertyFiles(aProperty.id||aProperty.propertyid,ourInstance);ourInstance.daDataLoaded=true;var attrSections=['general_','sales_','legal_','interior_'];var columns=(window.UnitDAOverride&&window.UnitDAOverride.columns)?window.UnitDAOverride.columns:3;attrSections.each(function(attrSection)
{var infoWrappers=ourInstance.select('.dyn_prop_'+attrSection+'attributes');if(infoWrappers.length>0)
{infoWrappers.each(function(infoWrapper)
{Formatter.formatPropertyDAs(aProperty,infoWrapper,columns,attrSection);if(infoWrapper.childElements().length<1)
{infoWrapper.up().hide();}});}});ourInstance.select('.dyn_prop_attributes').each(function(infoWrapper)
{Formatter.formatPropertyDAs(aProperty,infoWrapper,columns);if(infoWrapper.childElements().length<1)
{infoWrapper.up().hide();}});};Formatter.formatPropertyPrice=function(aProperty,noOverride)
{var priceString;if((aProperty.priceoverride||aProperty.PriceOverride)&&!noOverride)
{priceString=aProperty.priceoverride||aProperty.PriceOverride;}
else if(aProperty.price>1)
{priceString=Utl.formatCurrency(aProperty.price||aProperty.Price);}
else
{priceString='Available Upon Request';}
return priceString;};Formatter.formatPropertyDAs=function(aProperty,attributesDiv,columns,keyPrefixes)
{if(keyPrefixes&&typeof(keyPrefixes)=='string')
{keyPrefixes=[keyPrefixes];}
Utl.clearAllChildren(attributesDiv);var attrs=aProperty.generalattributes||aProperty.GeneralAttributes;if(attrs.length===0)
{attributesDiv.hide();}
var curRowCount=0;var curAttrCount=0;var currentRowWrapper;for(var i=0;i<attrs.length;i++)
{var attr=attrs[i];var key=(attr.pairkey||attr.PairKey);var value=(attr.pairvalue||attr.PairValue);var prefix='';if(keyPrefixes)
{prefix=keyPrefixes.find(function(n){return key.indexOf(n)===0;});}
if(window.DAExcludes&&window.DAExcludes.find(function(n){return n==key;})||prefix===null||prefix===undefined||(prefix.length===0&&key.indexOf('_')>=0))
{continue;}
if(curAttrCount%columns===0)
{currentRowWrapper=$(document.createElement('div'));if(Utl.isEven(curRowCount))
{currentRowWrapper.addClassName('alt_row');}
currentRowWrapper.addClassName('attr_row clearfix');attributesDiv.appendChild(currentRowWrapper);curRowCount++;}
var attrWrapper=Formatter.createPropertyDAWrapper(key.substr(prefix.length),value);currentRowWrapper.appendChild(attrWrapper);curAttrCount++;}};Formatter.createPropertyDAWrapper=function(pairkey,pairvalue)
{var attr_p=$(document.createElement('div'));var attr_title=$(document.createElement('span'));var attr_value=$(document.createElement('span'));attr_p.appendChild(attr_title);attr_p.appendChild(attr_value);attr_title.addClassName('attr_title');attr_value.addClassName('attr_value');UtilPop.setFieldInnerHTML(attr_title,pairkey);pairvalue=Utl.trim(pairvalue);if(pairvalue.match(/^[A-Z0-9._%+\-]+@[A-Z0-9.\-]+\.[A-Z]{2,4}$/i))
{attr_value.innerHTML='<a href="mailto:'+pairvalue+'">'+pairvalue+'</a>';}
else
{attr_value.innerHTML=pairvalue;}
attr_p.addClassName('attr_wrap');return attr_p;};if(!window.Formatter){Formatter={};}
Formatter.formatDisplayableSearchQuery=function(searchQuery,templateid,appendSearchQuery,hide)
{var i=0;var sq=SearchInput.convertRawSearchQueryToJSON(searchQuery);if(!sq||sq===null)
{return;}
var ourInstance=Utl.getInstanceOfTemplate(templateid,true,hide);if(ourInstance===null)
{return $(document.createElement('div'));}
if(appendSearchQuery)
{ourInstance.searchquery=searchQuery;}
if(sq.inpval)
{var kwDisplay=sq.inpval.replace(SearchInput.delimit,'');if(sq.kwall)
{kwDisplay+=' (All';}
else
{kwDisplay+=' (Any';}
if(sq.incname)
{kwDisplay+=')';}
else
{kwDisplay+=', no Names)';}
ourInstance.getElementsByClassName('dyn_kw')[0].innerHTML=kwDisplay;}
else
{ourInstance.getElementsByClassName('dyn_kw')[0].innerHTML='No Keywords';}
if(sq.locdsp)
{ourInstance.getElementsByClassName('dyn_loc')[0].innerHTML=sq.locdsp;}
else
{ourInstance.getElementsByClassName('dyn_loc')[0].innerHTML='Anywhere';}
if(sq.beds)
{ourInstance.getElementsByClassName('dyn_beds')[0].innerHTML=sq.beds+' or more';}
else
{ourInstance.getElementsByClassName('dyn_beds')[0].innerHTML='Any';}
if(sq.baths)
{ourInstance.getElementsByClassName('dyn_baths')[0].innerHTML=sq.baths+' or more';}
else
{ourInstance.getElementsByClassName('dyn_baths')[0].innerHTML='Any';}
var prcDisplay=new StringBuilder();if(sq.minP)
{prcDisplay.append(Utl.formatCurrency(sq.minP));}
else
{prcDisplay.append('Any');}
prcDisplay.append(' to ');if(sq.maxP)
{prcDisplay.append(Utl.formatCurrency(sq.maxP));}
else
{prcDisplay.append('Any');}
ourInstance.getElementsByClassName('dyn_price')[0].innerHTML=prcDisplay.toString();if(sq.pt)
{var propTypesb=new StringBuilder();pts=SearchInput.getInputValues('propertytypes');for(var myptIdx=0;myptIdx<sq.pt.length;myptIdx++)
{for(i=0;i<pts.length;i++)
{if(pts[i].realestatetagid==sq.pt[myptIdx])
{propTypesb.append(pts[i].value);propTypesb.append(' or ');}}}
propTypesb.popLast();ourInstance.getElementsByClassName('dyn_proptypes')[0].innerHTML=propTypesb.toString();}
else
{ourInstance.getElementsByClassName('dyn_proptypes')[0].innerHTML='Any';}
var nhLi=ourInstance.getElementsByClassName('dyn_neighborhoods')[0];if(sq.nh)
{var nhsb=new StringBuilder();nhs=SearchInput.getInputValues('neighborhoods');for(var nhIdx=0;nhIdx<sq.nh.length;nhIdx++)
{for(i=0;i<nhs.length;i++)
{if(nhs[i].realestatetagid==sq.nh[nhIdx])
{nhsb.append(nhs[i].value);nhsb.append(' or ');}}}
nhsb.popLast();if(nhLi)
{nhLi.innerHTML=nhsb.toString();}}
else
{if(nhLi)
{nhLi.innerHTML='Any';}}
return ourInstance;};if(!window.Formatter){Formatter={};}
Formatter.formatUserProfile=function(userProfile,templateid,appendObject,hide)
{var ourInstance=$(templateid);if(ourInstance===null)
{return $(document.createElement('div'));}
ourInstance.select('.register_country').each(function(countrySelect)
{if(!countrySelect.type||countrySelect.type.indexOf('select')<0)
{return;}
UtilPop.appendOptionIntoSelect(countrySelect,'Select');UtilPop.appendOptionIntoSelect(countrySelect,'--------------------------------');UtilPop.appendOptionsIntoSelect(Country.fullCountryList,countrySelect,'name','abbreviation');countrySelect.selectedIndex=0;countrySelect.observe('change',UtilPop.ensureSelectedOptionValid);});ourInstance.select('.select_country').each(function(countrySelect)
{if(!countrySelect.type||countrySelect.type.indexOf('select')<0)
{return;}
UtilPop.appendOptionIntoSelect(countrySelect,'Select');UtilPop.appendOptionIntoSelect(countrySelect,'--------------------------------');UtilPop.appendOptionsIntoSelect(Country.fullCountryList,countrySelect,'name','abbreviation');countrySelect.selectedIndex=0;countrySelect.observe('change',UtilPop.ensureSelectedOptionValid);});var up=userProfile;var details=up?up.Details:null;var authinfo=up?up.AuthenticationInformation:null;var personalinfo=details?details.PersonalInfo:null;if(authinfo)
{ourInstance.select('.register_changepassword').each(function(changePassLink)
{Event.observe(changePassLink,'click',function(args)
{TemplatedDialogue.Show_ChangePassword(authinfo.LoginName,LoginControl.getPersistState(),false,null);});});UtilPop.setFieldsByClassName(ourInstance,'register_loginname',authinfo.LoginName);ourInstance.select('.register_pass_question').each(function(item){item.setValue(authinfo.LoginRetrieval.Question);});UtilPop.setFieldsByClassName(ourInstance,'register_pass_answer',authinfo.LoginRetrieval.Answer);}
else
{UtilPop.setFieldsByClassName(ourInstance,'register_loginname','');UtilPop.setFieldsByClassName(ourInstance,'register_pass_question','');UtilPop.setFieldsByClassName(ourInstance,'register_pass_answer','');}
var dbString='';if(personalinfo)
{UtilPop.setFieldsByClassName(ourInstance,'register_first_name',personalinfo.FirstName);UtilPop.setFieldsByClassName(ourInstance,'register_middle_name',personalinfo.MiddleName);UtilPop.setFieldsByClassName(ourInstance,'register_last_name',personalinfo.LastName);UtilPop.setFieldsByClassName(ourInstance,'register_gender',personalinfo.GenderValue);if(personalinfo.DateOfBirth)
{var db=new Date(personalinfo.DateOfBirth);dbString=(db.getMonth()+1)+'/'+db.getDate()+'/'+db.getFullYear();}}
else
{UtilPop.setFieldsByClassName(ourInstance,'register_first_name','');UtilPop.setFieldsByClassName(ourInstance,'register_middle_name','');UtilPop.setFieldsByClassName(ourInstance,'register_last_name','');UtilPop.setFieldsByClassName(ourInstance,'register_gender','');}
UtilPop.setFieldsByClassName(ourInstance,'register_dateOfBirth',dbString);if(details)
{UtilPop.setFieldsByClassName(ourInstance,'register_email',details.EmailAddresses[0].Address);UtilPop.setFieldsByClassName(ourInstance,'register_email_confirm',details.EmailAddresses[0].Address);}
else
{UtilPop.setFieldsByClassName(ourInstance,'register_email','');UtilPop.setFieldsByClassName(ourInstance,'register_email_confirm','');}
if(details&&details.MailingAddresses&&details.MailingAddresses.length>0)
{var fullAddress=details.MailingAddresses[0].UserLocation.split('\n');UtilPop.setFieldsByClassName(ourInstance,'register_address1',fullAddress[0]);UtilPop.setFieldsByClassName(ourInstance,'register_city',fullAddress[1]);UtilPop.setFieldsByClassName(ourInstance,'register_province',fullAddress[2]);UtilPop.setFieldsByClassName(ourInstance,'register_country',fullAddress[3]);UtilPop.setFieldsByClassName(ourInstance,'register_zippostal',details.MailingAddresses[0].ZipPostal);var phoneNumbers=details.MailingAddresses[0].PhoneNumbers;for(var phnIdx=0;phnIdx<phoneNumbers.length;phnIdx++)
{if(phoneNumbers[phnIdx].NumberTypeValue=='PrimaryNumber')
{UtilPop.setFieldsByClassName(ourInstance,'register_primaryPhone',phoneNumbers[phnIdx].Number);}
else if(phoneNumbers[phnIdx].NumberTypeValue=='OtherNumber')
{UtilPop.setFieldsByClassName(ourInstance,'register_secondaryPhone',phoneNumbers[phnIdx].Number);}
else if(phoneNumbers[phnIdx].NumberTypeValue=='OfficeNumber')
{UtilPop.setFieldsByClassName(ourInstance,'register_officePhone',phoneNumbers[phnIdx].Number);}
else if(phoneNumbers[phnIdx].NumberTypeValue=='Fax')
{UtilPop.setFieldsByClassName(ourInstance,'register_fax',phoneNumbers[phnIdx].Number);}}}
else
{UtilPop.setFieldsByClassName(ourInstance,'register_address1','');UtilPop.setFieldsByClassName(ourInstance,'register_city','');UtilPop.setFieldsByClassName(ourInstance,'register_province','');UtilPop.setFieldsByClassName(ourInstance,'register_country','');UtilPop.setFieldsByClassName(ourInstance,'register_zippostal','');UtilPop.setFieldsByClassName(ourInstance,'register_primaryPhone','');UtilPop.setFieldsByClassName(ourInstance,'register_secondaryPhone','');UtilPop.setFieldsByClassName(ourInstance,'register_officePhone','');UtilPop.setFieldsByClassName(ourInstance,'register_fax','');}
if(up&&up.Attributes)
{for(var i=0;i<up.Attributes.length;i++)
{if(up.Attributes[i].PairKey.toLowerCase()=='external notification')
{UtilPop.setFieldsByClassName(ourInstance,'register_externalnotification',up.Attributes[i].PairValue=='true',false,{t:'Yes',f:'No'});}
else if(up.Attributes[i].PairKey.toLowerCase()=='source')
{UtilPop.setFieldsByClassName(ourInstance,'register_source',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='agent')
{UtilPop.setFieldsByClassName(ourInstance,'register_agent',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='timeframe_to_buy')
{UtilPop.setFieldsByClassName(ourInstance,'register_timeframe_to_buy',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='min price')
{UtilPop.setFieldsByClassName(ourInstance,'register_min_price',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='max price')
{UtilPop.setFieldsByClassName(ourInstance,'register_max_price',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='comments')
{UtilPop.setFieldsByClassName(ourInstance,'register_comments',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='area of interest')
{UtilPop.setFieldsByClassName(ourInstance,'register_area_of_interest',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey=='Newsletter_'+fwk.PROD_KEY)
{UtilPop.setFieldsByClassName(ourInstance,'register_subscribe',up.Attributes[i].PairValue=='true',false,{t:'Yes',f:'No'});}
else if(up.Attributes[i].PairKey.toLowerCase()=='passport/drivers license #')
{UtilPop.setFieldsByClassName(ourInstance,'register_passportdriverslicense',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='auction deposit type')
{UtilPop.setFieldsByClassName(ourInstance,'register_deposittype',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='brokerage')
{UtilPop.setFieldsByClassName(ourInstance,'register_brokerage',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='license #')
{UtilPop.setFieldsByClassName(ourInstance,'register_license_number',up.Attributes[i].PairValue);}
else if(up.Attributes[i].PairKey.toLowerCase()=='tax id #')
{UtilPop.setFieldsByClassName(ourInstance,'register_tax_id',up.Attributes[i].PairValue);}}}
else
{UtilPop.setFieldsByClassName(ourInstance,'register_externalnotification',true,false,{t:'Yes',f:'No'});UtilPop.setFieldsByClassName(ourInstance,'register_source','');UtilPop.setFieldsByClassName(ourInstance,'register_agent','');UtilPop.setFieldsByClassName(ourInstance,'register_timeframe_to_buy','');UtilPop.setFieldsByClassName(ourInstance,'register_min_price','');UtilPop.setFieldsByClassName(ourInstance,'register_max_price','');UtilPop.setFieldsByClassName(ourInstance,'register_comments','');UtilPop.setFieldsByClassName(ourInstance,'register_area_of_interest','');UtilPop.setFieldsByClassName(ourInstance,'register_subscribe',true,false,{t:'Yes',f:'No'});UtilPop.setFieldsByClassName(ourInstance,'register_deposittype','');UtilPop.setFieldsByClassName(ourInstance,'register_brokerage','');UtilPop.setFieldsByClassName(ourInstance,'register_license_number','');UtilPop.setFieldsByClassName(ourInstance,'register_tax_id','');}
return ourInstance;};var ApeMan={currentHash:'',periodicalExecuter:null,onHashChangeCallbacks:[],init:function()
{if(ApeMan.periodicalExecuter){ApeMan.periodicalExecuter.stop();}
ApeMan.periodicalExecuter=new PeriodicalExecuter(ApeMan.checkHash,0.5);},setHash:function(newHash,noUpdate)
{window.location.hash=newHash;if(noUpdate)
{ApeMan.currentHash=newHash;}
if(ApeMan.onHashChangeCallbacks.length>0)
{ApeMan.init();}},checkHash:function()
{if(ApeMan.currentHash!=window.location.hash&&!ApeMan.locked)
{ApeMan.currentHash=window.location.hash;ApeMan.onHashChangeCallbacks.each(function(callback)
{callback(ApeMan.currentHash.substr(1,ApeMan.currentHash.length));});}},addHashChangeCallBack:function(callback)
{ApeMan.onHashChangeCallbacks.push(callback);ApeMan.init();}};var AucMan={auctions:[],myAuctions:[],currentAuction:null,auctionColumns:3,init:function(myAuctions)
{if(window.ViewMan)
{ViewMan.updateAuctionTab();}},loadAuctionsHandler:function(auctions)
{AucMan.auctions=auctions;AucMan.initAuctionList();},toggleMap:function()
{},initAuctionList:function()
{var currentAuctionsWrapper=$('current_auctions_wrapper');var upcomingAuctionsWrapper=$('upcoming_auctions_wrapper');var pastAuctionsWrapper=$('past_auctions_wrapper');var allAuctionsWrapper=$('all_auctions_wrapper');var featuredAuctionsWrapper=$('featured_auction_wrapper');if(currentAuctionsWrapper){Utl.clearAllChildren(currentAuctionsWrapper);}
if(upcomingAuctionsWrapper){Utl.clearAllChildren(upcomingAuctionsWrapper);}
if(featuredAuctionsWrapper){Utl.clearAllChildren(featuredAuctionsWrapper);}
if(allAuctionsWrapper){Utl.clearAllChildren(allAuctionsWrapper);}
var currCol=null;if(allAuctionsWrapper)
{AucMan.auctions.each(function(auction)
{if(!auction){return;}
if(!currCol||currCol.childNodes.length>=AucMan.auctionColumns)
{currCol=$(document.createElement('div'));currCol.addClassName('clearfix');allAuctionsWrapper.appendChild(currCol);}
var aucWrap=Formatter.formatAuction(auction,'auction_template',true,false,false);if(Auction.GetCurrentAuctions([auction]).length>0)
{aucWrap.addClassName('current');}
else if(Auction.GetUpcomingAuctions([auction]).length>0)
{aucWrap.addClassName('upcoming');}
else
{aucWrap.addClassName('past');}
currCol.appendChild(aucWrap);});}
if(currentAuctionsWrapper||featuredAuctionsWrapper)
{var currAuctions=Auction.GetCurrentAuctions(AucMan.auctions);currAuctions.each(function(auction)
{if(currentAuctionsWrapper){currentAuctionsWrapper.appendChild(Formatter.formatAuction(auction,'auction_template',true,false,false));}
if($('current_auctions')){$('current_auctions').show();}
if(featuredAuctionsWrapper){featuredAuctionsWrapper.appendChild(Formatter.formatAuction(auction,'featured_auctions_template',true,false,false));}});}
if(upcomingAuctionsWrapper||featuredAuctionsWrapper)
{var upcomingAuctions=Auction.GetUpcomingAuctions(AucMan.auctions);upcomingAuctions.each(function(auction)
{if(upcomingAuctionsWrapper){upcomingAuctionsWrapper.appendChild(Formatter.formatAuction(auction,'auction_template',true,false,false));}
if($('upcoming_auctions')){$('upcoming_auctions').show();}
featuredAuctionsWrapper.appendChild(Formatter.formatAuction(auction,'featured_auctions_template',true,false,false));});}
if(pastAuctionsWrapper)
{var pastAuctions=Auction.GetPastAuctions(AucMan.auctions);pastAuctions.each(function(auction)
{pastAuctionsWrapper.appendChild(Formatter.formatAuction(auction,'auction_template',true,false,false));if($('past_auctions')){$('past_auctions').show();}});}
if($('content')&&$('content').down('.listings')&&$('content').down('.listings').select('.dyn_auction_description'))
{$('content').down('.listings').select('.dyn_auction_description').each(function(description)
{new SpanToggle(description,null,description.innerHTML,Math.random(),125);});}
fwk.ShowPageDetails();},delayedInit:function()
{$(AucMan.init).delay(0);},aucList:null,aucListSort:'auc_item_sort_modified',aucListSortOrder:'desc',editAuc:null,tabManager:null,tabCount:0,loadedTabCount:0,allowedFiles:10,loadAuctionManager:function()
{AucMan.loadExternalResources();AucMan.loadAucList();Event.observe($('aucAccountOverride'),'change',function()
{if($('aucAccountOverride').selectedIndex>1){AucMan.loadOverrideList();}});var toolbars=$('aucConfig').select('.dyn_auc_edit_toolbar');for(var i=0;i<toolbars.length;i++)
{var ourInstance=Utl.getInstanceOfTemplate('auc_edit_toolbar_template',true,false);toolbars[i].appendChild(ourInstance);}
AucMan.tabCount=3;AucMan.tabManager=new TabbedPanelManager('auc_edit_tab_headers','auc_edit_tab_panels',true);AucMan.tabManager.addPanel('/modules/ManualLoader/auctions/details.htm?v='+fwk.VERSION,null,'Details');AucMan.tabManager.addPanel('/modules/ManualLoader/auctions/itemmanager.htm?v='+fwk.VERSION,null,'Item Manager');AucMan.tabManager.addPanel('/modules/ManualLoader/auctions/filemanager.htm?v='+fwk.VERSION,null,'File Manager');AucMan.setDisplayEditable(false);},loadAucList:function()
{Auction.LoadAuctionsByAccount(Identity.GetFirstAccountIDForRole('auctionmanager'),AucMan.populateAucList);},loadOverrideList:function()
{var acctSelection=$('aucAccountOverride');if(acctSelection.value>0)
{Dlg.ShowProgress('Loading Auctions for the account: '+acctSelection.options[acctSelection.selectedIndex].text);Auction.LoadAuctionsByAccount(acctSelection.value,AucMan.populateAucList);}},loadExternalResources:function()
{Account.LoadMyAccounts('AuctionManager',AucMan.storeAccountList);},storeAccountList:function(accounts)
{AucMan.accountList=accounts;AucMan.testIfResourcesLoaded();},populateAccountList:function()
{UtilPop.populateSelect($('aucAccountOverride'),AucMan.accountList,'Select','name','accountid',Identity.GetFirstAccountIDForRole('auctionmanager'));if(AucMan.accountList&&AucMan.accountList.length>1)
{$('aucAccountOverrideWrapper').show();}
else
{$('aucAccountOverrideWrapper').hide();}},setDisplayEditable:function(isEditable)
{if(isEditable)
{$('auc_selectmode').hide();$('auc_editmode').show();}
else
{$('auc_selectmode').show();$('auc_editmode').hide();}},checkInTab:function()
{AucMan.loadedTabCount++;AucMan.testIfResourcesLoaded();},testIfResourcesLoaded:function()
{if(AucMan.accountList!==null&&AucMan.loadedTabCount>=AucMan.tabCount)
{$('btnNewAuc').disabled=false;$('btnAucOverride').disabled=false;AucMan.populateAccountList();if(AucMan.accountList&&AucMan.accountList.length==1)
{var accountList=$('aucAccountOverride');accountList.selectedIndex=2;AucMan.loadOverrideList();}}},populateAucList:function(auctionList)
{var i=0;AucMan.aucList=auctionList;if(!AucMan.aucList){return;}
AucMan.sortAucList();var selectElems=$('auc_editmode').select('.auc_quicklist_selection');for(i=0;i<selectElems.length;i++)
{var sel=selectElems[i];sel.options.length=0;UtilPop.appendOptionIntoSelect(sel,'Jump to Auction');UtilPop.appendOptionIntoSelect(sel,'--------------------------------');if(auctionList.length>0)
{UtilPop.appendOptionsIntoSelect(auctionList,sel,'name','id');sel.show();}
else
{sel.hide();}}
var auc_List=$('auc_List');Utl.clearAllChildren(auc_List);for(i=0;i<auctionList.length;i++)
{var ourInstance=Utl.getInstanceOfTemplate('auc_list_item_template',true,false);ourInstance.aucId=auctionList[i].id;ourInstance.addClassName('fakelink');ourInstance.observe('click',function(evnt){var ele=evnt.element();if(!ele.aucId){ele=ele.up('.auc_list_item_wrapper');}
if(ele.aucId){AucMan.loadAuctionByID(ele.aucId);}});ourInstance.title=auctionList[i].id+' - '+auctionList[i].Name;if(Utl.isEven(i))
{ourInstance.addClassName('alt-row');}
UtilPop.setFieldsByClassName(ourInstance,'auc_list_item_name',auctionList[i].Name);UtilPop.setFieldsByClassName(ourInstance,'auc_list_item_id',auctionList[i].id);UtilPop.setFieldsByClassName(ourInstance,'auc_list_item_createdat',auctionList[i].CreatedAt.toShortDateTimeString());UtilPop.setFieldsByClassName(ourInstance,'auc_list_item_lastmodified',auctionList[i].LastModified.toShortDateTimeString());UtilPop.setFieldsByClassName(ourInstance,'auc_list_item_isenabled',auctionList[i].IsEnabled);if(auctionList[i].IsEnabled)
{ourInstance.addClassName('enabled');}
else
{ourInstance.addClassName('disabled');}
auc_List.appendChild(ourInstance);}
Dlg.hide();},sortAucList:function()
{AucMan.aucList.sort(function(a,b)
{var x;var y;if(AucMan.aucListSort=='auc_item_sort_name')
{x=a.Name.toLowerCase();y=b.Name.toLowerCase();}
else if(AucMan.aucListSort=='auc_item_sort_id')
{x=a.id;y=b.id;}
else if(AucMan.aucListSort=='auc_item_sort_created')
{x=new Date(a.CreatedAt);y=new Date(b.CreatedAt);}
else if(AucMan.aucListSort=='auc_item_sort_modified')
{x=new Date(a.LastModified);y=new Date(b.LastModified);}
else if(AucMan.aucListSort=='auc_item_sort_isenabled')
{x=a.IsEnabled;y=b.IsEnabled;}
var result=((x<y)?-1:((x>y)?1:0));if(AucMan.aucListSortOrder=='desc')
{result=result*-1;}
return result;});},updateSortMethod:function(newSort)
{$('auc_item_sort_name').removeClassName('sort_asc');$('auc_item_sort_name').removeClassName('sort_desc');$('auc_item_sort_id').removeClassName('sort_asc');$('auc_item_sort_id').removeClassName('sort_desc');$('auc_item_sort_created').removeClassName('sort_asc');$('auc_item_sort_created').removeClassName('sort_desc');$('auc_item_sort_modified').removeClassName('sort_asc');$('auc_item_sort_modified').removeClassName('sort_desc');$('auc_item_sort_isenabled').removeClassName('sort_asc');$('auc_item_sort_isenabled').removeClassName('sort_desc');if(AucMan.aucListSort==newSort)
{if(AucMan.aucListSortOrder=='asc')
{AucMan.aucListSortOrder='desc';}
else
{AucMan.aucListSortOrder='asc';}}
else
{AucMan.aucListSort=newSort;AucMan.aucListSortOrder='asc';}
if(AucMan.aucListSortOrder=='asc')
{$(newSort).addClassName('sort_asc');}
else
{$(newSort).addClassName('sort_desc');}
AucMan.populateAucList(AucMan.aucList);},onChangeQuickAucList:function(selInput)
{if(UtilPop.ensureSelectedOptionValid(selInput))
{AucMan.loadAuctionByID(selInput.value);}
selInput.selectedIndex=0;},loadNewAuction:function()
{if($('aucAccountOverride').value<=0)
{Dlg.Show('','Please select an account before you create a new Auction.');return;}
if(!AucMan.isSafeToUnload()){return;}
AucMan.tabManager.gotoTab('Details');AucMan.loadAuction({id:-1,IsEnabled:true,StartDate:new Date(),EndDate:new Date(),RegistrationDate:new Date(),Name:'',Summary:'',Note:'',TagName:'',OwnerAccount:Identity.GetFirstAccountIDForRole('auctionmanager'),DisplayableAttributes:[],AuctionItems:[],RegisteredUsers:[]});},loadAuctionByID:function(aucId)
{if((AucMan.editAuc!==null&&AucMan.editAuc.id==aucId)||!AucMan.isSafeToUnload()){return;}
Dlg.ShowProgress('Loading Auction...');Auction.LoadAuction(aucId,AucMan.loadAuction);},loadAuction:function(auc)
{var isLoadedOk=true;if(!Identity.ContainsRole('superadmin')&&!Identity.ContainsAccountRole('auctionmanager',auc.OwnerAccount))
{Dlg.Show('Invalid credentials','You may not edit this auction as you are not the owner.');isLoadedOk=false;}
if(isLoadedOk)
{AucMan.editAuc=auc;AucMan.populateAuction();}
else
{AucMan.setDisplayEditable(false);}},populateAuction:function()
{if(AucMan.editAuc.id==-1)
{AucMan.editAuc.id=Utl.getRandomNegativeID();}
var aucId=AucMan.editAuc.id;AucMan.updateEditModeIsEnabled();if(!aucId||aucId<=0)
{aucId='You must save the auction to get an ID';}
UtilPop.setField($('display_aucid'),aucId);var curName=AucMan.editAuc.Name;if(!curName||curName.length===0)
{curName='Untitled Auction';}
UtilPop.setField($('display_aucname'),curName);AucDetailsMan.loadCurrentAuction();AucItemMan.loadCurrentAuction();AucFileMan.loadCurrentAuction();var counterDivs=$('aucConfig').select('.counter');for(var i=0;i<counterDivs.length;i++)
{counterDivs[i].remove();}
LengthCounter.setMaxLength();AucMan.setDisplayEditable(true);Dlg.hide();},updateEditModeIsEnabled:function()
{var enabledButtons=$('auc_editmode').select('.aucEnabled');for(var i=0;i<enabledButtons.length;i++)
{enabledButtons[i].removeClassName('aucIsEnabled');if(AucMan.editAuc.IsEnabled)
{enabledButtons[i].addClassName('aucIsEnabled');}}},isSafeToUnload:function()
{var isSafe=true;if(AucMan.editAuc)
{isSafe=confirm('An auction is currently being edited.\n\nAre you sure you want to discard all current changes?');}
return isSafe;},discardChanges:function()
{if(AucMan.isSafeToUnload())
{AucMan.editAuc=null;AucMan.setDisplayEditable(false);}},toggleIsEnabled:function(force)
{if(force!=null)
{AucMan.editAuc.IsEnabled=force;}
else
{AucMan.editAuc.IsEnabled=!AucMan.editAuc.IsEnabled;}
AucMan.updateEditModeIsEnabled();},saveAuction:function(notify)
{if(notify)
{TemplatedDialogue.Show_Confirm('Are you sure you want to send a notice of this change to all users who have registered for this Auction?',function(){AucMan.saveAuctionHandler(notify);});}
else
{AucMan.saveAuctionHandler(notify);}},saveAuctionHandler:function(notify)
{if(!notify){notify=false;}
if(!AucDetailsMan.validate()){return;}
Dlg.ShowProgress('Saving Auction...',{disableid:'aucConfig'});var aucToSave=new Auction();aucToSave.setIsEnabled(AucMan.editAuc.IsEnabled.toString());aucToSave.setID(AucMan.editAuc.id);AucDetailsMan.populateAucFromUI(aucToSave);AucItemMan.populateAucFromUI(aucToSave);aucToSave.setNote(AucMan.editAuc.Note);aucToSave.save(notify,AucMan.handleSaveResponse);},handleSaveResponse:function(response)
{if(!response)
{Dlg.Show('Auction not Saved!',fwk.AJAX_FAILURE_MESSAGE);}
else if(response.newid>0)
{AucMan.editAuc=null;AucMan.loadOverrideList();AucMan.setDisplayEditable(false);Dlg.Show('Auction Saved','Your Auction has been saved successfully.');}
else
{Dlg.Show('Auction not Saved!','There was a problem saving: '+response.status);}}};var AucShowcase={developments:[],init:function()
{var devWrapper=$('wrapper_developments');if(!AucMan.currentAuction)
{devWrapper.innerHTML='An error has occured loading this auction, please try again later.';return;}
var devIDs=[];Utl.clearAllChildren(devWrapper);for(var i=0;i<AucMan.currentAuction.AuctionItems.length;i++)
{var development=AucMan.currentAuction.AuctionItems[i].Development;var devWrappers=devWrapper.select('.wrapper_development');var devInstance=null;for(var j=0;j<devWrappers.length;j++)
{if(devWrappers[j].development.id==development.id)
{devInstance=devWrappers[j];break;}}
if(devInstance===null)
{devIDs.push(development.id);devInstance=Formatter.format_development_(development,'template_development',true,false,false);devWrapper.appendChild(devInstance);}
var propertiesWrapper=devInstance.down('.dyn_properties_wrapper');var propWrapper=Formatter.format_property(development.Properties[0],'template_property',true,false,false);propertiesWrapper.appendChild(propWrapper);Formatter.formatAuctionItem(AucMan.currentAuction,AucMan.currentAuction.AuctionItems[i],propWrapper);if(Auction.getAuctionStatus(AucMan.currentAuction,fwk.SERVER_TIME_DIFF)==Auction.AuctionStatus.Past)
{propWrapper.select('.head_auc_past').each(Element.show);}
else if(Auction.getAuctionStatus(AucMan.currentAuction,fwk.SERVER_TIME_DIFF)==Auction.AuctionStatus.Upcoming)
{propWrapper.select('.head_auc_upcoming').each(Element.show);}
else
{propWrapper.select('.head_auc_current').each(Element.show);}
if(development.IsSingleListing===true)
{devInstance.select('.property_specific_wrapper').each(Element.hide);Formatter.format_development_(development,propWrapper,false,false,true);FileMan.loadDevelopmentFiles(development.id,devInstance);}}
devWrapper.select('.wrapper_development .dyn_properties_wrapper').each(function(propertiesWrapper)
{propertiesWrapper.propertiesAccordion=new Accordion(propertiesWrapper,{clickpane:'acc_prop_title',bodypane:'acc_prop_body',closable:true,multiple:true,openpane:'noshow',allowopencheck:function(ele)
{if(Identity.GetLoginID()!==null||fwk.PROD_KEY!='BM')
{var _wrapper=ele.up('.dyn_property_wrapper');if(!_wrapper.daDataLoaded)
{Formatter.formatPropertyExtendedData(_wrapper,_wrapper.property);}
return true;}
TemplatedDialogue.Show_Restricted('VIEW_PROPERTY',-1,function(){propertiesWrapper.propertiesAccordion.singleOpen(ele);});return false;}});if(propertiesWrapper.childElements().length==1&&fwk.PROD_KEY!='RS')
{propertiesWrapper.propertiesAccordion.allOpen();}});var aucWrapper=Formatter.formatAuction(AucMan.currentAuction,$('content'),false,false,true);FileMan.loadSingleAccountImage(AucMan.currentAuction.OwnerAccount,$('content'));aucWrapper.select('.dyn_auction_description').each(function(description){new SpanToggle(description,'dyn_auction_description_toggle',description.innerHTML,Math.random(),500,true);});SearchInput.storeSearchResultCookie(1,100,devIDs.length,'',devIDs.join(),'/auction/'+AucMan.currentAuction.id);if($('loading')){$('loading').hide();}
if($('detailsWrapper')){$('detailsWrapper').show();}}};var BlogMan={currentComments:[],currentCommentContainer:null,currentEditContainer:null,LoadThreadComments:function(threadID)
{BlogMan.threadID=threadID;if(threadID)
{BlogComment.LoadCommentsByThreadJSON_(threadID,BlogMan.LoadThreadCommentsHandler);}
else
{BlogMan.LoadThreadCommentsHandler([]);}},LoadThreadCommentsHandler:function(comments)
{BlogMan.currentComments=comments;var wrapper=$('tab-comments');Utl.clearAllChildren(wrapper);var ourInstance=null;var templateID='defaultBlogCommentTemplate';if(comments.length==0)
{wrapper.innerHTML='Be the first to place make a comment.<br /><br /><br />';}
else
{for(var i=0;i<comments.length;i++)
{ourInstance=Utl.getInstanceOfTemplate(templateID,true,false);BlogMan.PopulateComment(ourInstance,comments[i]);wrapper.appendChild(ourInstance);}}},UpdateWithLoadedValues:function()
{var wrapper=$('tab-comments');var commentContainers=wrapper.select('.comment');for(var i=0;i<commentContainers.length;i++)
{BlogMan.PopulateComment(commentContainers[i],commentContainers[i].comment);}},PopulateComment:function(ourInstance,comment)
{ourInstance.comment=comment;new Updater().updateWithModel(ourInstance,'view',comment);var totalRating=comment.getTotalRating();if(totalRating<0)
{ourInstance.select('.comment-show-body').each(Element.show);ourInstance.select('.comment-body').each(function(field)
{field.hide();field.addClassName('comment-header-bt');});}
else
{ourInstance.select('.comment-show-body').each(Element.hide);ourInstance.select('.comment-body').each(function(field)
{if(totalRating>10){field.addClassName('comment-highlight');}
else{field.removeClassName('comment-highlight');}
field.removeClassName('comment-header-bt');field.show();});}
if(comment.ParentCommentID)
{ourInstance.addClassName('comment-indent');}
else
{ourInstance.removeClassName('comment-indent');}
if(!!comment.LastEditedByLoginID)
{ourInstance.select('.comment-lastedit').each(Element.show);}
else
{ourInstance.select('.comment-lastedit').each(Element.hide);}
var showDeleteEdit=(comment.PosterLoginID==Identity.GetLoginID()||Identity.ContainsRole('superadmin'));if(showDeleteEdit)
{ourInstance.select('.comment-links-delete').each(Element.show);ourInstance.select('.comment-links-edit').each(Element.show);}
else
{ourInstance.select('.comment-links-delete').each(Element.hide);ourInstance.select('.comment-links-edit').each(Element.hide);}},ToggleCommentVisible:function(showLink)
{var duration=0.5;var currentBody=showLink.up('.comment').down('.comment-body');if(currentBody.getStyle('display')=='none')
{Effect.BlindDown(currentBody,{duration:duration});showLink.innerHTML='Hide comment';}
else
{Effect.BlindUp(currentBody,{duration:duration});showLink.innerHTML='Show comment';}},RateComment:function(commentContainer,modUp)
{BlogMan.currentCommentContainer=commentContainer;BlogComment.RateComment(BlogMan.currentCommentContainer.comment.id,modUp,BlogMan.RateCommentHandler);},RateCommentHandler:function(response)
{if(response&&response.status=='success')
{BlogMan.PopulateComment(BlogMan.currentCommentContainer,response.comment);}
else if(response)
{Dlg.Show('Failed to modify rating',response.message);}
else
{Dlg.Show('Failed to modify rating',fwk.AJAX_FAILURE_MESSAGE);}
BlogMan.currentCommentContainer=null;},ReplyToComment:function(commentContainer)
{if(Identity.GetLoginID()===null)
{return TemplatedDialogue.Show_Restricted('BLOG_COMMENT_REPLY',-1,function(){BlogMan.ReplyToComment(commentContainer);});}
var wrapper=$('tab-comment-reply');if(commentContainer)
{UtilPop.setFieldsByClassName(wrapper,'comment-reply-to-id',commentContainer.comment.id);UtilPop.setFieldsByClassName(wrapper,'comment-reply-to-name',commentContainer.comment.getPosterName());wrapper.setVisibleByClassName('comment-reply-to-display',true);wrapper.setVisibleByClassName('post_new_comment',false);}},CancelReply:function()
{var wrapper=$('tab-comment-reply');wrapper.select('.comment-reply-to-id').each(function(ele){ele.update('');});wrapper.select('.comment-reply-to-name').each(function(ele){ele.update('');});wrapper.select('.comment-editbox').each(function(ele){ele.update('');});wrapper.select('.comment-reply-to-display').each(Element.hide);wrapper.select('.post_new_comment').each(Element.show);wrapper.select('.comment-editbox').each(function(ele){ele.value='';});},PostComment:function()
{if(Identity.GetLoginID()===null)
{return TemplatedDialogue.Show_Restricted('BLOG_COMMENT_POST',-1,BlogMan.PostComment);}
var wrapper=$('tab-comment-reply');var validator=new Validator();validator.addItemClass(wrapper,'comment-editbox',{minLength:10,maxLength:7500});if(!validator.validate())
{Dlg.Show('Form incomplete:',validator.validationErrorsAsList());}
else
{var comment=new BlogComment();comment.ThreadID=BlogMan.threadID;comment.Body=wrapper.getClassValue('comment-editbox');if(wrapper.getClassValue('comment-reply-to-id'))
{comment.ParentCommentID=wrapper.getClassValue('comment-reply-to-id');}
BlogComment.PostComment(comment,BlogMan.PostCommentHandler);}},PostCommentHandler:function(response)
{if(response&&response.status=='success')
{BlogMan.CancelReply();BlogMan.LoadThreadCommentsHandler(response.comments);}
else if(response)
{Dlg.Show('Failed to post comment',response.message);}
else
{Dlg.Show('Failed to post comment',fwk.AJAX_FAILURE_MESSAGE);}},EditComment:function(commentContainer)
{if(BlogMan.currentEditContainer)
{return Dlg.Show('Cannot Edit!','You are already editing a comment.');}
BlogMan.currentEditContainer=commentContainer;var editInstance=Utl.getInstanceOfTemplate('defaultCommentInputTemplate',true,false);new Updater().updateWithModel(editInstance,'edit',commentContainer.comment);var body=BlogMan.currentEditContainer.down('.comment-body');body.hide();body.insert({after:editInstance});},EditCommentCancel:function()
{BlogMan.currentEditContainer.down('.comment-body').show();BlogMan.currentEditContainer.down('.comment-edit-body').remove();BlogMan.currentEditContainer=null;},EditCommentSubmit:function()
{var comment=BlogMan.currentEditContainer.comment;comment.Body=BlogMan.currentEditContainer.down('.comment-editbox').value;BlogComment.EditComment(comment,BlogMan.EditCommentSubmitHandler);Dlg.ShowProgress('Updating Comment.');},EditCommentSubmitHandler:function(response)
{Dlg.hide();if(response&&response.status=='success')
{BlogMan.PopulateComment(BlogMan.currentEditContainer,response.comment);}
else if(response)
{Dlg.Show('Failed to edit comment',response.message);}
else
{Dlg.Show('Failed to edit comment',fwk.AJAX_FAILURE_MESSAGE);}
BlogMan.EditCommentCancel();},DeleteComment:function(commentContainer)
{Dlg.ShowConfirmation('Would you really like to Delete this comment?',function(){BlogMan.DeleteCommentConfirm(commentContainer);});},DeleteCommentConfirm:function(commentContainer)
{BlogMan.currentCommentContainer=commentContainer;BlogComment.DeleteComment(commentContainer.comment.id,BlogMan.DeleteCommentHandler);},DeleteCommentHandler:function(response)
{if(response&&response.status=='success')
{BlogMan.currentCommentContainer.remove();BlogMan.LoadThreadCommentsHandler(response.comments);}
else if(response)
{Dlg.Show('Failed to delete comment',response.message);}
else
{Dlg.Show('Failed to delete comment',fwk.AJAX_FAILURE_MESSAGE);}
BlogMan.currentCommentContainer=null;}};var CartMan={cartElement:null,cartProductsElementName:'.cart_products',cartSummaryElementName:'.cart_summary',items:[],productsCache:{},COOKIE_NAME:'cart',CreateCart:function(wrapper,emptyCart,productTemplate,products)
{CartMan.cartElement=$(wrapper);CartMan.emptyCartElement=$(emptyCart);CartMan.cartProductsElement=$('container').down(CartMan.cartProductsElementName);CartMan.items=CartMan.ReadCookie();products.each(function(prod)
{CartMan.CacheProduct(prod);CartMan.cartProductsElement.appendChild(Formatter.formatCartOrderItem(CartMan.GetItemByProductID(prod.id),productTemplate,true,false,false));});CartMan.CheckForEmptyCart();CartMan.UpdateCartTotal();fwk.ShowPageDetails();},CacheProduct:function(product)
{CartMan.productsCache[product.id]=product;},CacheProducts:function(products)
{products.each(function(prod){CartMan.CacheProduct(prod);});},CheckForEmptyCart:function()
{if(CartMan.cartProductsElement.childElements().length===0)
{if(CartMan.cartElement){CartMan.cartElement.hide();}
if(CartMan.emptyCartElement){CartMan.emptyCartElement.show();}}
else
{if(CartMan.cartElement){CartMan.cartElement.show();}
if(CartMan.emptyCartElement){CartMan.emptyCartElement.hide();}}},GetItemByProductID:function(productID,items)
{items=items||CartMan.items;productID=productID*1;for(var i=0;i<items.length;i++)
{if(items[i].ProductID*1==productID)
{items[i].Product=CartMan.productsCache[productID];return items[i];}}
return{Quantity:0,ProductID:productID,Product:CartMan.productsCache[productID]};},RemoveItemByProductID:function(productID)
{for(var i=0;i<CartMan.items.length;i++)
{if(CartMan.items[i].ProductID*1==productID*1)
{CartMan.items.splice(i,1);break;}}},AddItem:function(productID,quantity)
{CartMan.items=CartMan.ReadCookie();var item=CartMan.GetItemByProductID(productID);if(item.Quantity===0){CartMan.items.push(item);}
quantity=(quantity*1)||(item?(item.Quantity*1)+1:1);if(item.Product)
{quantity=(item.Product.MaxInCart!==0&&quantity>=item.Product.MaxInCart)?item.Product.MaxInCart:quantity;}
item.Quantity=quantity;CartMan.WriteCookie();CartMan.UpdateCartTotal();},RemoveItem:function(productID,force)
{CartMan.items=CartMan.ReadCookie();var item=CartMan.GetItemByProductID(productID);if(item.Quantity<2||force)
{CartMan.RemoveItemByProductID(productID);}
else
{item.Quantity--;}
CartMan.WriteCookie();CartMan.UpdateCartTotal();},ToggleProductInCart:function(productID)
{if(CartMan.GetItemByProductID(productID).Quantity>0)
{CartMan.RemoveItem(productID,force);}
else
{CartMan.AddItem(productID,1);}},WriteCookie:function()
{var cookieContent='';for(var i=0;i<CartMan.items.length;i++)
{cookieContent+=CartMan.items[i].ProductID+','+CartMan.items[i].Quantity+':';}
cookieContent=cookieContent.substr(0,cookieContent.length-1);Cookie.CreateCookie(CartMan.COOKIE_NAME,cookieContent,30);},ReadCookie:function()
{var items=[];var cookieContent=Cookie.ReadCookie(CartMan.COOKIE_NAME);if(cookieContent&&cookieContent.length>0)
{var itemStrings=cookieContent.split(':');for(var i=0;i<itemStrings.length;i++)
{var itemBits=itemStrings[i].split(',');if(CartMan.GetItemByProductID(itemBits[0],items).Quantity)
{continue;}
var item={ProductID:itemBits[0]*1,Quantity:itemBits[1]*1,Product:CartMan.productsCache[itemBits[0]*1]};items.push(item);}}
return items;},GetProductsInCartAsString:function()
{var prodIDs=[];for(var i=0;i<CartMan.items.length;i++)
{prodIDs.push(CartMan.items[i].ProductID);}
return prodIDs.join(',');},GetTotalItems:function()
{var total=0;for(var i=0;i<CartMan.items.length;i++)
{total+=CartMan.items[i].Quantity;}
return total;},GetTotalPrice:function()
{var total=0;for(var i=0;i<CartMan.items.length;i++)
{if(CartMan.items[i].Product)
{total+=((CartMan.items[i].Product.Price-CartMan.items[i].Product.Discount)*CartMan.items[i].Quantity);}}
return Math.round(total*100)/100;},UpdateCartTotal:function()
{$('container').select(CartMan.cartSummaryElementName).each(function(ele)
{if(ele.down('.total_price'))
{ele.down('.total_price').update(Utl.formatCurrency(CartMan.GetTotalPrice(),true));}
if(ele.down('.total_quantity'))
{ele.down('.total_quantity').update(CartMan.GetTotalItems());}});}};var CropMan={LastResult:null,CurrentImagePath:'',CurrentCropper:null,ShowCropper:function(imagePath)
{CropMan.CurrentImagePath=imagePath;Dlg.Show('Crop Image','<div id="imgCrop_wrap"><img src="'+imgUtl.buildImagePath(imagePath)+'" id="imgCrop_image" /></div><div id="previewOuterWrap" style="display:none"><h2>Crop preview:</h2><div id="previewWrap"></div></div>',{ok_handler:CropMan.AttemptCrop,but_cancel:true});(function()
{CropMan.CurrentCropper=new Cropper.Img('imgCrop_image',{ratioDim:{x:96,y:68},displayOnInit:true});}).defer();},AttemptCrop:function()
{FileManager.CropThumbs(CropMan.CurrentImagePath,CropMan.CurrentCropper.areaCoords,CropMan.AttemptCropHandler);},AttemptCropHandler:function(result)
{CropMan.LastResult=result;if(result.ResponseStatus==200)
{Dlg.Show('Success','<img src="'+imgUtl.convertImagePathToLargeThumbnailPath(result.ResponseData)+'" />'+'<img src="'+imgUtl.convertImagePathToThumbnailPath(result.ResponseData)+'" />');}
else if(result.ResponseStatus==500)
{Dlg.ShowProgress('Failed: '+result.ResponseDetails);}}};var DDHandler={registerDropZone:function()
{this.dropZoneID='scaleable';this.acceptClass='dyn_draggable';this.hoverClass='OnDroppableHover';if($(this.dropZoneID))
{Droppables.add
(this.dropZoneID,{accept:this.acceptClass,onDrop:DDHandler.onDevDrop,hoverclass:this.hoverClass});}},onDevDragStart:function(drag,e)
{drag.element.addClassName('DraggableInMotion');},onDevDragEnd:function(drag,e)
{drag.element.removeClassName('DraggableInMotion');},onDevDrop:function(drag,drop,e)
{if(drag.favoriteObj)
{FavMan.addDevelopment(drag.favoriteObj);FavMan.updateAllFavoritesLinksOnPage();}}};var FavMan={registeredIds:[],init:function()
{FavMan.clearAllDevelopments();if(Identity.GetLoginID()!==null)
{UserProfile.LoadFavoritesAsList(FavMan.populateMyDevelopments);}
else
{FavMan.updateAllFavoritesLinksOnPage();}},delayedInit:function()
{$(FavMan.init).delay(0);},bindLink:function(link,favoriteObj)
{link.favoriteObj=favoriteObj;if(!link._eventID)
{Event.observe(link,'click',function(event)
{event.stop();if(Identity.GetLoginID()===null)
{TemplatedDialogue.Show_Restricted('ADD_FAVORITE',favoriteObj.developmentid,function(){FavMan.handleFavoritesLinkClick(event.target);});}
else
{FavMan.handleFavoritesLinkClick(event.target);}});}
FavMan.updateFavoritesLink(link);},populateMyDevelopments:function(developments)
{for(var i=0;i<developments.length;i++)
{FavMan.addDevelopment(developments[i],true);}
FavMan.updateAllFavoritesLinksOnPage();},addDevelopment:function(favoriteObj,isLoadingData)
{if(Identity.GetLoginID()===null)
{TemplatedDialogue.Show_Restricted('ADD_FAVORITE',favoriteObj.developmentid);return;}
if(!FavMan.containsDevelopment(favoriteObj.developmentid))
{if(FavMan.registeredIds.length>=12)
{Dlg.Show('Cannot add Favorite','You may only save up to 12 favorite developments. If you want to save this favorite, please remove one or more of your existing favorites.');return;}
var newIcon={};if(window.dockbar&&fwk.EUDOCK_VIS&&fwk.EUDOCK&&Identity.GetLoginID()!==null)
{var imglink='/property/'+favoriteObj.developmentid;var imageUrl=imgUtl.convertImagePathToThumbnailPath(favoriteObj.imagepath);var removeCall='FavMan.removeDevelopment('+favoriteObj.developmentid+')';var favname=unescape(favoriteObj.name);newIcon=window.dockbar.addIcon([{euImage:{image:imageUrl,title:favname}},{euLabel:{object:{euImage:{image:imageUrl,title:favname}},txt:'<img class="remImg" title="Remove this property from your Favorites" src="'+fwk.SKIN_ROOT+'/images/btn_remove.png">',style:"",jsCall:removeCall,anchor:euDOWN,offsetX:0,offsetY:-12}}],{link:imglink});}
FavMan.registeredIds.push({id:favoriteObj.developmentid,elem:newIcon});FavMan.updateFavoriteCounter();if(!isLoadingData)
{UserProfile.AddFavoriteDevelopment(favoriteObj.developmentid);}}},removeDevelopment:function(developmentId)
{for(var idx=0;idx<FavMan.registeredIds.length;idx++)
{if(FavMan.registeredIds[idx].id==developmentId)
{if(window.dockbar&&fwk.EUDOCK_VIS&&fwk.EUDOCK)
{window.dockbar.delIcon(FavMan.registeredIds[idx].elem);}
FavMan.registeredIds.splice(idx,1);if(Identity.GetLoginID()!==null)
{UserProfile.RemoveFavoriteDevelopment(developmentId);}
break;}}
FavMan.updateFavoriteCounter();FavMan.updateAllFavoritesLinksOnPage();},updateFavoriteCounter:function()
{var favCounter=$('dyn_fav_counter');if(favCounter)
{favCounter.innerHTML=FavMan.registeredIds.length;}},containsDevelopment:function(devId)
{var retVal=false;for(var idx=0;idx<FavMan.registeredIds.length;idx++)
{if(FavMan.registeredIds[idx].id==devId)
{retVal=true;break;}}
return retVal;},clearAllDevelopments:function()
{if(fwk.EUDOCK&&fwk.EUDOCK_VIS)
{for(var idx=0;idx<FavMan.registeredIds.length;idx++)
{window.dockbar.delIcon(FavMan.registeredIds[idx].elem);}}
FavMan.registeredIds=[];FavMan.updateAllFavoritesLinksOnPage();},handleFavoritesLinkClick:function(favoriteLink)
{if(!FavMan.containsDevelopment(favoriteLink.favoriteObj.developmentid))
{FavMan.addDevelopment(favoriteLink.favoriteObj);}
else
{FavMan.removeDevelopment(favoriteLink.favoriteObj.developmentid);}
FavMan.updateFavoritesLink(favoriteLink);},updateFavoritesLink:function(favoriteLink)
{if(!favoriteLink||!favoriteLink.favoriteObj){return;}
favoriteLink=$(favoriteLink);if(FavMan.containsDevelopment(favoriteLink.favoriteObj.developmentid))
{favoriteLink.innerHTML='Remove Favorite';favoriteLink.addClassName('dyn_rem_fav');favoriteLink.removeClassName('dyn_add_fav');}
else
{favoriteLink.innerHTML='Add to Favorites';favoriteLink.addClassName('dyn_add_fav');favoriteLink.removeClassName('dyn_rem_fav');}},updateAllFavoritesLinksOnPage:function()
{var devContainers=$A($('container').select('.dev'));if($('developmentDetailsWrapper')){devContainers.push($('developmentDetailsWrapper'));}
devContainers.each(function(displayedDev)
{var saveLinks=$(displayedDev).select('.dyn_link_save');for(var i=0;i<saveLinks.length;i++)
{FavMan.updateFavoritesLink(saveLinks[i]);}});}};var FeatureDevLoader={startIndex:0,populateFeaturedDevelopments:function(featuredDevs)
{var wrappers=$('inner').select('.feature_dev_wrapper');for(var wrapperIdx=0;wrapperIdx<wrappers.length;wrapperIdx++)
{var devDiv=wrappers[wrapperIdx];Utl.clearAllChildren(devDiv);for(i=0;i<featuredDevs.length;i++)
{if(i<FeatureDevLoader.startIndex)continue;if(i>FeatureDevLoader.endIndex)break;var newFeatureItem=Formatter.format_development(featuredDevs[i],'featured_development_template',false,false);devDiv.appendChild(newFeatureItem);}}}};var FileMan={currentImageID:0,loadFileMan:function(developmentID,imgWrapper,fileWrapper)
{developmentID=developmentID||ViewMan.development.developmentid;imgWrapper=imgWrapper||$('viewdev_imageList');fileWrapper=fileWrapper||$('fileList');FileManager.LoadFilesInFolderAsList_('dev/'+developmentID,function(result){FileMan.populateFileList(result,'dev/'+developmentID,imgWrapper,fileWrapper);});},loadDevelopmentFiles:function(developmentID,wrapper)
{if(wrapper.down('.dyn_dev_images')||wrapper.down('.dyn_dev_files'))
{FileManager.LoadFilesInFolderAsList_('dev/'+developmentID,function(result){FileMan.populateFileList(result,'dev/'+developmentID,wrapper.down('.dyn_dev_images'),wrapper.down('.dyn_dev_files'));});}},loadPropertyFiles:function(propertyID,wrapper)
{if(wrapper.down('.dyn_prop_images')||wrapper.down('.dyn_prop_files'))
{FileManager.LoadFilesInFolderAsList_('prop/'+propertyID,function(result){FileMan.populateFileList(result,'prop/'+propertyID,wrapper.down('.dyn_prop_images'),wrapper.down('.dyn_prop_files'));});}},loadAuctionFiles:function(auctionID,wrapper)
{if(wrapper.down('.dyn_auc_images')||wrapper.down('.dyn_auc_files'))
{FileManager.LoadFilesInFolderAsList_('auc/'+auctionID,function(result){FileMan.populateFileList(result,'auc/'+auctionID,wrapper.down('.dyn_auc_images'),wrapper.down('.dyn_auc_files'));});}},loadSingleAuctionImage:function(auctionID,wrapper)
{var thumbWrap=(wrapper.select('.dyn_auc_thumb').length>0)?wrapper.select('.dyn_auc_thumb')[0]:null;var lThumbWrap=(wrapper.select('.dyn_auc_largethumb').length>0)?wrapper.select('.dyn_auc_largethumb')[0]:null;var imageWrap=(wrapper.select('.dyn_auc_image').length>0)?wrapper.select('.dyn_auc_image')[0]:null;if(thumbWrap||lThumbWrap||imageWrap)
{FileManager.LoadFilesInFolderAsList_('auc/'+auctionID,function(result){FileMan.populateImage(result,thumbWrap,lThumbWrap,imageWrap);});}},loadSingleAccountImage:function(accountID,wrapper)
{var thumbWrap=(wrapper.select('.dyn_acc_thumb').length>0)?wrapper.select('.dyn_acc_thumb')[0]:null;var lThumbWrap=(wrapper.select('.dyn_acc_largethumb').length>0)?wrapper.select('.dyn_acc_largethumb')[0]:null;var imageWrap=(wrapper.select('.dyn_acc_image').length>0)?wrapper.select('.dyn_acc_image')[0]:null;if(thumbWrap||lThumbWrap||imageWrap)
{FileManager.LoadFilesInFolderAsList_('acc/'+accountID,function(result){FileMan.populateImage(result,thumbWrap,lThumbWrap,imageWrap);});}},populateImage:function(fileList,thumb,largeThumb,image)
{var populate=function(ele,src)
{ele.src=FileServer_ImagePath+imgUtl.forceForwardSlash(src);ele.show();};for(var fileIdx=0;fileIdx<fileList.length;fileIdx++)
{var curFile=fileList[fileIdx];if(curFile.folderpath.indexOf('images')>0)
{if(largeThumb)
{populate(largeThumb,'large_thumbs/'+curFile.folderpath+curFile.filename);}
if(thumb)
{populate(thumb,'thumbs/'+curFile.folderpath+curFile.filename);}
if(image)
{populate(image,curFile.folderpath+curFile.filename);}
break;}}},populateFileList:function(fileList,folder,imgDisplayList,fileDisplayList)
{var imgRowCount=0;var fileRowCount=0;if(imgDisplayList){Utl.clearAllChildren(imgDisplayList);}
if(fileDisplayList){Utl.clearAllChildren(fileDisplayList);}
FileManager.SortFileListByTag(fileList);for(var fileIdx=0;fileIdx<fileList.length;fileIdx++)
{var curFile=fileList[fileIdx];curFile.folderpath=imgUtl.forceForwardSlash(curFile.folderpath);if(curFile.folderpath.indexOf('/images/')>0&&imgDisplayList)
{imgDisplayList.appendChild(FileMan.format_viewImage(curFile,folder,imgRowCount++));}
else if(fileDisplayList)
{fileDisplayList.appendChild(FileMan.format_viewFile(curFile,fileRowCount++));}}},format_viewImage:function(anImageFile,grouping)
{var ourInstance=Utl.getInstanceOfTemplate("template_view_dev_image",true,false);if(!ourInstance){return;}
var imagepath=anImageFile.folderpath+anImageFile.filename,tooltip=(window.ViewMan&&ViewMan.development)?ViewMan.development.name:'';ourInstance.rel='lightbox['+grouping.replace(/\\/g,'-')+']';ourInstance.href=FileServer_ImagePath+imgUtl.forceForwardSlash(imagepath);ourInstance.title=tooltip;var img=ourInstance.select('.dyn_image')[0];img.src=FileServer_ImagePath+'thumbs/'+imgUtl.forceForwardSlash(imagepath);img.title=tooltip;img.alt=tooltip;return ourInstance;},format_viewFile:function(aFile,rowIdx)
{var ourInstance=Utl.getInstanceOfTemplate("template_dev_filelist",true,false);if(!ourInstance){return;}
if(Utl.isEven(rowIdx))
{ourInstance.addClassName('alt-row');}
UtilPop.setField(ourInstance.select('.dyn_fileName')[0],aFile.filename);var filePath=FileServer_FilePath+imgUtl.forceForwardSlash(aFile.folderpath)+aFile.filename;var preview=ourInstance.select('.dyn_filepreview')[0];preview.title='Click here to download the file';preview.href=filePath;preview.target='_blank';var fileType=ourInstance.select('.dyn_fileType')[0];fileType.src=imgUtl.getFileIconImage(aFile);return ourInstance;}};var google_conversion_id=1043094857;var google_conversion_language="en_US";var google_conversion_format="1";var google_conversion_color="ffffff";var google_conversion_label="xG1QCJ3RRRDJurHxAw";window.gc={regConversionOccured:function()
{var trackpixel=$(document.createElement('img'));trackpixel.setStyle({height:'1px',width:'20px'});trackpixel.src='http://www.googleadservices.com/pagead/conversion/1043094857/?label=xG1QCJ3RRRDJurHxAw&script=0';$('masthead').appendChild(trackpixel);}};var LoginControl={Show:function(callback,cancelcallback)
{var dialog=Utl.getInstanceOfTemplate('login_dialogue_template',false,false);var loginname=Cookie.ReadCookie('persist');var focusFieldClassName;if(loginname)
{focusFieldClassName='dyn_password';dialog.select('.dyn_username')[0].setAttribute('value',loginname);dialog.select('.dyn_chkPersistLogin')[0].setAttribute('checked',true);}
else
{focusFieldClassName='dyn_username';}
Dlg.ShowPreformatted(dialog,{ok_handler:LoginControl.AttempLogin,but_cancel:true,focusFieldClassName:focusFieldClassName,callback:callback,cancel_handler:cancelcallback});},AttempLogin:function()
{var form=Dlg.modalDialogue.element;var username=form.getElementsByClassName('dyn_username')[0];var password=form.getElementsByClassName('dyn_password')[0];validator=new Validator();validator.addItem(username,{required:true});if(!validator.validate())
{Dlg.stopProcessing();Dlg.setResponse(validator.validationErrorsAsList());}
else if(fwk.isExternal)
{jsonP.loadData('http://uc/webservices/cmaeon/realestate/auth.asmx/AuthenticateExternal?userName='+username.value+'&password='+password.value,LoginControl.ValidateAuthHandler);}
else
{UserProfile.Authenticate(username.value,password.value,LoginControl.ValidateAuthHandler);}},ValidateAuthHandler:function(response)
{Dlg.stopProcessing();var username=Dlg.modalDialogue.element.getClassValue('dyn_username');var persist=Dlg.modalDialogue.element.getClassValue('dyn_chkPersistLogin',false);if(!response||response.statuscode==9999)
{Dlg.setResponse(fwk.AJAX_FAILURE_MESSAGE);}
else if(response.statuscode==5||response.statuscode==11||response.statuscode==12)
{LoginControl.userStatus=response.statuscode;var callback=Dlg.callback;LoginControl.ValidateAuth(persist);if(callback){callback.defer();}}
else if(response.statuscode==1)
{Dlg.setResponse('Login failed: Invalid user name or password');}
else if(response.statuscode==10)
{TemplatedDialogue.Show_ChangePassword(username,persist,true,Dlg.callback);}
else
{Dlg.setResponse(fwk.AJAX_FAILURE_MESSAGE);}},Logout:function()
{Cookie.EraseCookie('identity');UserProfile.Unauthenticate(LoginControl.unAuthHandler);},unAuthHandler:function()
{if(location.href.toLowerCase().indexOf('/admin')>0||location.href.toLowerCase().indexOf('/profile')>0||location.href.toLowerCase().indexOf('/myprofile')>0||location.href.toLowerCase().indexOf('/manage')>0)
{location='/';}
LoginControl.UpdateCurAuth();},ValidateAuth:function(persist)
{if(persist)
{Cookie.CreateCookie('persist',Identity.GetLoginName(),720);}
else
{Cookie.EraseCookie('persist');}
LoginControl.UpdateCurAuth();},UpdateCurAuth:function(noModal)
{if(!noModal)
{if(Identity.GetLoginName()!==null)
{Dlg.ShowProgress('loading personal infomation');}
else
{Dlg.ShowProgress('unloading personal infomation');}}
var execAuthChange=function()
{LoginControl.updateLoginDisplay();if(window.FavMan)
{FavMan.delayedInit();}
if(window.Footer)
{Footer.upateFooterProfileImg();}
if(window.ViewMan)
{ViewMan.authChangeHandler();}
if(window.BidMan)
{BidMan.authChangeHandler();}
if(window.CheckoutMan)
{CheckoutMan.authChangeHandler();}
if(window.RegUser&&RegUser.updateForm)
{RegUser.updateForm();}
if(window.SellerReg)
{SellerReg.authChangeHandler();}
if(!noModal)
{Dlg.hide();}};execAuthChange.defer();},updateLoginDisplay:function()
{var i=0;var loginDiv=$('masthead');if(loginDiv)
{var authElems=loginDiv.select('.auth');var noauthElems=loginDiv.select('.noauth');if(Identity.GetLoginName()!==null)
{for(i=0;i<authElems.length;i++)
{authElems[i].show();}
for(i=0;i<noauthElems.length;i++)
{noauthElems[i].hide();}
if(!Identity.IsConfirmed())
{if(Identity.IsQuickReg())
{$('confirm_Link').href='/registerconfirmation/quick/';}
$('confirm_Link').show();}}
else
{for(i=0;i<authElems.length;i++)
{authElems[i].hide();}
for(i=0;i<noauthElems.length;i++)
{noauthElems[i].show();}
if($('confirm_Link'))
{$('confirm_Link').hide();}}}
if(window.SearchHandler)
{if(Identity.GetLoginName()!==null)
{SearchHandler.asyncLoginHandler();}
else
{SearchHandler.asyncLogoutHandler();}}
if($('datamanage_link'))
{if(Identity.ContainsRole('datamanager')||Identity.ContainsRole('auctionmanager'))
{$('datamanage_link').show();}
else
{$('datamanage_link').hide();}}
if($('admin_link'))
{if(Identity.ContainsRole('superadmin'))
{$('admin_link').show();}
else
{$('admin_link').hide();}}
UtilPop.setField($('lgn_name'),Identity.GetLoginName(),'');},hide:function()
{Dlg.hide();},getPersistState:function()
{return Cookie.ReadCookie('persist')!==null;}};var MapMan={points:[],resultcount:0,mapper:null,readyToDraw:false,autocompleter:null,lastValue:'',isLoaded:false,searchQuery:null,init:function(searchOverride)
{MapMan.isLoaded=true;$('content').select('.mapsearch_back').each(function(button)
{Event.observe(button,'click',MapMan.onBackClick);});if(searchOverride=='current-auctions')
{return MapMan.performSearchCurrentAuctions();}
var curSearch=SearchInput.readSearchQueryCookie();if(curSearch&&curSearch.length>0)
{MapMan.searchQuery=SearchInput.convertRawSearchQueryToJSON(curSearch);if(SearchInput.isLoaded===true)
{MapMan.performSearch(curSearch);}
else
{if(!window.onSearchInputLoaded)
{window.onSearchInputLoaded=[];}
window.onSearchInputLoaded.push(function()
{MapMan.performSearch(curSearch);});}}
else if(window.fwk&&fwk.DEFAULT_SEARCH_TEXT)
{MapMan.performSearch('"inpval": "\\\"'+fwk.DEFAULT_SEARCH_TEXT+'\\\" :X:","kwall": true,"incname": false');}},performSearch:function(queryString,noSave)
{SearchInput.disableSearchInputs();if(!noSave)
{SearchInput.storeSearchQueryCookie(queryString,SearchInput.currentQueryID);}
$('mapsearch_loading').show();if($('res_mapsearch_result_count'))
{$('res_mapsearch_result_count').innerHTML='Loading...';}
var query=new SearchQuery();query.setRawQuery(queryString);SearchQuery.LoadPointSearchResults(query,function(result){MapMan.lastResult=result;MapMan.loadPointsHandler(result,noSave);});},performSearchOnArea:function()
{var bounds=MapMan.mapper.map.getBounds();var sw=bounds.getSouthWest();var ne=bounds.getNorthEast();MapMan.performSearch(SearchInput.buildRawSearchQuery()+', "minLat": '+sw.lat()+', "minLng": '+sw.lng()+', "maxLat": '+ne.lat()+', "maxLng": '+ne.lng());return('"minLat":'+sw.lat()+', "minLng":'+sw.lng()+', "maxLat":'+ne.lat()+', "maxLng":'+ne.lng());},performAnonymousSearch:function(searchText)
{MapMan.performSearch('"inpval": "'+searchText+' :X:","kwall": false,"incname": false',true);},performSearchCurrentAuctions:function()
{var auctions=Auction.GetCurrentAuctions(AucMan.auctions).concat(AucMan.GetUpcomingAuctions(AucMan.auctions));var searchText='';if(fwk.SEARCH_VER>1)
{auctions.each(function(auction){searchText+='\\\"'+auction.tagname+'\\\" ';});}
else
{auctions.each(function(auction){searchText+=auction.tagname+', ';});}
MapMan.performSearch('"inpval": "'+searchText+' :X:","kwall": false,"incname": false',true);},loadPointsHandler:function(result,noSave)
{if(result&&result.SearchResults)
{if(result.SearchResults.regular)
{MapMan.points=result.SearchResults.regular;}
else
{MapMan.points=result.SearchResults;}
MapMan.resultcount=result.ResultCount;SearchInput.currentQueryID=result.SearchQueryID;if(MapMan.mapper)
{MapMan.updateMarkers.defer();}
var value=[];for(i=0;i<MapMan.points.length;i++)
{value.push(MapMan.points[i].id);}
if(!noSave)
{SearchInput.storeSearchQueryCookie(SearchInput.readSearchQueryCookie(),SearchInput.currentQueryID);SearchInput.storeSearchResultCookie(1,MapMan.pageSize,MapMan.points.length,'default DESC',value);}}
else if($('res_mapsearch_result_count'))
{$('res_mapsearch_result_count').innerHTML='There was an error proccessing your search, please try again.';}
SearchInput.enableSearchInputs();},makeOverlay:function()
{return new GTileLayerOverlay(new GTileLayer(new GCopyrightCollection("CMaeoN"),null,null,{tileUrlTemplate:'http://mlt0.google.com/mapslt?lyrs=transit&w=256&h=256&x={X}&y={Y}&z={Z}',isPng:true,opacity:1.0}));},onGoogleLoad:function()
{MapMan.mapper=new CmaeonGmaps('',{clustered:true,disableMapControl:false,disableMapTypeControl:false,disableScrollZoom:true,enableOverviewMapControl:true,hideOverviewMapControl:window.location.pathname.indexOf('auction')>=0,enableWaypointControl:true,iconColor:'#EE0000',clusterMarkerClick:MapMan.clusterMarkerClick});MapMan.mapper.updateOverlay();MapMan.addCustomOverlays.defer();GEvent.addListener(MapMan.mapper.map,"moveend",MapMan.FilterResults);GEvent.addListener(MapMan.mapper.map,"zoomend",MapMan.FilterResults);if(!fwk.isLoaded)
{fwk.addOnLoadCallback(MapMan.init);}
else if(!MapMan.isLoaded)
{MapMan.init();}
MapMan.isLoaded=true;},addCustomOverlays:function()
{MapMan.mapper.map.addOverlay(new EInsert(new GLatLng(48.47755,-123.52264),"http://map.bearmountain.ca/mapimages/map-zoom12.png",new GSize(105,123.125),12,0,12,12));MapMan.mapper.map.addOverlay(new EInsert(new GLatLng(48.47755,-123.52264),"http://map.bearmountain.ca/mapimages/map-zoom13.png",new GSize(210,246.25),13,0,13,13));MapMan.mapper.map.addOverlay(new EInsert(new GLatLng(48.47755,-123.52264),"http://map.bearmountain.ca/mapimages/map-zoom14.png",new GSize(420,492.5),14,0,14,14));MapMan.mapper.map.addOverlay(new EInsert(new GLatLng(48.47755,-123.52264),"http://map.bearmountain.ca/mapimages/map-zoom15.png",new GSize(840,985),15,0,15,15));MapMan.mapper.map.addOverlay(new EInsert(new GLatLng(48.47755,-123.52264),"http://map.bearmountain.ca/mapimages/map-zoom16.png",new GSize(1680,1970),16,0,16,20));},FilterResults:function()
{$('mapsearch_loading').hide();var wrapper=$('mapsearch_listing_wrapper');if(wrapper)
{Utl.clearAllChildren(wrapper);var devRow=null;var bounds=MapMan.mapper.map.getBounds();var resultCount=$('res_mapsearch_result_count');var searchInputValue=(MapMan.searchQuery&&MapMan.searchQuery.inpval)?MapMan.searchQuery.inpval.replace(/:X:/g,''):SearchInput.defaultText;if(resultCount)
{if(searchInputValue!=SearchInput.defaultText)
{resultCount.innerHTML="You're currently searching "+searchInputValue+", showing "+MapMan.mapper.countMarkersInBounds()+" of "+MapMan.resultcount+" results.";}}
else
{resultCount.innerHTML="Your search results, showing "+MapMan.mapper.countMarkersInBounds()+" of "+MapMan.resultcount+" results.";}
if(MapMan.resultcount>1000)
{resultCount.innerHTML+='<br />Try to refine your search for more accurate results.';}
var formatter=MapMan.points.location?Formatter.format_development:Formatter.format_development_;for(var i=0;(i<MapMan.points.length)&&(wrapper.childElements().length<=10);i++)
{if(!bounds.contains(MapMan.mapper.getLatLng(MapMan.points[i].Location)))
{continue;}
devRow=formatter(MapMan.points[i],'template_dev_listing',true,false,false);devRow.select('.dyn_name').each(function(item){item.truncate(45);});devRow.select('.dyn_shortlocation').each(function(item){item.truncate(35);});devRow.select('.dyn_price').each(function(item){item.truncate(30);});if(wrapper.childElements().length%2==1){devRow.addClassName('altRow');}
devRow.select('.dyn_link_view_onmap').each(function(link)
{link.point=MapMan.points[i];Event.observe(link,'click',function(event)
{var ele=Event.element(event);var point=ele.point?ele.point:ele.up().point;MapMan.mapper.addPointHistory();var maxZoom=MapMan.mapper.map.getCurrentMapType().getMaximumResolution();if(MapMan.mapper.map.getZoom()<maxZoom)
{MapMan.mapper.map.setCenter(MapMan.mapper.getLatLng(point.Location),maxZoom);}
MapMan.markerClick.defer(MapMan.mapper.findMarkerWithID(point.id));});});wrapper.appendChild(devRow);}}},updateMarkers:function()
{if(MapMan.mapper&&MapMan.mapper.map.isLoaded())
{MapMan.mapper.clearMarkers();MapMan.mapper.map.closeInfoWindow();MapMan.mapper.addMarkers(MapMan.points,MapMan.markerClick);if(MapMan.mapper.allmarkers&&MapMan.mapper.allmarkers.length==1)
{MapMan.markerClick(MapMan.mapper.allmarkers[0]);}
else if($('res_mapsearch_result_count')&&MapMan.mapper.allmarkers&&MapMan.mapper.allmarkers.length===0)
{$('res_mapsearch_result_count').innerHTML='Your search returned 0 results. Please refine your search.';}}},clusterMarkerClick:function(cluster,objectIDs,objectType)
{if(cluster&&objectIDs&&objectIDs.length>0)
{if(objectType=='Development')
{Development.LoadMarkerInfo(cluster,objectIDs.join(),MapMan.markerClickHandler);}}
else if(objectType=='Property')
{Development.LoadMarkerInfoByProperty(cluster,objectIDs.join(),MapMan.markerClickHandler);}},markerClick:function(marker)
{if(!marker){return;}
if(marker.objectType=='Development')
{Development.LoadMarkerInfo(marker,marker.objectID,MapMan.markerClickHandler);}
else if(marker.objectType=='Property')
{Development.LoadMarkerInfoByProperty(marker,marker.objectID,MapMan.markerClickHandler);}},markerClickHandler:function(marker,response)
{if(response&&response.status)
{if(response.devs.length==1)
{MapMan.mapper.map.openInfoWindowHtml(marker.getLatLng(),Formatter.format_development_(response.devs[0],'template_dev_info_window',false,false,false));}
else if(response.devs.length>1)
{var tabs=[];for(var i=0;i<response.devs.length;i++)
{tabs.push(new GInfoWindowTab(i+1,Formatter.format_development_(response.devs[i],'template_dev_info_window',false,false,false)));}
MapMan.mapper.map.openInfoWindowTabs(marker.getLatLng(),tabs);}}}};var SearchInput={isLoaded:false,modalId:'search_input_modal',modal:null,currentQueryID:'-1',inputValues:null,selectedCityID:null,selectedSPID:null,delimit:':X:',idListAsCSV:null,quickSearchText:'',init:function()
{SearchQuery.LoadInputOptions(SearchInput.populateSearchInput);if(!$('search_input')){return;}
$('search_input_input').observe('keypress',function(event)
{if(event.keyCode==Event.KEY_RETURN)
{SearchInput.onPerformSearch();}});SearchInput.modal=$(SearchInput.modalId);},onPerformSearch:function(searchType,searchQuery)
{if(window.SearchHandler)
{SearchInput.currentQueryID='-1';SearchHandler.searchQuery=searchQuery||SearchInput.buildRawSearchQuery();SearchHandler.performSearch(true);}
else if(window.MapSearchHandler)
{SearchInput.currentQueryID='-1';MapMan.performSearch(searchQuery||SearchInput.buildRawSearchQuery());}
else
{SearchInput.storeSearchQueryCookie(SearchInput.buildRawSearchQuery(),'-1');if(fwk.DEFAULT_TO_MAPSEARCH&&searchType!='list')
{window.location='/mapsearch/';}
else
{window.location='/search/';}}},disableSearchInputs:function()
{if($('search_button'))
{$('search_button').disabled=true;}
SearchInput.onHide();},enableSearchInputs:function()
{if($('search_button'))
{$('search_button').disabled=false;}},buildRawSearchQueryFromUrl:function(params)
{var sb=new StringBuilder();params=params.replace('?','');params=params.split('&');for(var i=0;i<params.length;i++)
{params[i]=params[i].split('=');if(params[i][0]==''||params[i][1]==''){continue;}
if(params[i][0]=='kw'||params[i][0]=='tag')
{sb.append('"inpval": "');sb.append(unescape(params[i][1].replace('+',' ').replace(/;|\||/g,'').replace(/"/g,'\\\"')));sb.append(SearchInput.delimit);sb.append('",');}
else if(params[i][0]=='pt')
{sb.append('"pt": [');sb.append(params[i][1].replace(/;|\||/g,'').replace(/"/g,'\\\"'));sb.append('],');}
else
{sb.append('"');sb.append(params[i][0]);sb.append('": ');sb.append(params[i][1].replace(/;|\||/g,'').replace(/"/g,'\\\"'));sb.append(',');}}
var retVal=sb.toString();if(retVal.indexOf('incname')<0)
{retVal+='"incname": true';}
else
{retVal=retVal.substr(0,retVal.length-1);}
return retVal;},buildRawSearchQuery:function()
{var sb=new StringBuilder();var inpValue=$('search_input_input')?Utl.trim($('search_input_input').value):SearchInput.quickSearchText;if(inpValue.length!==0&&inpValue!=SearchInput.defaultText)
{sb.append('"inpval": "');sb.append(inpValue.replace(/;|\||/g,'').replace(/"/g,'\\\"'));sb.append(SearchInput.delimit);sb.append('"');sb.append(',');sb.append('"kwall": ');sb.append($('matchAllWords')?$('matchAllWords').checked.toString():'false');sb.append(',');sb.append('"incname": ');sb.append($('includeNameInSearch')?$('includeNameInSearch').checked.toString():'true');sb.append(',');}
var locString;var cntrySel=$('search_input_country');if(cntrySel&&cntrySel.selectedIndex>1)
{sb.append('"ctry": ');sb.append(cntrySel.options[cntrySel.selectedIndex].value);sb.append(',');locString=cntrySel.options[cntrySel.selectedIndex].text;}
var spSel=$('search_input_stateprov');if(spSel&&spSel.selectedIndex>1)
{sb.append('"sp": ');sb.append(spSel.options[spSel.selectedIndex].value);sb.append(',');locString=spSel.options[spSel.selectedIndex].text+', '+locString;}
var citySel=$('search_input_city');if(citySel&&citySel.selectedIndex>1)
{sb.append('"cty": ');sb.append(citySel.options[citySel.selectedIndex].value);sb.append(',');locString=citySel.options[citySel.selectedIndex].text+' '+locString;}
if(locString&&locString.length&&locString.length>0)
{sb.append('"locdsp": "');sb.append(locString);sb.append('"');sb.append(',');}
var minPrcSel=$('search_input_price_min');if(minPrcSel&&minPrcSel.selectedIndex>1)
{sb.append('"minP": ');sb.append(minPrcSel.options[minPrcSel.selectedIndex].value);sb.append(',');}
var maxPrcSel=$('search_input_price_max');if(maxPrcSel&&maxPrcSel.selectedIndex>1)
{sb.append('"maxP": ');sb.append(maxPrcSel.options[maxPrcSel.selectedIndex].value);sb.append(',');}
var bedsSel=$('search_input_beds');if(bedsSel&&bedsSel.selectedIndex>1)
{sb.append('"beds": ');sb.append(bedsSel.options[bedsSel.selectedIndex].value);sb.append(',');}
var bathsSel=$('search_input_baths');if(bathsSel&&bathsSel.selectedIndex>1)
{sb.append('"baths": ');sb.append(bathsSel.options[bathsSel.selectedIndex].value);sb.append(',');}
var propTypeSb=new StringBuilder();var propTypeInput=$('search_input_proptype');if(propTypeInput)
{var propTypeInputs=propTypeInput.select('[class="si_input"]');for(i=0;i<propTypeInputs.length;i++)
{if(propTypeInputs[i].checked===true)
{propTypeSb.append(propTypeInputs[i].value);propTypeSb.append(',');}}
if(propTypeSb.strings.length>1)
{sb.append('"pt": [');propTypeSb.popLast();sb.append(propTypeSb.toString());sb.append(']');sb.append(',');}}
var propViewTypeSb=new StringBuilder();var propViewTypeInput=$('search_input_view');if(propViewTypeInput)
{var propViewTypeInputs=propViewTypeInput.select('[class="si_input"]');for(i=0;i<propViewTypeInputs.length;i++)
{if(propViewTypeInputs[i].checked===true)
{propViewTypeSb.append('"');propViewTypeSb.append(propViewTypeInputs[i].up('label').className);propViewTypeSb.append('"');propViewTypeSb.append(',');}}
if(propViewTypeSb.strings.length>1)
{sb.append('"view": [');propViewTypeSb.popLast();sb.append(propViewTypeSb.toString());sb.append(']');sb.append(',');}}
var nhSb=new StringBuilder();var nhInput=$('search_input_neighborhood');if(nhInput)
{var nhInputs=nhInput.select('[class="si_input"]');for(i=0;i<nhInputs.length;i++)
{if(nhInputs[i].checked===true)
{nhSb.append(nhInputs[i].idValue);nhSb.append(',');}}
if(nhSb.strings.length>1)
{sb.append('"nh": [');nhSb.popLast();sb.append(nhSb.toString());sb.append(']');sb.append(',');}}
if(SearchInput.idListAsCSV)
{sb.append('"idlist": [');sb.append(SearchInput.idListAsCSV);sb.append(']');sb.append(',');SearchInput.idListAsCSV=null;}
if(sb.strings.length>1){sb.popLast();}
return sb.toString();},convertRawSearchQueryToJSON:function(searchQuery)
{var sq=null;try
{if(searchQuery)
{sq=('{'+searchQuery+'}').evalJSON(true);}}
catch(e)
{}
return sq;},populateFromRawSearchQuery:function(searchQuery,queryID)
{var sq=SearchInput.convertRawSearchQueryToJSON(searchQuery);if(!sq||sq===null){return;}
if(sq.inpval&&$('search_input_input'))
{$('search_input_input').value=sq.inpval.replace(SearchInput.delimit,'');}
SearchInput.currentQueryID=sq.searchqueryid||queryID||'-1';var matchAnyWords=$('matchAnyWords');if(matchAnyWords)
{if(sq.kwall===false)
{matchAnyWords.checked=true;}
else if(sq.kwall===true)
{matchAnyWords.checked=true;}}
var includeNameInSearch=$('includeNameInSearch');if(includeNameInSearch)
{if(sq.incname===false)
{includeNameInSearch.checked=false;}
else
{includeNameInSearch.checked=true;}}
if(sq.ctry)
{if(sq.sp)
{SearchInput.selectedSPID=sq.sp;}
if(sq.cty)
{SearchInput.selectedCityID=sq.cty;}
var cntrySel=$('search_input_country');if(cntrySel)
{for(i=2;i<cntrySel.options.length;i++)
{if(cntrySel.options[i].value==sq.ctry)
{cntrySel.options[i].selected=true;break;}}
SearchInput.updateCountry(cntrySel);}}
if(sq.minP||sq.minP>=0)
{var minPSel=$('search_input_price_min');if(minPSel)
{for(i=2;i<minPSel.options.length;i++)
{if(minPSel.options[i].value==sq.minP)
{minPSel.options[i].selected=true;break;}}}}
if(sq.maxP||sq.maxP>=0)
{var maxPSel=$('search_input_price_max');if(maxPSel)
{for(i=2;i<maxPSel.options.length;i++)
{if(maxPSel.options[i].value==sq.maxP)
{maxPSel.options[i].selected=true;break;}}}}
if(sq.beds||sq.beds>=0)
{var bedsSel=$('search_input_beds');if(bedsSel)
{for(i=2;i<bedsSel.options.length;i++)
{if(bedsSel.options[i].value==sq.beds)
{bedsSel.options[i].selected=true;break;}}}}
if(sq.baths||sq.baths>=0)
{var bathsSel=$('search_input_baths');if(bathsSel)
{for(i=2;i<bathsSel.options.length;i++)
{if(bathsSel.options[i].value==sq.baths)
{bathsSel.options[i].selected=true;break;}}}}
if(sq.pt)
{var propTypeInput=$('search_input_proptype');if(propTypeInput)
{var propTypeInputs=propTypeInput.select('[class="si_input"]');if(propTypeInputs)
{for(i=0;i<propTypeInputs.length;i++)
{if(sq.pt.indexOf(parseInt(propTypeInputs[i].value,10))>=0)
{propTypeInputs[i].checked=true;}}}}}
if(sq.nh)
{var nhInput=$('search_input_neighborhood');if(nhInput)
{var nhInputs=nhInput.select('[class="si_input"]');for(i=0;i<nhInputs.length;i++)
{if(sq.nh.indexOf(parseInt(nhInputs[i].idValue,10))>=0)
{nhInputs[i].checked=true;}}}}},old_performSingleKeywordSearch:function(tagValue,searchType)
{SearchInput.reset();SearchInput.quickSearchText=tagValue;if($('search_input_input')){$('search_input_input').value=SearchInput.quickSearchText;}
SearchInput.onPerformSearch(searchType);},performSingleKeywordSearch:function(tagValue,searchType)
{if(fwk.SEARCH_VER>=2)
{SearchInput.reset();SearchInput.quickSearchText='"'+tagValue+'"';if($('search_input_input')){$('search_input_input').value=SearchInput.quickSearchText;}
SearchInput.onPerformSearch(searchType);}
else
{SearchInput.old_performSingleKeywordSearch(tagValue,searchType);}},performMultiKeywordSearch:function(tagValue1,tagValue2,tagValue3,tagValue4,tagValue5)
{SearchInput.reset();var tagValues='"'+tagValue1+'" ';if(tagValue2)
{tagValues+='"'+tagValue2+'" ';}
if(tagValue3)
{tagValues+='"'+tagValue3+'" ';}
if(tagValue4)
{tagValues+='"'+tagValue4+'" ';}
if(tagValue5)
{tagValues+='"'+tagValue5+'" ';}
if($('search_input_input'))
{$('search_input_input').value=tagValues;}
SearchInput.onPerformSearch();},performIDSearch:function(idsAsCSV)
{SearchInput.reset();SearchInput.idListAsCSV=idsAsCSV;SearchInput.onPerformSearch();},clearSearchResults:function()
{if(fwk.PROD_KEY=='LHA')
{Dlg.ShowRedirect('Clearing search results','/auctions/');}
else if(window.SearchHandler)
{SearchHandler.clearSearchResults();}
else
{Dlg.ShowRedirect('Clearing search results','/newsearch/');}
SearchInput.onHide();},reset:function()
{if($('search_input_input')){$('search_input_input').value=SearchInput.defaultText||'';}
if($('includeNameInSearch')){$('includeNameInSearch').checked=true;}
if($('matchAllWords')){$('matchAllWords').checked=true;}
var cntrySel=$('search_input_country');if(cntrySel){cntrySel.options[0].selected=true;}
SearchInput.selectedCityID=null;SearchInput.selectedSPID=null;if(cntrySel){SearchInput.updateCountry(cntrySel);}
if($('search_input_price_min')){$('search_input_price_min').options[0].selected=true;}
if($('search_input_price_max')){$('search_input_price_max').options[0].selected=true;}
if($('search_input_beds')){$('search_input_beds').options[0].selected=true;}
if($('search_input_baths')){$('search_input_baths').options[0].selected=true;}
var searchInputModal=$(SearchInput.modalId)||$('container');if(searchInputModal)
{var allInputs=searchInputModal.select('[class="si_input"]');for(i=0;i<allInputs.length;i++)
{allInputs[i].checked=false;}}
SearchInput.storeSearchQueryCookie('');},storeSearchQueryCookie:function(value,queryid)
{if(value&&value.length>0)
{value=value.replace(/\"searchqueryid\":[\-]?\d+,/g,'');value='"searchqueryid":'+queryid+','+value;}
value=value.replace(/"/g,'|');Cookie.CreateCookie('cursearch',value);},readSearchQueryCookie:function()
{var ckVal=Cookie.ReadCookie('cursearch');if(ckVal)
{ckVal=ckVal.replace(/\|/g,'"');}
else
{ckVal='';}
return ckVal;},storeSearchResultCookie:function(pageNumber,pageSize,totalResults,sort,idsAsCSV,searchreturn)
{searchreturn=searchreturn?searchreturn:'';var rsltString='"searchqueryid":'+SearchInput.currentQueryID+',"pagenumber":'+pageNumber+',"pagesize":'+pageSize+',"totalresults":'+totalResults+',"sort":\"'+sort+'\"'+',"ids":['+idsAsCSV+']'+',"searchreturn":\"'+searchreturn+'\"';rsltString=rsltString.replace(/"/g,'|');Cookie.CreateCookie('search_results',rsltString);},readCurrentSearchResult:function()
{var resultList=Cookie.ReadCookie('search_results');var searchResults={};if(resultList)
{try
{resultList=resultList.replace(/\|/g,'"');searchResults=('{'+resultList+'}').evalJSON(true);}catch(e){}}
return searchResults;},onHide:function()
{if($(SearchInput.modalId))
{$(SearchInput.modalId).hide();}},onShow:function()
{if($(SearchInput.modalId)){$(SearchInput.modalId).show();}
if($('search_input_input')){$('search_input_input').focus();}},onChange_Country:function(args)
{SearchInput.updateCountry(args.target);},updateCountry:function(selInput)
{if(UtilPop.ensureSelectedOptionValid(selInput))
{var selCountryId=selInput.options[selInput.selectedIndex].value;StateProvince.LoadStateProvincesByCountry(selCountryId,SearchInput.populateStateProvs);}
else
{var stateprovSelect=$('search_input_stateprov');stateprovSelect.selectedIndex=0;stateprovSelect.hide();var citySelect=$('search_input_city');citySelect.selectedIndex=0;citySelect.hide();}},populateStateProvs:function(stateprovs)
{var stateprovSelect=$('search_input_stateprov');UtilPop.populateSelect(stateprovSelect,stateprovs,'State/Province','name','stateprovinceid',SearchInput.selectedSPID);$('search_input_city').hide();stateprovSelect.show();if(SearchInput.selectedSPID)
{SearchInput.updateStateprov($('search_input_stateprov'));}},onChange_Stateprov:function(args)
{SearchInput.updateStateprov(args.target);},updateStateprov:function(selInput)
{if(UtilPop.ensureSelectedOptionValid(selInput))
{var selStateprovId=selInput.options[selInput.selectedIndex].value;City.LoadCitiesByStateProv(selStateprovId,SearchInput.populateCities);}
else
{var citySelect=$('search_input_city');citySelect.selectedIndex=0;citySelect.hide();}},populateCities:function(cities)
{var citySelect=$('search_input_city');UtilPop.populateSelect(citySelect,cities,'City','cityname','cityid',SearchInput.selectedCityID);citySelect.show();},getInputValues:function(valueType)
{var retVal=null;for(catIdx=0;catIdx<SearchInput.inputValues.length;catIdx++)
{if(SearchInput.inputValues[catIdx][valueType])
{retVal=SearchInput.inputValues[catIdx][valueType];break;}}
return retVal;},addAutoCompleteOptions:function(autocompleter,queryValues)
{SearchInput.lastValue=queryValues.substr(9);if($('includeNameInSearch'))
{return queryValues+'&incNames='+$('includeNameInSearch').checked;}
else
{return queryValues+'&incNames=true';}},updateAutoCompleteSelection:function(autocompleter,selectListItem)
{autocompleter.value+=', ';},updateQuotedAutoCompleteSelection:function(autocompleter,selectListItem)
{if(selectListItem&&selectListItem.innerHTML&&selectListItem.innerHTML.length>0)
{if(autocompleter.value.endsWith(selectListItem.innerHTML))
{autocompleter.value=(autocompleter.value.substr(0,autocompleter.value.lastIndexOf(selectListItem.innerHTML))+'"'+UtilPop.unescapeHTML(selectListItem.innerHTML)+'" ').replace(/"+/g,'"');}}},populateSearchInput:function(inputs)
{SearchInput.isLoaded=true;SearchInput.fireSearchAfterUpdate=false;SearchInput.inputValues=inputs;Event.observe(document,'keydown',function(keyEvent)
{var input=$('search_input_input');if(!input){return;}
if(fwk.SEARCH_VER<2)
{if(keyEvent.keyCode==Event.KEY_RETURN&&(input.isFocused||($(SearchInput.modalId)&&$(SearchInput.modalId).visible())))
{SearchInput.onPerformSearch();}
else if(keyEvent.keyCode==Event.KEY_ESC)
{SearchInput.onHide();}}
else
{var keywords=$('ac_keyword_choices');var selected=keywords?keywords.down('.selected'):null;if(keyEvent.keyCode==Event.KEY_RETURN&&(input.isFocused||($(SearchInput.modalId)&&$(SearchInput.modalId).visible())))
{if(selected)
{var newVal=selected.innerHTML;newVal='"'+UtilPop.unescapeHTML(newVal)+'" ';input.value=(input.value.substr(0,input.value.lastIndexOf(SearchInput.lastValue))+newVal+' ').replace(/"+/g,'"');SearchInput.lastValue=newVal;}
input.value=input.value.replace(/\s+/g,' ');SearchInput.onPerformSearch();}
else if(keyEvent.keyCode==Event.KEY_ESC)
{SearchInput.onHide();}
else if((keyEvent.keyCode==Event.KEY_UP||keyEvent.keyCode==Event.KEY_DOWN)&&input.isFocused&&keywords)
{keyEvent.stop();if(keyEvent.keyCode==Event.KEY_UP)
{if(selected&&selected.previous())
{selected.removeClassName('selected');selected.previous().addClassName('selected');}
else if(keywords.firstChild)
{keywords.firstChild.lastChild.addClassName('selected');keywords.firstChild.firstChild.removeClassName('selected');}}
else if(keyEvent.keyCode==Event.KEY_DOWN)
{if(selected&&selected.next())
{selected.removeClassName('selected');selected.next().addClassName('selected');}
else if(keywords.firstChild)
{keywords.firstChild.firstChild.addClassName('selected');keywords.firstChild.lastChild.removeClassName('selected');}}}}});var searchInputModal=$(SearchInput.modalId);if(searchInputModal){searchInputModal.select('.top').each(Element.hide);}
var countrySelect=$('search_input_country');if(countrySelect)
{countrySelect.observe('change',SearchInput.onChange_Country);UtilPop.populateSelect(countrySelect,SearchInput.getInputValues('countries'),'Country','name','countryid');}
if($('search_input_stateprov')){$('search_input_stateprov').observe('change',SearchInput.onChange_Stateprov);}
if($('search_input_city')){$('search_input_city').observe('change',UtilPop.ensureSelectedOptionValid);}
var ptInput=$('search_input_proptype');if(fwk.PROD_KEY=='BM'&&$('search_input_proptype'))
{var propTypes=SearchInput.getInputValues('propertytypes');ptInput.select('label').each(function(label)
{var propTypeName=label.className.replace(/_/g,' ');var propType=propTypes.find(function(type){return type.value==propTypeName;});label.down('input[type="checkbox"]').idValue=propType.realestatetagid;});}
else if(ptInput&&!ptInput.hasClassName('nopopulate'))
{UtilPop.appendAsCheckBoxes(SearchInput.getInputValues('propertytypes'),ptInput,'value','realestatetagid',true);}
var nhInput=$('search_input_neighborhood');if(nhInput)
{UtilPop.appendAsCheckBoxes(SearchInput.getInputValues('neighborhoods'),nhInput,'value','realestatetagid');}
var prices=SearchInput.getInputValues('prices');if(prices)
{var priceMinSel=$('search_input_price_min');if(priceMinSel)
{priceMinSel.observe('change',UtilPop.ensureSelectedOptionValid);UtilPop.populateSelect(priceMinSel,prices,'No Min','formatted','value');}
var priceMaxSel=$('search_input_price_max');if(priceMaxSel)
{priceMaxSel.observe('change',UtilPop.ensureSelectedOptionValid);UtilPop.populateSelect(priceMaxSel,prices,'No Max','formatted','value');}}
var roomnumbers=SearchInput.getInputValues('roomnumbers');if(roomnumbers)
{UtilPop.populateSelect($('search_input_beds'),roomnumbers,'Any','formatted','value');UtilPop.populateSelect($('search_input_baths'),roomnumbers,'Any','formatted','value');}
SearchInput.populateFromRawSearchQuery(SearchInput.readSearchQueryCookie());if(window.onSearchInputLoaded)
{for(var i=0;i<window.onSearchInputLoaded.length;i++)
{window.onSearchInputLoaded[i]();}}}};var DialogueHandler={RetrieveSecretQuestionHandler:function(response)
{Dlg.stopProcessing();if(response&&response.success)
{TemplatedDialogue.Show_ResetPassword(response.returnParams.username,response.returnParams.secretquestion);}
else if(response&&!response.success&&response.statusMessage=='NEED_CONF')
{location='/registerconfirmation/quick/';}
else if(response&&!response.success)
{Dlg.setResponse('Cannot continue: '+response.statusMessage);}
else
{Dlg.setResponse(fwk.AJAX_FAILURE_MESSAGE);}},ResetPasswordHandler:function(response)
{Dlg.stopProcessing();if(response&&response.status)
{Dlg.Show('Your password has been reset!','Your new password has been emailed to '+response.statusmessage);}
else if(response&&!response.status)
{Dlg.setResponse('Password not reset: '+response.statusmessage);}
else
{Dlg.setResponse(fwk.AJAX_FAILURE_MESSAGE);}},ChangePasswordHandler:function(response)
{Dlg.stopProcessing();if(response&&response.statuscode)
{LoginControl.ValidateAuthHandler(response);}
else if(response&&response.failed)
{Dlg.setResponse('Password not changed: '+response.statusmessage);}
else
{Dlg.setResponse(fwk.AJAX_FAILURE_MESSAGE);}},SendMessageHandler:function(response)
{Dlg.stopProcessing();var failFunc=(Dlg.modalDialogue.element&&Dlg.modalDialogue.element.className.indexOf('modalDialogue_composeMsg')>=0)?Dlg.setResponse:Dlg.Show;if(response&&response.status)
{if(window.ViewMan&&ViewMan.development)
{response='Your Request has been sent to '+ViewMan.development.name+'.<br/>Please allow up to 48 hours for a response.';}
else
{response='Your Request has been sent.<br/>Please allow up to 48 hours for a response.';}
Dlg.Show('Thank you',response,{ok_handler:cjTracker,cancel_handler:cjTracker});}
else if(response&&response.statusmessage)
{failFunc('Your request encountered a problem',response.statusmessage);}
else
{failFunc('Server Error',fwk.AJAX_FAILURE_MESSAGE);}},SendMessageNewProfileHandler:function(response)
{Dlg.stopProcessing();if(response&&response.status)
{TemplatedDialogue.Show_NewProfileWelcome('Your request has been sent!',{isInfoRequest:true});}
else if(response&&response.statusmessage)
{Dlg.Show('Message not sent',response.statusmessage);}
else
{Dlg.Show('Message not sent',fwk.AJAX_FAILURE_MESSAGE);}},SendNewPasswordHandler:function()
{var secretQuestionForm=Dlg.modalDialogue.element;var username=secretQuestionForm.getClassField('dyn_username');var answer=secretQuestionForm.getClassField('dyn_secret_answer');validator=new Validator();validator.addItem(answer,{minLength:5});if(validator.validate())
{UserProfile.SendNewPassword(username.innerHTML,answer.value,DialogueHandler.ResetPasswordHandler);}
else
{Dlg.stopProcessing();Dlg.setResponse(validator.validationErrorsAsList());}}};var RestrictedHandler={createAccount:function()
{validator=new Validator();var form=Dlg.modalDialogue.element;validator.addItemClass(form,'register_first_name',{required:true,isAlphaNumeric:true});validator.addItemClass(form,'register_last_name',{required:true,isAlphaNumeric:true});validator.addItemClass(form,'register_email',{required:true,email:true});if(!validator.validate())
{Dlg.stopProcessing();Dlg.setResponse(validator.validationErrorsAsList());}
else
{var source=Dlg.modalDialogue.element.getClassValue('rd_action_source');var devId=Dlg.modalDialogue.element.getClassValue('rd_context_devid');var newProfile=UserProfile.buildProfile(Dlg.modalDialogue.element);if(devId!==null&&devId>0)
{var dev=new Development();dev.setID(devId);newProfile.setMyDevelopments(dev);}
newProfile.createNew(source,RestrictedHandler.displayNewAccount);}},displayNewAccount:function(response)
{Dlg.stopProcessing();if(response&&response.status)
{var callback=Dlg.callback;TemplatedDialogue.Show_NewProfileWelcome('Your new account has been created!');if(callback&&callback.func)
{callback.func(callback.args);}
else if(callback)
{callback();}}
else if(response&&response.statusmessage)
{Dlg.setResponse('Failed to save the favorite: '+response.statusmessage);}
else
{Dlg.setResponse(fwk.AJAX_FAILURE_MESSAGE);}}};var SecureRestrictedHandler={secureAccount:function()
{validator=new Validator();validator.addItemClass(Dlg.modalDialogue.element,'srd_verification_type',{minSelectedIndex:2});validator.addItemClass(Dlg.modalDialogue.element,'srd_verification_value',{required:true,isAlphaNumeric:true});if(!validator.validate())
{Dlg.stopProcessing();Dlg.setResponse(validator.validationErrorsAsList());}
else
{var token=Dlg.modalDialogue.element.getClassValue('srd_verification_type')+":"+
escape(Dlg.modalDialogue.element.getClassValue('srd_verification_value'));UserProfile.SecureProfile(token,SecureRestrictedHandler.onAccountCreated);}},onAccountCreated:function(response)
{Dlg.stopProcessing();if(response&&response.status)
{var callback=Dlg.callback;if(callback)
{callback();}}
else if(response&&response.statusmessage)
{Dlg.setResponse('Failed to save the favorite: '+response.statusmessage);}
else
{Dlg.setResponse(fwk.AJAX_FAILURE_MESSAGE);}}};var EmailAFriend={sendMail:function()
{var toIdx=0;var emailForm=Dlg.modalDialogue.element;var toFirstName,toLastName,toEmail;validator=new Validator();if(Identity.GetLoginID()===null)
{validator.addItemClass(emailForm,'dyn_from_firstname',{required:true});validator.addItemClass(emailForm,'dyn_from_lastname',{required:true});validator.addItemClass(emailForm,'dyn_from_email',{required:true,email:true});}
for(toIdx=1;toIdx<=3;toIdx++)
{toFirstName=emailForm.down('.dyn_to_firstname'+toIdx);toLastName=emailForm.down('.dyn_to_lastname'+toIdx);toEmail=emailForm.down('.dyn_to_email'+toIdx);if(!toFirstName||!toLastName||!toEmail)
{continue;}
toFirstName.value=Utl.trim(toFirstName.value);toLastName.value=Utl.trim(toLastName.value);toEmail.value=Utl.trim(toEmail.value);if(toIdx===1||toFirstName.value.length>0||toLastName.value.length>0||toEmail.value.length>0)
{validator.addItem(toFirstName,{required:true});validator.addItem(toLastName,{required:true});validator.addItem(toEmail,{required:true,email:true});}}
var note=emailForm.select('.dyn_note')[0];validator.addItem(note,{required:true});var subject=emailForm.getElementsByClassName('dyn_subject')[0];validator.addItem(subject,{required:true});if(!validator.validate())
{Dlg.stopProcessing();Dlg.setResponse(validator.validationErrorsAsList());}
else
{var sb=new StringBuilder();sb.append('note=');sb.append(escape(Utl.trim(note.value)));sb.append('&subject=');sb.append(escape(Utl.trim(subject.value)));sb.append('&contextid=');sb.append(emailForm.down('.dyn_context_id').innerHTML);sb.append('&contexttype=');sb.append(emailForm.down('.dyn_context_type').innerHTML);sb.append('&from_firstname=');sb.append(escape(Utl.trim(emailForm.down('.dyn_from_firstname').value)));sb.append('&from_lastname=');sb.append(escape(Utl.trim(emailForm.down('.dyn_from_lastname').value)));sb.append('&from_email=');sb.append(escape(Utl.trim(emailForm.down('.dyn_from_email').value)));for(toIdx=1;toIdx<=4;toIdx++)
{toFirstName=emailForm.down('.dyn_to_firstname'+toIdx);toLastName=emailForm.down('.dyn_to_lastname'+toIdx);toEmail=emailForm.down('.dyn_to_email'+toIdx);sb.append('&to_firstname#='.replace('#',toIdx));if(toFirstName)
{sb.append(escape(Utl.trim(toFirstName.value)));}
sb.append('&to_lastname#='.replace('#',toIdx));if(toLastName)
{sb.append(escape(Utl.trim(toLastName.value)));}
sb.append('&to_email#='.replace('#',toIdx));if(toEmail)
{sb.append(escape(Utl.trim(toEmail.value)));}}
EmailAFriend.sendEmailService(sb.toString(),EmailAFriend.sendMailHandler);}},sendEmailService:function(postBody,callback)
{Utl.runAjaxCall('/webservices/messenger.asmx/sendEmailToFriend',{postBody:postBody,method:'post',evalJSON:true,onSuccess:callback});},sendMailHandler:function(response)
{Dlg.stopProcessing();if(response&&response.success)
{if(response.statusmessage=='NEWPROFILE')
{TemplatedDialogue.Show_NewProfileWelcome('An email has been sent to your friend(s)!');}
else
{Dlg.Show('','An email has been sent to your friend(s)!');}}
else if(response&&!response.success)
{Dlg.setResponse('Unable to send email: '+response.statusmessage);}
else
{Dlg.setResponse(fwk.AJAX_FAILURE_MESSAGE);}}};var TemplatedDialogue={Show_Confirm:function(message,callback)
{Dlg.Show('',message,{but_cancel:true,ok_handler:Dlg.callCallback,callback:callback});},Show_Restricted:function(actionsource,context_devid,callback)
{Dlg.actionsource=actionsource;Dlg.context_devid=context_devid;LoginControl.Show(callback);},_Show_Restricted:function(actionsource,context_devid)
{if(fwk.isExternal)
{window.location=fwk.PROD_URL+'/register';}
else
{Dlg.ShowPreformatted(TemplatedDialogue.populateRestricted(actionsource,context_devid),{but_cancel:true,ok_handler:RestrictedHandler.createAccount,callback:Dlg.callback});}},populateRestricted:function(actionsource,context_devid)
{var restInstance=Utl.getInstanceOfTemplate('restricted_dialogue_template',false,false);restInstance.getElementsByClassName('rd_action_source')[0].innerHTML=actionsource;restInstance.select('.rd_context_devid')[0].innerHTML=context_devid;return restInstance;},Show_SecureRestricted:function(callback)
{Dlg.ShowPreformatted('securerestricted_dialogue_template',{but_cancel:true,ok_handler:SecureRestrictedHandler.secureAccount,callback:callback});},Show_PostLogin:function(callback)
{Dlg.ShowPreformatted('postlogin_dialogue_template',{but_ok:false,callback:callback});if(LoginControl.userStatus==11)
{Dlg.modalDialogue.element.select('.btn_confirm_account').each(function(item){item.show();item.observe('click','/registerconfirmation/');});}
else if(LoginControl.userStatus==12)
{Dlg.modalDialogue.element.select('.btn_confirm_account').each(function(item){item.show();item.observe('click','/registerconfirmation/quick/');});}},Show_NewProfileWelcome:function(customMessage,options)
{LoginControl.UpdateCurAuth(true);if(fwk.PROD_KEY=='RS'&&window.gc)
{gc.regConversionOccured();}
var ourInstance=null;if(fwk.PROD_KEY=='RS'&&options)
{if(options.isFullReg)
{ourInstance=Utl.getInstanceOfTemplate('newMemeber_JOIN_dialogue_template',false,false);}
else if(options.isInfoRequest)
{ourInstance=Utl.getInstanceOfTemplate('newMemeber_IR_dialogue_template',false,false);if(ourInstance.down('.dyn_devName'))
{ourInstance.down('.dyn_devName').innerHTML=UtilPop.escapeHTML(ViewMan.development.name);}}}
if(ourInstance===null&&$('newMemeber_dialogue_template'))
{ourInstance=Utl.getInstanceOfTemplate('newMemeber_dialogue_template',false,false);if(customMessage&&ourInstance.down('.dyn_custom_message'))
{ourInstance.down('.dyn_custom_message').innerHTML=customMessage;}}
if(ourInstance!==null)
{Dlg.ShowPreformatted(ourInstance,options);}
else
{Dlg.Show('Welcome!','Please check your email to confirm your account.');}},Show_ContactInfo:function(callback)
{UserProfile.LoadProfileJSON(Identity.GetLoginID(),function(up)
{Dlg.ShowPreformatted(TemplatedDialogue.Populate_ContactInfo(up.details[0]),{but_cancel:true,ok_handler:SecureRestrictedHandler.secureAccount,callback:callback,focusFieldClassName:'cd_register_home_phone'});});},Populate_ContactInfo:function(details)
{var contactInstance=Utl.getInstanceOfTemplate('profileContactInfo_dialogue_template',false,false);var primaryPhone='';var officePhone='';var fax='';for(var i=0;i<details.phonenumbers.length;i++)
{if(details.phonenumbers[i].numbertype[0].value=='PrimaryNumber')
{primaryPhone=details.phonenumbers[i].number;}
else if(details.phonenumbers[i].numbertype[0].value=='OfficeNumber')
{officePhone=details.phonenumbers[i].number;}
else if(details.phonenumbers[i].numbertype[0].value=='Fax')
{fax=details.phonenumbers[i].number;}}
contactInstance.select('.dyn_primary_phone')[0].setAttribute('value',primaryPhone);contactInstance.select('.dyn_secondary_phone')[0].setAttribute('value',officePhone);contactInstance.select('.dyn_fax')[0].setAttribute('value',fax);if(details.mailingaddresses.length>0)
{var fullAddress=details.mailingaddresses[0].userlocation.split('\n');ourInstance.select('.dyn_address1')[0].setAttribute('value',fullAddress[0]);ourInstance.select('.dyn_city')[0].setAttribute('value',fullAddress[1]);ourInstance.select('.dyn_province')[0].setAttribute('value',fullAddress[2]);UtilPop.setDropDownSelectedValue(ourInstance.select('dyn_country')[0],fullAddress[3]);ourInstance.select('.dyn_zippostal')[0].setAttribute('value',details.mailingaddresses[0].zippostal);}
return contactInstance;},Show_EmailToFriend:function(contextObject,contextType)
{Dlg.ShowPreformatted(TemplatedDialogue.Populate_EmailToFriend(contextObject,contextType),{ok_handler:EmailAFriend.sendMail,but_cancel:true,return_handler:function(){},focusFieldClassName:'dyn_to_firstname1'});},currentContextObject:null,currentContextType:null,Show_EmailToFriend_LateSignin:function()
{TemplatedDialogue.Show_EmailToFriend(TemplatedDialogue.currentContextObject,TemplatedDialogue.currentContextType);},Populate_EmailToFriend:function(aContextObject,contextType)
{TemplatedDialogue.currentContextObject=aContextObject;TemplatedDialogue.currentContextType=contextType;var emailInstance=Utl.getInstanceOfTemplate('emailtofriend_dialogue_template',false,false);if(aContextObject.presentationdata)
{emailInstance.select('.dyn_email_image').each(function(emailThumb)
{emailThumb.src=imgUtl.convertImagePathToThumbnailPath(aContextObject.presentationdata[0].summaryimage[0].imagepath);emailThumb.alt=aContextObject.presentationdata[0].summaryimage[0].tooltip;});}
emailInstance.select('.dyn_context_id').each(function(ele){ele.update(aContextObject.id);});emailInstance.select('.dyn_context_type').each(function(ele){ele.update(contextType);});emailInstance.select('.dyn_context_name').each(function(ele){ele.update(aContextObject.name||aContextObject.Name);});emailInstance.select('.dyn_subject').each(function(ele){ele.setAttribute('value','Your friend wants you to check out '+aContextObject.name+' at '+fwk.PROD_NAME);});if(Identity.GetLoginID()>0)
{emailInstance.select('.etf_from_info').each(Element.hide);}
else
{emailInstance.select('.singin_account')[0].setAttribute('onclick','LoginControl.Show(TemplatedDialogue.Show_EmailToFriend_LateSignin)');}
return emailInstance;},Show_RetrieveSecretQuestion:function()
{LoginControl.hide();Dlg.ShowPreformatted('requestusername_dialogue_template',{ok_handler:TemplatedDialogue.RetrieveSecretQuestion,but_cancel:true,focusFieldClassName:'dyn_username'});},RetrieveSecretQuestion:function()
{Dlg.startProcessing();var form=Dlg.modalDialogue.element;validator=new Validator();validator.addItemClass(form,'dyn_username',{required:true});if(!validator.validate())
{Dlg.stopProcessing();Dlg.setResponse(validator.validationErrorsAsList());}
else
{UserProfile.GetSecretQuestion(form.getClassValue('dyn_username'),DialogueHandler.RetrieveSecretQuestionHandler);}},Show_ResetPassword:function(username,secretquestion)
{var dialog=$('dyn_resetPassword_dialogue');dialog.select('.dyn_username')[0].innerHTML=username;dialog.select('.dyn_secret_question')[0].innerHTML=secretquestion;Dlg.ShowPreformatted(dialog,{ok_handler:DialogueHandler.SendNewPasswordHandler,but_cancel:true,focusFieldClassName:'dyn_secret_answer'});},Show_ChangePassword:function(username,persist,passwordExpired,callback)
{var dialog=Utl.getInstanceOfTemplate('changePassword_dialogue_template');dialog.select('.dyn_username')[0].innerHTML=username;dialog.select('.dyn_chkPersistLogin')[0].setAttribute('checked',persist);if(passwordExpired)
{dialog.select('.dyn_title')[0].innerHTML='Your password has expired, please enter a new one.';}
Dlg.ShowPreformatted(dialog,{ok_handler:TemplatedDialogue.ResetPassword,but_cancel:true,focusFieldClassName:'dyn_old_password',callback:callback});},ResetPassword:function()
{Dlg.startProcessing();var form=Dlg.modalDialogue.element;var username={value:form.getElementsByClassName('dyn_username')[0].innerHTML,name:"Username"};var oldpass=form.getElementsByClassName('dyn_old_password')[0];var newpass=form.getElementsByClassName('dyn_new_password')[0];var confnewpass=form.getElementsByClassName('dyn_confirm_new_password')[0];validator=new Validator();validator.addItem(username,{required:true});validator.addItem(oldpass,{required:true});validator.addItem(newpass,{minLength:6,noSpaces:true});validator.addItem(confnewpass,{compare:newpass.value,matchName:'New Password'});if(!validator.validate())
{Dlg.stopProcessing();Dlg.setResponse(validator.validationErrorsAsList());}
else
{UserProfile.ChangePassword(username.value,oldpass.value,newpass.value,DialogueHandler.ChangePasswordHandler);}},Show_MessageCompose:function(toName,toAccountName,subject,devId)
{Dlg.ShowPreformatted(TemplatedDialogue.Populate_MessageCompose(toName,toAccountName,subject,devId),{ok_handler:TemplatedDialogue.Send_Message,but_cancel:true,return_handler:function(){},focusFieldClassName:'dyn_msg_subject'});},Populate_MessageCompose:function(toName,toAccountName,subject,devId)
{var ourInstance=Utl.getInstanceOfTemplate('dyn_compose_msg_dialogue',false,false);ourInstance.select('.dyn_msg_recipient')[0].innerHTML=toName;ourInstance.select('.dyn_msg_recipient_account')[0].innerHTML=toAccountName;if(subject)
{ourInstance.select('.dyn_msg_subject')[0].setAttribute('value',subject);}
if(devId)
{ourInstance.select('.dyn_devid')[0].innerHTML=devId;}
return ourInstance;},Send_Message:function()
{var form=Dlg.modalDialogue.element;var subject=form.getElementsByClassName('dyn_msg_subject')[0];var messagebody=form.getElementsByClassName('dyn_message_body')[0];var devId=form.getElementsByClassName('dyn_devid')[0].innerHTML;if(!devId||devId<=0)
{devId='-1';}
var validator=new Validator();validator.addItem(subject,{required:true});validator.addItem(messagebody,{required:true});if(!validator.validate())
{Dlg.stopProcessing();Dlg.setResponse(validator.validationErrorsAsList());}
else
{var toName=form.getElementsByClassName('dyn_msg_recipient')[0];var toAccount=form.getElementsByClassName('dyn_msg_recipient_account')[0];UserProfile.SendInternalMessage(toAccount.innerHTML,escape(subject.value),escape(messagebody.value),devId,DialogueHandler.SendMessageHandler);}},Show_Make_Offer:function(itemObj)
{Dlg.ShowPreformatted('auction_bid_dialogue',{ok_handler:DevCompose.sendOffer,but_cancel:true});if(Identity.GetLoginID())
{Dlg.textMessage.down('.user_info').hide();Dlg.modalDialogue.adjustForResize();}}};if(window.AuctionItem)
{AuctionItem.buildBids=function(element)
{var itemList=[];element.select('.auction_item').each(function(field)
{var amount=field.getClassValue('dyn_bid_amount')||field.getClassValue('auc_reg_item_opening_bid');if(amount)
{var item=new AuctionItem();var bids=[];var bid=new Bid();bid.setAmount(amount);bids.push(bid);item.setBids(bids);item.setID(field.getClassValue('dyn_auc_item_id'));itemList.push(item);}});return itemList;};}
if(window.Contact)
{Contact.buildContact=function(element)
{var c=new Contact();var p=new Person();p.setFirstName(Utl.trim(element.getClassValue('register_first_name')));p.setMiddleName(Utl.trim(element.getClassValue('register_middle_name')));p.setLastName(Utl.trim(element.getClassValue('register_last_name')));var g=new Gender();g.setValue(element.getClassValue('register_gender','Unknown'));p.setGender(g);if(element.getClassValue('register_dateOfBirth'))
{p.setDateOfBirth(Utl.trim(element.getClassValue('register_dateOfBirth')));}
c.setPersonalInfo(p);var email=new EmailAddress();email.setAddress(Utl.trim(element.getClassValue('register_email')));var emailType=new EmailType();emailType.setValue('PrimaryEmail');email.setAddressType(emailType);c.setEmailAddresses(email);var addresses=[];var ddlCountry=element.down('.register_country');var mailingAddress=new MailingAddress();var mailingAddressType=new MailingAddressType();mailingAddressType.setValue('PrimaryAddress');mailingAddress.setAddressType(mailingAddressType);sbUserLocation=new StringBuilder();sbUserLocation.append(element.getClassValue('register_address1'));sbUserLocation.append("\n");sbUserLocation.append(element.getClassValue('register_city'));sbUserLocation.append("\n");sbUserLocation.append(element.getClassValue('register_province'));sbUserLocation.append("\n");if(ddlCountry&&ddlCountry.selectedIndex>0)
{sbUserLocation.append(ddlCountry.options[ddlCountry.selectedIndex].text);}
mailingAddress.setUserLocation(sbUserLocation.toString());mailingAddress.setZipPostal(element.getClassValue('register_zippostal'));addresses.push(mailingAddress);var ddlCountryBilling=element.down('.register_country_billing');if(ddlCountryBilling)
{var billingAddress=new MailingAddress();var billingAddressType=new MailingAddressType();billingAddressType.setValue('OtherAddress');billingAddress.setAddressType(billingAddress);sbUserLocation=new StringBuilder();sbUserLocation.append(element.getClassValue('register_address1_billing'));sbUserLocation.append("\n");sbUserLocation.append(element.getClassValue('register_city_billing'));sbUserLocation.append("\n");sbUserLocation.append(element.getClassValue('register_province_billing'));sbUserLocation.append("\n");if(ddlCountryBilling&&ddlCountryBilling.selectedIndex>0)
{sbUserLocation.append(ddlCountryBilling.options[ddlCountryBilling.selectedIndex].text);}
billingAddress.setUserLocation(sbUserLocation.toString());billingAddress.setZipPostal(element.getClassValue('register_zippostal_billing'));addresses.push(billingAddress);}
var phoneNumbers=[];if(element.getClassValue('register_primaryPhone')!='')
{var primaryNumber=new PhoneNumber();primaryNumber.setNumber(Utl.trim(element.getClassValue('register_primaryPhone')));var primaryPhoneType=new PhoneNumberType();primaryPhoneType.setValue('PrimaryNumber');primaryNumber.setNumberType(primaryPhoneType);phoneNumbers.push(primaryNumber);}
if(element.getClassValue('register_secondaryPhone')!='')
{secondaryNumber=new PhoneNumber();secondaryNumber.setNumber(Utl.trim(element.getClassValue('register_secondaryPhone')));var secondaryPhoneType=new PhoneNumberType();secondaryPhoneType.setValue('OtherNumber');secondaryNumber.setNumberType(secondaryPhoneType);phoneNumbers.push(secondaryNumber);}
if(element.getClassValue('register_fax')!='')
{faxNumber=new PhoneNumber();faxNumber.setNumber(Utl.trim(element.getClassValue('register_fax')));var faxPhoneType=new PhoneNumberType();faxPhoneType.setValue('Fax');faxNumber.setNumberType(faxPhoneType);phoneNumbers.push(faxNumber);}
if(phoneNumbers.length>0)
{mailingAddress.setPhoneNumbers(phoneNumbers);}
c.setMailingAddresses(addresses);return c;};}
if(window.Development)
{Development.buildDevelopment=function(element,locMan)
{var d=new Development();d.setName(Utl.trim(element.getClassValue('dev_name')));d.setName_Short(Utl.trim(element.getClassValue('dev_name_short')));d.setIsEnabled(Utl.trim(element.getClassValue('dev_is_enabled')));d.setIsSingleListing(Utl.trim(element.getClassValue('dev_is_single_listing')));d.setExternalWeblink(Utl.trim(element.getClassValue('dev_external_link')));d.setMaxPriceRange(Utl.trim(element.getClassValue('dev_max_price_range')||element.getClassValue('dev_price')||'1'));d.setMinPriceRange(Utl.trim(element.getClassValue('dev_min_price_range')||'1'));d.setPriceOverride(Utl.trim(element.getClassValue('dev_price_override')));d.setOwnerAccountID(Utl.trim(element.getClassValue('dev_account_list')));d.setSummary(Utl.trim(element.getClassValue('dev_summary')));if(new Boolean(Utl.trim(element.getClassValue('dev_is_single_listing'))))
{var props=new Array();var p=new Property();var tag=new RealestateTag();var tagType=new RealestateTagType();tagType.setValue(RealestateTagType.values.PropertyType);tag.setType(tagType);var devTypeSel=$('listing_form').down('.dev_prop_type');tag.setValue(Utl.trim(devTypeSel.options[devTypeSel.selectedIndex].text));p.setPropertyType(tag);p.setNumberBathrooms(Utl.trim(element.getClassValue('dev_bathrooms')));p.setNumberBedrooms(Utl.trim(element.getClassValue('dev_bedrooms')));props.push(p);d.setProperties(props);}
var dm=new DevelopmentMarkup()
dm.setOverviewHTML(tinyMCE.get('devOverview').getContent());var sumaryImage=new ImageReference();var image=Development.getSummaryImage(element);if(image)
sumaryImage.setImagePath(image.folderpath+image.filename);dm.setSummaryImage(sumaryImage);d.setPresentationData(dm);var displayableAttributes=new Array();var wrapper=element.down('.dev_da_wrapper');for(var i=0;i<wrapper.count;i++)
{var da=wrapper.getInstance(i);var daTitle=da.down('.attrTitle');var daValue=da.down('.attrValue');var pair=new StringKeyValuePair();pair.setPairKey(daTitle.value);pair.setPairValue(daValue.value);displayableAttributes.push(pair);}
d.setDisplayableAttributes(displayableAttributes);if(window.LocMan)
d.setLocation(locMan.populateFromUI());if(window.DevKWMan)
d.setTags(DevKWMan.getTagList());return d;};Development.getSummaryImage=function(element)
{var rows=element.down('.dev_files').select('.file_item');for(var i=0;i<rows.length;i++)
if(rows[i].down('input.mainimage').checked==true)
return rows[i].file;};}
if(window.UserProfile)
{UserProfile.buildProfile=function(element)
{var loginQuestion=new LoginRetrievalQuestion();loginQuestion.setQuestion(Utl.trim(element.getClassValue('register_pass_question')));loginQuestion.setAnswer(Utl.trim(element.getClassValue('register_pass_answer')));var login=new Login();login.setLoginName(Utl.trim(element.getClassValue('register_email')));login.setPasswordHash(element.getClassValue('register_pass'));login.setLoginRetrieval(loginQuestion);var c=Contact.buildContact(element);var attributes=[];element.select('.dyn_attribute').each(function(attributeField)
{if(attributeField.className.indexOf('dyn_unit_num_chk')>=0&&attributeField.getVal()===false)
{return;}
var attribute=new StringKeyValuePair();attribute.setPairKey(attributeField.name);attribute.setPairValue(attributeField.getVal());attributes.push(attribute);});var ctype=Cookie.ReadCookie('ctype');if(ctype&&ctype.length>0)
{var attribute=new StringKeyValuePair();attribute.setPairKey('HDN_ctype');attribute.setPairValue(ctype);attributes.push(attribute);}
var up=new UserProfile();up.setAttributes(attributes);up.setAuthenticationInformation(login);up.setDetails(c);return up;};}
function toggleAnchorGroup(anEvent,options)
{options=options||{};var groupAnchor;if(anEvent.KEY_RETURN)
groupAnchor=$(Event.element(anEvent));else if(anEvent.target)
groupAnchor=$(Event.element(anEvent));else
groupAnchor=$(anEvent);var groupDiv=groupAnchor.nextSiblings()[0];if(groupAnchor.hasClassName('arrow_closed')||(options.forceOpen&&!options.forceClose))
{groupAnchor.removeClassName('arrow_closed');groupAnchor.addClassName('arrow_open');groupDiv.show();}
else
{groupAnchor.removeClassName('arrow_open');groupAnchor.addClassName('arrow_closed');groupDiv.hide();}}
if(!window.CustomSelector)CustomSelector={commonClassName:'cswrap'};CustomSelector.createInstance=function(container,options)
{container.onTextFocus=function()
{if(this.text.value==this.defaultCustom)
this.text.value='';};container.onTextBlur=function()
{if(this.text.value=='')
this.text.value=this.defaultCustom;};container.onValueChanged=function()
{this.value=this.getValue();if(this.options.onchange&&container.isLoaded)
this.options.onchange(this);};container.inSelectState=function()
{return this.button.innerHTML!=this.options.selectText;};container.clear=function()
{this.setValue();};container.getValue=function()
{var value='';if(!this.inSelectState())
value=this.text.value;else if(!this.options.title||UtilPop.ensureSelectedOptionValid(this.select))
value=this.select.value;if(value==this.defaultCustom)value='';return value;};container.setValue=function(value)
{value=value||'';this.value=value;if(this.text)
this.text.value=value;if(this.select)
{this.select.selectedIndex=0;if(value==''||this.select.setValue(value).value==value)
this.toggle('select');else
this.toggle('custom');}
return this;};container._show=container.show;container.show=function()
{this._show();this.toggle('select');};container._addClassName=container.addClassName;container.addClassName=function(className)
{this._addClassName(className);if(this.text&&this.text.addClassName)
this.text.addClassName(className);if(this.select&&this.select.addClassName)
this.select.addClassName(className);};container._removeClassName=container.removeClassName;container.removeClassName=function(className)
{this._removeClassName(className);if(this.text&&this.text.removeClassName)
this.text.removeClassName(className);if(this.select&&this.select.removeClassName)
this.select.removeClassName(className);};container.toggle=function(forceState)
{if((this.inSelectState()||forceState=='custom')&&forceState!='select')
{this.onTextBlur();this.text.show();this.select.hide();this.button.addClassName('custom');this.button.removeClassName('select');this.text.tabIndex=this.tabIndex;this.select.tabIndex=0;this.button.title=this.options.selectText;this.button.innerHTML=this.options.selectText;}
else
{this.text.hide();this.select.show();this.button.addClassName('select');this.button.removeClassName('custom');this.text.tabIndex=0;this.select.tabIndex=this.tabIndex;this.button.title=this.options.customText;this.button.innerHTML=this.options.customText;}
this.onValueChanged();};container.populateSelect=function(objList,name,value)
{UtilPop.populateSelect(this.select,objList,this.options.title,name,value);this.clear();};container.isLoaded=false;container.select=null;container.text=null;container.button=null;container.defaultCustom='Enter Custom';options=options||{};options.selectText=options.selectText||'Select';options.customText=options.customText||'Add Custom';options.name=options.name||container.getAttribute('name')||'';options.value=options.value||container.getAttribute('value')||'';container.options=options;container.addClassName(CustomSelector.commonClassName);container.select=$(document.createElement('select'));container.text=$(document.createElement('input'));container.text.setAttribute('type','text');container.text.setAttribute('maxlength',options.maxlength||container.maxlength||'50');container.button=$(document.createElement('button'));container.button.innerHTML=options.customText;container.select.setAttribute('class','custsel_select');container.text.setAttribute('class','custsel_text');container.button.setAttribute('class','custsel_button');Utl.clearAllChildren(container);container.appendChild(container.select);container.appendChild(container.text);container.appendChild(container.button);container.name=options.name;container.value=options.value;container.toggle('select');if(options.selectvalues)
container.populateSelect(options.selectvalues,'display','value');Event.observe(container.button,'click',container.toggle.bindAsEventListener(container));Event.observe(container.button,'click',container.onValueChanged.bindAsEventListener(container));Event.observe(container.select,'change',container.onValueChanged.bindAsEventListener(container));Event.observe(container.text,'keyup',container.onValueChanged.bindAsEventListener(container));Event.observe(container.text,'focus',container.onTextFocus.bindAsEventListener(container));Event.observe(container.text,'blur',container.onTextBlur.bindAsEventListener(container));container.isLoaded=true;}
var LengthCounter={setMaxLength:function(){var x=document.getElementsByTagName('textarea');LengthCounter.setMaxLengthEvents(x);},setMaxLengthForElement:function(anElement){LengthCounter.setMaxLengthEvents([anElement]);},setMaxLengthEvents:function(x)
{var counter=document.createElement('div');counter.className='counter';for(var i=0;i<x.length;i++){if(x[i].getAttribute('maxlength')){var counterClone=counter.cloneNode(true);counterClone.relatedElement=x[i];counterClone.innerHTML='Text Length: <span>0</span>/'+x[i].getAttribute('maxlength');x[i].parentNode.insertBefore(counterClone,x[i].nextSibling);x[i].relatedElement=counterClone.getElementsByTagName('span')[0];x[i].onkeyup=x[i].onchange=LengthCounter.checkMaxLength;x[i].onkeyup();}}},checkMaxLength:function(){var maxLength=this.getAttribute('maxlength');var currentLength=this.value.length;if(currentLength>maxLength)
this.relatedElement.className='toomuch';else
this.relatedElement.className='';this.relatedElement.firstChild.nodeValue=currentLength;}}
if(!Prototype||!Node)
alert('ListDisplayer requires Prototype and Node');var ListDisplayer=Class.create({list_container:null,sort_property:'',sort_direction:'ASC',sort_method_provider:null,onListDisplayed:null,initialize:function(aListContainerElementOrId,sortMethodProvider,pageSize,pageNumber)
{this.list_container=$(aListContainerElementOrId);if(sortMethodProvider)
this.sort_method_provider=sortMethodProvider;this.pageSize=pageSize;this.pageNumber=pageNumber;},addItemToList:function(domItem)
{this.list_container.appendChild(domItem);},clearList:function()
{Utl.clearAllChildren(this.list_container);},getSortString:function()
{return this.sort_property+' '+this.sort_direction;},setSortFromString:function(value)
{var spaceIndex=value.indexOf(' ');this.sort_property=value.substring(0,spaceIndex);this.sort_direction=value.substring(spaceIndex+1,value.length);},isListEmpty:function()
{return!(this.list_container&&this.list_container.childNodes&&this.list_container.childNodes.length>0);},isSortAscending:function()
{return this.sort_direction=='ASC';},showList:function(onListDisplayedCallback,ignoreEachElement)
{this.onListDisplayed=onListDisplayedCallback;var resultChildren=this.list_container.cleanWhitespace().childNodes;if(resultChildren&&resultChildren.length)
{if(ignoreEachElement==true)
{for(var i=0;i<resultChildren.length;i++)
{if(resultChildren[i].nodeType==Node.ELEMENT_NODE)
{resultChildren[i].show();}}}
else
{for(var i=0;i<resultChildren.length;i++)
{var delayValue=0.2*i;var durationValue=0.7;Effect.Appear(resultChildren[i],{duration:durationValue,delay:delayValue});}}}
if(this.onListDisplayed)
{this.onListDisplayed();}},setSort:function(aSortProperty)
{if(aSortProperty=='')
{this.sort_property='default';this.sort_direction='DESC';}
else if(aSortProperty)
{if(aSortProperty==this.sort_property)
{if(this.sort_direction=='ASC')
{this.sort_direction='DESC';}
else
{this.sort_direction='ASC';}}
else
{this.sort_property=aSortProperty;if(aSortProperty=='added'||aSortProperty=='modified')
this.sort_direction='DESC';else
this.sort_direction='ASC';}}},sortList:function(aSortProperty)
{this.setSort(aSortProperty);if(this.sort_property!=''&&!this.isListEmpty())
{var resultArray=$A(this.list_container.cleanWhitespace().childNodes);this.clearList();if(this.sort_method_provider)
{var sortMethod=this.sort_method_provider(this.sort_property,this);resultArray=resultArray.sort(sortMethod);}
else
{resultArray=resultArray.sort();}
for(var i=0;i<resultArray.length;i++)
{this.addItemToList(resultArray[i]);}}}});if(!window.ListSelector)ListSelector={commonClassName:'lswrap'};ListSelector.createInstance=function(container,options)
{container.onMoveLeft=function()
{if(!this.rightSelect.value)return;var newItemsList=[];leftSelect=this.leftSelect;rightSelect=this.rightSelect;for(var i=rightSelect.length-1;i>=0;i--)
if(this.rightSelect.options[i].selected)
{newItemsList.push(this.rightList[i]);this.leftList.push(this.rightList[i]);this.rightList.remove(i);}
this.populateLeftSelect(this.leftList);this.populateRightSelect(this.rightList);for(var i=leftSelect.length-1;i>=0;i--)
if(newItemsList.find(function(s){return s.value==leftSelect.options[i].value;}))
new Effect.Highlight(leftSelect.options[i],{startcolor:this.options.highlightStart,endcolor:this.options.highlightEnd});};container.onMoveRight=function()
{if(!this.leftSelect.value)return;var newItemsList=[];leftSelect=this.leftSelect;rightSelect=this.rightSelect;for(var i=leftSelect.length-1;i>=0;i--)
if(this.leftSelect.options[i].selected)
{newItemsList.push(this.leftList[i]);this.rightList.push(this.leftList[i]);this.leftList.remove(i);}
this.populateLeftSelect(this.leftList);this.populateRightSelect(this.rightList);for(var i=rightSelect.length-1;i>=0;i--)
if(newItemsList.find(function(s){return s.value==rightSelect.options[i].value;}))
new Effect.Highlight(rightSelect.options[i],{startcolor:this.options.highlightStart,endcolor:this.options.highlightEnd});};container.populateLeftSelect=function(objList)
{this.leftList=objList.sortBy(function(s){return s[this.sortBy];});UtilPop.populateSelect(this.leftSelect,this.leftList,this.options.title,'display','value');};container.populateRightSelect=function(objList)
{this.rightList=objList.sortBy(function(s){return s[this.sortBy];});UtilPop.populateSelect(this.rightSelect,this.rightList,this.options.title,'display','value');};container.isLoaded=false;options=options||{};container.sortBy=options.sortBy||'display';container.leftList=options.leftList||[];container.rightList=options.rightList||[];options.maxSelected=options.maxSelected||99999;options.highlightStart=options.highlightStart||'#FFF6BF';options.highlightEnd=options.highlightEnd||'#F1F0E7';container.options=options;container.addClassName(ListSelector.commonClassName);var leftWrapper=$(document.createElement('div'));var rightWrapper=$(document.createElement('div'));var middleWrapper=$(document.createElement('div'));var leftTitle=$(document.createElement('h3'));var rightTitle=$(document.createElement('h3'));leftTitle.innerHTML=options.leftTitle||'';rightTitle.innerHTML=options.rightTitle||'';container.leftSelect=$(document.createElement('select'));container.rightSelect=$(document.createElement('select'));container.leftSelect.setAttribute('multiple','multiple');container.rightSelect.setAttribute('multiple','multiple');container.toLeftButton=$(document.createElement('button'));container.toRightButton=$(document.createElement('button'));container.toLeftButton.innerHTML='<';container.toRightButton.innerHTML='>';leftWrapper.setAttribute('class','listsel_left_wrapper');rightWrapper.setAttribute('class','listsel_right_wrapper');middleWrapper.setAttribute('class','listsel_middle_wrapper');container.leftSelect.setAttribute('class','listsel_left_select');container.rightSelect.setAttribute('class','listsel_right_select');container.toLeftButton.setAttribute('class','listsel_toleft_button');container.toRightButton.setAttribute('class','listsel_toright_button');Utl.clearAllChildren(container);leftWrapper.appendChild(leftTitle);leftWrapper.appendChild(container.leftSelect);middleWrapper.appendChild(container.toLeftButton);middleWrapper.appendChild(container.toRightButton);rightWrapper.appendChild(rightTitle);rightWrapper.appendChild(container.rightSelect);container.appendChild(leftWrapper);container.appendChild(middleWrapper);container.appendChild(rightWrapper);container.name=options.name;if(container.leftList)
container.populateLeftSelect(container.leftList);if(container.rightList)
container.populateRightSelect(container.rightList);Event.observe(container.toLeftButton,'click',container.onMoveLeft.bindAsEventListener(container));Event.observe(container.toRightButton,'click',container.onMoveRight.bindAsEventListener(container));Event.observe(container.leftSelect,'dblclick',container.onMoveRight.bindAsEventListener(container));Event.observe(container.rightSelect,'dblclick',container.onMoveLeft.bindAsEventListener(container));container.isLoaded=true;};if(!window.ObjectListBuilder)ObjectListBuilder={commonClassName:'olbwrap',commonItemClassName:'olbitemwrap'};ObjectListBuilder.createInstance=function(container,options)
{container.addNew=function()
{this.add(null);};container.add=function(obj)
{var wrapper=this.select('.wrapper')[0];if(this.options.allowedAttributes&&wrapper.childNodes.length>=this.options.allowedAttributes)
Dlg.Show('Cannot Add More','You may only have up to '+this.options.allowedAttributes+' items');else
{var newWrapper=this.createWrapper(obj,this.options.templateID,this.options.formatter);this.select('.wrapper')[0].appendChild(newWrapper);this.count++;new Effect.Highlight(newWrapper,{startcolor:this.options.highlightStart,endcolor:this.options.highlightEnd});this.updateIndices();}};container.createWrapper=function(object,templateID,formatter)
{var newWrapperDiv=null;if(formatter)
newWrapperDiv=formatter(object,templateID,false,false,false);else
newWrapperDiv=Utl.getInstanceOfTemplate(templateID,true,false);var remove=newWrapperDiv.getClassField('btnRemove');var moveUp=newWrapperDiv.getClassField('btnMoveUp');var moveDown=newWrapperDiv.getClassField('btnMoveDown');if(remove)Event.observe(remove,'click',this.onRemoveClick.bindAsEventListener(this));if(moveUp)Event.observe(moveUp,'click',this.onMoveUpClick.bindAsEventListener(this));if(moveDown)Event.observe(moveDown,'click',this.onMoveDownClick.bindAsEventListener(this));newWrapperDiv.addClassName(ObjectListBuilder.commonItemClassName);return newWrapperDiv;};container.onMoveUpClick=function(args)
{var moveUp=args.target||args;var ourInstance=moveUp.getParentWithClass(ObjectListBuilder.commonItemClassName);if(ourInstance==null)return;var moveToInstance=this.getInstance(ourInstance.idx-1);if(moveToInstance==null)return;ourInstance.remove();moveToInstance.insert({before:ourInstance});new Effect.Highlight(ourInstance,{startcolor:this.options.highlightStart,endcolor:this.options.highlightEnd});this.updateIndices();};container.onMoveDownClick=function(args)
{var moveDown=args.target||args;var ourInstance=moveDown.getParentWithClass(ObjectListBuilder.commonItemClassName);if(ourInstance==null)return;var moveToInstance=this.getInstance(ourInstance.idx+1);if(moveToInstance==null)return;ourInstance.remove();moveToInstance.insert({after:ourInstance});new Effect.Highlight(ourInstance,{startcolor:this.options.highlightStart,endcolor:this.options.highlightEnd});this.updateIndices();};container.onRemoveClick=function(args)
{var remove=args.target||args;var olb=this;if(Dlg&&TemplatedDialogue)
TemplatedDialogue.Show_Confirm('Are you sure you want to remove this item?',function(){olb.removeObject(remove);});else if(!confirm('Are you sure you want to remove this item?'))
this.removeObject(remove);};container.removeObject=function(remove)
{var ourInstance=remove.getParentWithClass(ObjectListBuilder.commonItemClassName);if(ourInstance==null)return;ourInstance.remove();this.count--;this.updateIndices();};container.getInstance=function(idx)
{var wrapper=this.select('.wrapper')[0];var ourInstance=null;for(var i=0;i<wrapper.childNodes.length;i++)
{if(wrapper.childNodes[i].idx==idx)
{ourInstance=wrapper.childNodes[i];break;}}
return ourInstance;};container.clear=function()
{var wrapper=this.select('.wrapper')[0];if(wrapper)Utl.clearAllChildren(wrapper);container.count=0;return this;};container.updateIndices=function()
{var wrapper=this.select('.wrapper')[0];for(var i=0;i<wrapper.childNodes.length;i++)
{var moveUp=wrapper.childNodes[i].getClassField('btnMoveUp');var moveDown=wrapper.childNodes[i].getClassField('btnMoveDown');if(moveUp)
{if(i==0)
moveUp.hide();else
moveUp.show();}
if(moveDown)
{if(i==wrapper.childNodes.length-1)
moveDown.hide();else
moveDown.show();}
wrapper.childNodes[i].idx=i;}};options=options||{};options.highlightStart=options.highlightStart||'#FFF6BF';options.highlightEnd=options.highlightEnd||'#F1F0E7';container.options=options;container.count=0;container.addClassName(ObjectListBuilder.commonClassName);var add=container.getClassField('btnAdd');if(add)Event.observe(add,'click',container.addNew.bindAsEventListener(container));};if(!Prototype||!Node)
alert('SpanToggle requires Prototype and Node');var SpanToggle=Class.create({span:null,more_link:'',text:'',maxLengthToShow:300,expanded:true,convertNewlines:false,initialize:function(aSpanElementOrID,aLinkElementOrID,displayText,uniqueID,aMaxLengthToShow,convertNewlines)
{this.span=$(aSpanElementOrID);this.more_link=$(aLinkElementOrID);this.text=displayText;this.convertNewlines=convertNewlines||false;if(aMaxLengthToShow)
this.maxLengthToShow=aMaxLengthToShow;if(!window.toggles)
window.toggles=new Array();window.toggles[uniqueID]=this;if(this.more_link)
this.more_link.href='javascript:window.toggles[\''+uniqueID+'\'].toggle();';this.toggle();},toggle:function()
{this.expanded=!this.expanded;var showText=UtilPop.escapeHTML(this.text);if(showText.length>this.maxLengthToShow&&!this.expanded)
showText=this.text.substr(0,this.maxLengthToShow)+'...';if(this.convertNewlines)
this.span.innerHTML=showText.replace(/\n/g,'<br />');else
this.span.innerHTML=showText;if(this.more_link)
if(showText.length>this.maxLengthToShow)
{if(!this.expanded)
this.more_link.innerHTML='[more]';else
this.more_link.innerHTML='[less]';}
else
this.more_link.hide();}});