String.prototype.trim=function(){return this.replace(String.prototype.trim_reqexp,"")};String.prototype.trim_reqexp=/(^\s+)?(\s+$)?/g;String.prototype.startsWith=function(theString){return this.indexOf(theString)==0};String.prototype.endsWith=function(theString){var i=this.lastIndexOf(theString);return(i>0&&(i+theString.length)==this.length)};String.prototype.spliced=function(start,len,toInsert){if(!toInsert)toInsert="";if(!start)start=0;if(!len)len=0;return this.replace(new RegExp("(.{"+start+"})(.{"+len+"})(.*)"),"$1"+toInsert+"$3")};Array.prototype.indexOf=function(theObject){for(var i=0;i<this.length;i++)if(theObject==this[i])return i;return-1};Array.prototype.lastObject=function(){return this[this.length-1]};Array.prototype.uniqueCopy=function(){var theUniqArray=this.copy();theUniqArray.removeDuplicates();return theUniqArray};Array.prototype.forEach=function(fn,args){for(var i=0;i<this.length;i++)this[i]=fn.apply(this[i],args);return this};Array.prototype.copy=function(){return[].concat(this)};Array.prototype.removeDuplicates=function(){var removed=[];for(var i=0;i<this.length;i++){var obj=this[i];for(var j=0;j<i;j++){if(this[j]==this[i]){removed.push(this[i]);this.splice(i,1);j=i;i--}}}return removed};Array.prototype.pushAll=function(array){for(var i=0;i<array.length;i++)this.push(array[i]);return this};Array.prototype.unshiftAll=function(array){for(var i=0;i<array.length;i++)this.unshift(array[i]);return this};site9={windowHasLoaded:false};site9.Arrays={copy:function(theArray){return Array.prototype.copy.call(theArray)},indexOf:function(theArray,theObject){return Array.prototype.indexOf.call(theArray,theObject)},uniqueCopy:function(theArray){return Array.prototype.uniqueCopy.call(theArray)}};site9.Objects={toString:function(obj,prefix,separator,joiner,suffix,ignoreEmpties,ignoredKeys){if(!obj&&this!=site9.Objects)obj=this;if(typeof(prefix)!="string")prefix="{ ";if(typeof(separator)!="string")separator=", ";if(typeof(joiner)!="string")joiner=": ";if(typeof(suffix)!="string")suffix=" }";var str="";for(var key in obj){if(!ignoredKeys||ignoredKeys.indexOf(key)!=-1){var value=obj[key];if(!ignoreEmpties||(typeof(value)!="undefined"&&value!="")){if(str.length)str+=separator;str+=key+joiner+value}}}return prefix+str+suffix},copyTo:function(toObj,fromObj){if(!fromObj&&this!=site9.Objects)fromObj=this;for(var key in fromObj){var value=fromObj[key];if(toObj[key]!=value)toObj[key]=value}return toObj}};site9.locate=function(identifier){try{return eval(identifier)}catch(e){return false}};site9.debug=function(theText,consoleName){if(!consoleName)consoleName="out";site9._getDebugConsole(consoleName,true).appendln(theText);return site9};site9.clearDebug=function(consoleName){if(!consoleName)consoleName="out";var console=site9._getDebugConsole(consoleName);if(console)console.clear()};site9._getDebugConsole=function(consoleName,create){if(!consoleName)consoleName="out";var console=site9.DebugConsole.prototype.static_namedConsoles[consoleName];if(!console&&create)console=new site9.DebugConsole(consoleName);return console};site9.DebugConsole=function(name){this.name=name;this.static_namedConsoles[name]=this};site9.DebugConsole.prototype={_buffer:null,_window:null,_popupWarinings:false,enabled:true,_indent:"",_isStartOfLine:true,append:function(theText){if(this.enabled){if(this._isStartOfLine)theText=this.prefix()+theText;this._appendText(theText)}return this},appendln:function(theText){this.append(theText+"\r\n");this._isStartOfLine=true;return this},clear:function(){if(this._hasWindow())this._window.document.getElementById("main").value=this.header();else if(this._buffer)this._buffer=null;this._isStartOfLine=true},increaseIndent:function(){this._indent+='\t'},decreaseIndent:function(){this._indent=this._indent.replace(/\t$/,"")},prefix:function(){return this._indent},header:function(){var str='This window acts as a console for your JavaScript.\r\nSimply call site9.debug("sometext"';if(this.name=="out")str+='[';str+=', "'+this.name+'"';if(this.name=="out")str+=']';str+='); to have it appear here.\r\n--\r\n\r\n';return str},title:function(){return"Site 9 JavaScript Debug Console ["+this.name+"]"},_appendText:function(theText){if(!this._hasWindow()){this._window=this._createWindow();if(!this._window){if(!this._buffer){if(this._popupWarnings)alert("S9 Debug Console ("+this.name+") was not opened (pop-ups blocked?). Debug output will be silently buffered until it can be opened.");this._buffer=" "}this._buffer+=theText;return this}else{if(this._buffer)theText=(this._buffer.substring(1)+theText);this.clear()}}this._window.document.getElementById("main").value+=theText},_hasWindow:function(){return(this._window&&!this._window.closed)},_createWindow:function(){var winName="s9_debug_"+this.name;var win=window.open("",winName,"resizable,scrollbars=NO,width=500,height=500");if(win==null)return false;window.focus();win.name=winName;win.document.open();win.document.write('<html><head><title>'+this.title()+'</title><style>body{margin:0;text-align:right}*{font-family:Monaco;font-size:9px;}textarea{width:99%;height:99.5%;margin:0;padding:0;border:none}div{position:absolute;bottom:0px;right:16px;padding:3px;background:#eee;border:1px solid #ccc;border-bottom:none}</style></head><body><div><a href="javascript:void(window.opener.site9.clearDebug(\''+this.name+'\'))">Clear Console</a></div><textarea id="main"></textarea></body></html>');win.document.close();return win},toString:function(){return'['+this.title()+']'},static_namedConsoles:{}};if((/[?&]site9.debug.enabled=(yes|true|1)\b/i).test(window.location.search)||(/\.local$/).test(window.location.hostname)||(/^localhost$/).test(window.location.hostname)||(/LocalApp\.woa/).test(window.location.pathname)){var x=site9._getDebugConsole("out",true);x.super_prefix=x.prefix;x.prefix=function(){return"["+new Date().getTime()+"] "+this.super_prefix()};x=site9._getDebugConsole("alert",true);x._createWindow=function(){return null};x._popupWarinings=false;x.super_appendln=x.appendln;x.appendln=function(theText){this.super_appendln(theText);window.alert(this._buffer.substring(1));this.clear();return this};var x=site9._getDebugConsole("defer",true);x._clientConsole=site9._getDebugConsole("out");x.prefix=function(){return this._clientConsole.prefix()};x.increaseIndent=function(){this._clientConsole.increaseIndent();return this};x.decreaseIndent=function(){this._clientConsole.decreaseIndent();return this};x._createWindow=function(){site9.debug("initiating defer.flush() interval.");setInterval('site9._getDebugConsole("defer").flush()',2000);return{document:{value:"",getElementById:function(){return this}},closed:false}};x.header=function(){return""};x.flush=function(){if(this._window.document.value.length>0){site9.debug(this._window.document.value);this._window.document.value=""}}}else{site9.debug=site9.clearDebug=function(){}}try{site9.debug("Using built-in Node constants (ELEMENT_NODE: "+Node.ELEMENT_NODE+")");site9._NodeConstants=Node}catch(e){site9._NodeConstants={ELEMENT_NODE:1,DOCUMENT_NODE:9,DOCUMENT_FRAGMENT_NODE:11}}function _(nodeID){if(typeof(nodeID)=="string")return document.getElementById(nodeID);return nodeID};function __(nodeID){if(typeof(nodeID)=="string")return site9.getElementBySelector(nodeID);return nodeID};site9.isStructuralNode=function(theNode){var ntype=theNode.nodeType;return(ntype==site9._NodeConstants.ELEMENT_NODE||ntype==site9._NodeConstants.DOCUMENT_NODE||ntype==site9._NodeConstants.DOCUMENT_FRAGMENT_NODE)};site9.nodeAncestry=function(theNode,stoppingBefore){var list=[];if(theNode)while((theNode=theNode.parentNode)&&(theNode!=stoppingBefore))list.push(theNode);return list};site9.nodePathString=function(theNode){var pstr="";var path=site9.nodeAncestry(theNode);path.reverse();path.push(theNode);for(var i=0;i<path.length;i++){theNode=path[i];if(i>0)pstr+='/';pstr+=site9.nodeDescription(theNode)}return pstr};site9.nodeDescription=function(theNode){if(!theNode)return"";else if(theNode==window)return"window";else if(typeof(theNode)=="string")return theNode;else if(theNode.nodeType!=site9._NodeConstants.ELEMENT_NODE)return theNode.nodeName;var desc=theNode.tagName;if(theNode.id)desc+='#'+theNode.id;if(theNode.className)desc+='.'+theNode.className.replace(/\s+/g,'.');if(theNode.parentNode)desc+=':nth-child('+site9.Arrays.indexOf(theNode.parentNode.childNodes,theNode)+')';return desc};site9.modifyClassNames=function(theNodes,regex,replacements){for(var i=0;i<theNodes.length;i++)theNodes[i].className=theNodes[i].className.replace(regex,replacements)};site9.alterClassNames=function(theNodes,classToAdd,classToRemove){if(classToAdd)site9.modifyClassNames(theNodes,/^(.*)\s*$/,"$1 "+classToAdd);if(classToRemove)site9.modifyClassNames(theNodes,new RegExp("\\b"+classToRemove+"\\b","g"),"")};site9.getElementByTagName=function(theTag,theNode){return new site9._BasicCssSelector(theTag).selectFirst(theNode)};site9.getElementBySelector=function(theSelector,theNode){return site9.getElementsBySelector(theSelector,theNode)[0]};site9.getElementsBySelector=function(theSelector,theNode){return new site9.CssSelector(theSelector).selectAll(theNode)};site9.getParentByTagName=function(theTag,theNode){return site9.deprecated("site9.getParentByTagName",site9.getParentBySelector)};site9.getParentsByTagName=function(theTag,theNode){return site9.deprecated("site9.getParentsByTagName",site9.getParentsBySelector)};site9.getParentBySelector=function(theSelector,theNode){return new site9.CssSelector(theSelector).selectedNodes(site9.nodeAncestry(theNode))[0]};site9.getParentsBySelector=function(theSelector,theNode){return new site9.CssSelector(theSelector).selectedNodes(site9.nodeAncestry(theNode))};site9.getChildOfParent=function(childSelector,parentSelector,theNode){theNode=site9.getParentBySelector(parentSelector,theNode);if(!theNode)return null;return site9.getElementBySelector(childSelector,theNode)};site9.getChildrenOfParent=function(childSelector,parentSelector,theNode){theNode=site9.getParentBySelector(parentSelector,theNode);if(!theNode)return[];return site9.getElementsBySelector(childSelector,theNode)};site9.getChildrenOfParents=function(childSelector,parentSelector,theNode){var theNodes=site9.getParentsBySelector(parentSelector,theNode);var selected=[];for(var i=0;i<theNodes.length;i++)selected=selected.concat(site9.getElementsBySelector(childSelector,theNode));selected.removeDuplicates();return selected};site9.navigateNodes=function(instructions,theNode){if(!theNode)theNode=document;instructions=unescape(instructions).replace(/\s+/g,"");for(var i=0;i<instructions.length;i++){var instr=instructions.substring(i,i+1);do{if(instr=='^')theNode=theNode.parentNode;else if(instr=='>')theNode=theNode.nextSibling;else if(instr=='v')theNode=theNode.childNodes[0];else if(instr=='<')theNode=theNode.previousSibling;else site9.debug("site9.navigateNodes: Unknown instruction '"+instr+"'");if(!theNode)return null}while(!site9.isStructuralNode(theNode))}return theNode};site9.navigateNodesCss=function(instructions,theNode){instructions=unescape(instructions);instructions=instuctions.replace(/</g,'^').replace(/>/g,'v');instructions=instuctions.replace(/-/g,'<').replace(/\+/g,'>');return site9.navigateNodes(instructions,theNode)};site9.CssSelector=function(selectorText){selectorText=selectorText.trim();if(!selectorText){this.simpleSels=[];return}this.simpleSels=selectorText.split(/\s*,\s*/);for(var i=0;i<this.simpleSels.length;i++){this.simpleSels[i]=new site9._SimpleCssSelector(this.simpleSels[i])}};site9.CssSelector.prototype={simpleSels:null,selectAll:function(theNode){if(!theNode)theNode=document;var possible=[];for(var i=0;i<this.simpleSels.length;i++)possible=possible.concat(this.simpleSels[i].selectAll(theNode));possible.removeDuplicates();return possible},selectReverse:function(theNode){if(!theNode)theNode=document;var possible=[];for(var i=0;i<this.simpleSels.length;i++)possible=possible.concat(this.simpleSels[i].selectReverse(theNode));possible.removeDuplicates();return possible},selectFirst:function(theNode){return this.selectAll(theNode)[0]},selectLast:function(theNode){return this.selectAll(theNode).reverse()[0]},selectsNode:function(theNode,fromNode){var selectsFrom=this.selectReverse(theNode);if(!fromNode)return selectsFrom.length>0;for(var i=0;i<selectsFrom.length;i++)if(selectsFrom[i]==fromNode)return true;return false},selectedNodes:function(possible,fromNode){var selected=[];for(var i=0;i<possible.length;i++)if(this.selectsNode(possible[i],fromNode))selected.push(possible[i]);return selected},toString:function(){return this.simpleSels.join(", ")},copy:function(){var sel=new site9.CssSelector("");for(var i=0;i<this.simpleSels.length;i++)sel.simpleSels[i]=this.simpleSels[i].copy();return sel}};site9._SimpleCssSelector=function(selectorText){selectorText=selectorText.replace(/\s*([>+])\s*/g," $1");if(!selectorText){this.basicSels=[];return}this.basicSels=selectorText.split(/\s+/);for(var i=0;i<this.basicSels.length;i++){this.basicSels[i]=new site9._BasicCssSelector(this.basicSels[i])}};site9._SimpleCssSelector.prototype={basicSels:null,selectAll:function(theNode){var selected=[theNode];for(var i1=0;i1<this.basicSels.length;i1++){var possible=[];for(var i2=0;i2<selected.length;i2++)possible=possible.concat(this.basicSels[i1].selectAll(selected[i2]));possible.removeDuplicates();selected=possible}return selected},selectReverse:function(theNode){var selected=[theNode];for(var i1=this.basicSels.length-1;i1>=0;i1--){var possible=[];for(var i2=0;i2<selected.length;i2++)possible=possible.concat(this.basicSels[i1].selectReverse(selected[i2]));possible.removeDuplicates();selected=possible}return selected},selectFirst:site9.CssSelector.prototype.selectFirst,selectLast:site9.CssSelector.prototype.selectLast,selectsNode:site9.CssSelector.prototype.selectsNode,selectedNodes:site9.CssSelector.prototype.selectedNodes,toString:function(){return this.basicSels.join(' ')},copy:function(){var sel=new site9._SimpleCssSelector("");for(var i=0;i<this.basicSels.length;i++)sel.basicSels[i]=this.basicSels[i].copy();return sel}};site9._BasicCssSelector=function(selectorText){selectorText=selectorText.trim();this.classNames=[];if(!selectorText)return;if(!/^[<>^+-]/.test(selectorText))selectorText=' '+selectorText;this.joiner=selectorText.charAt(0);selectorText=selectorText.substring(1).trim();if(/^-?\d/.test(selectorText))selectorText=':'+selectorText;selectorText=selectorText.replace(/:first-child/,":0");selectorText=selectorText.replace(/:last-child/,":-1");this.tagName=selectorText.match(/^(\w*)/)[1].toUpperCase();if(this.tagName=="")this.tagName='*';else selectorText=selectorText.substring(this.tagName.length);for(var start=0,end=1;end<=selectorText.length;end++){if(end==selectorText.length||".:#]".indexOf(selectorText.charAt(end))!=-1){var content=selectorText.substring(start+1,end);switch(selectorText.charAt(start)){case'.':this.classNames.push(new RegExp("\\b"+content+"\\b"));break;case':':if(/^-?\d/.test(content))this.childNum=parseInt(content);else{this.unsupported+=':'+content;site9.debug("site9._BasicCssSelector: Pseudo-class '"+content+"' is not supported")}break;case'#':this.id=content;break;case'[':this.unsupported+='['+content+']';site9.debug("site9._BasicCssSelector: Attribute selector '"+content+"' is not supported");break}start=end}}};site9._BasicCssSelector.prototype={tagName:'*',id:null,classNames:null,attributeMap:null,nthChild:null,joiner:null,unsupported:"",selectAll:function(theNode){var possible=this._join(theNode,this.joiner);var selected=[];for(var i=0;i<possible.length;i++){if(this._matchesNode(possible[i]))selected.push(possible[i])}return selected},selectReverse:function(theNode){var selected=[];if(this._matchesNode(theNode))selected=this._join(theNode,this._inverseJoiner());return selected},selectFirst:site9.CssSelector.prototype.selectFirst,selectLast:site9.CssSelector.prototype.selectLast,selectsNode:site9.CssSelector.prototype.selectsNode,selectedNodes:site9.CssSelector.prototype.selectedNodes,_matchesNode:function(theNode){var noTagName=(this.tagName==null);var isDocument=(theNode==document);if(noTagName||isDocument)return(noTagName&&isDocument);if(!site9.isStructuralNode(theNode))return false;if(this.tagName!="*"&&theNode.tagName!=this.tagName)return false;if(this.id&&theNode.id!=this.id)return false;for(var i=0;i<this.classNames.length;i++)if(!this.classNames[i].test(theNode.className))return false;if(this.nthChild!=null){var n=this.nthChild;if(n<0)n+=theNode.parentNode.childNodes.length;if(theNode!=theNode.parentNode.childNodes[n]);return false}return true},_join:function(theNode,theJoiner){switch(theJoiner){case' ':if(this.id){var node=document.getElementById(this.id);return(node&&site9.nodeAncestry(node,theNode.parentNode).lastObject()==theNode)?[node]:[]}else return theNode.getElementsByTagName(this.tagName);case'^':return site9.nodeAncestry(theNode);case'>':return theNode.childNodes;case'<':return[theNode.parentNode];case'+':return[theNode.nextSibling];case'-':return[theNode.previousSibling];default:site9.debug("site9._BasicCssSelector: Unsupported joiner: "+theJoiner);return[]}},_inverseJoiner:function(){switch(this.joiner){case' ':return'^';case'^':return' ';case'>':return'<';case'<':return'>';case'+':return'-';case'-':return'+'}},toString:function(){var str="";if(this.joiner!=null&&this.joiner!=' ')str+=this.joiner+' ';if(this.tagName==null)return str+"document";str+=this.tagName;if(this.id)str+="#"+this.id;for(var i=0;i<this.classNames.length;i++)str+="."+this.classNames[i].source.replace(/\\b/g,"");if(this.nthChild==null){}else if(this.nthChild==0)str+=":first-child";else if(this.nthChild==-1)str+=":last-child";else if(this.nthChild>0)str+=":nth-child("+this.nthChild+")";else str+=":nth-last-child("+this.nthChild+")";str+=this.unsupported;return str},copy:function(){var sel=new site9._BasicCssSelector("");tagName=this.tagName;id=this.id;nthChild=this.nthChild;joiner=this.joiner;unsupported=this.unsupported;for(var i=0;i<this.classNames.length;i++)sel.classNames[i]=this.classNames[i];return sel}};site9.Point=function(x,y){this.x=parseInt(x||0);this.y=parseInt(y||0)};site9.Point.prototype={toString:function(){return"("+this.x+","+this.y+")"}};site9.Size=function(w,h){this.w=parseInt(w||0);this.h=parseInt(h||0)};site9.Size.prototype={toString:function(){return this.w+" x "+this.h}};site9.Rectangle=function(x,y,w,h){this.location=new site9.Point(x,y);this.size=new site9.Size(w,h)};site9.Rectangle.prototype={getExtents:function(){return new site9.Point(this.location.x+this.size.w,this.location.y+this.size.h)},toString:function(){return"[ "+this.location+", "+this.getExtents()+" ]"}};site9.nodeBounds=function(theNode){var bounds=new site9.Rectangle(0,0,theNode.offsetWidth,theNode.offsetHeight);var loc=bounds.location;while(theNode){loc.x+=theNode.offsetLeft;loc.y+=theNode.offsetTop;theNode=theNode.offsetParent}return bounds};site9.validEmail=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;site9.validURL=/^https?:\/\/[a-zA-Z0-9.\-]+\/[a-zA-Z0-9._\/\?\&;=#\-]*$/;site9.verifyEmail=function(emailAddress){site9.deprecated("site9.verifyEmail",null,"Use site9.validEmail.test(...) instead");return site9.validEmail.test(emailAddress)};site9.verifyEmailWithAlert=function(emailAddress){if(site9.validEmail.test(emailAddress))return true;alert("'"+emailAddress+"' does not appear to be a valid e-mail address. Please double-check it.\r\n\r\nE-mail addresses are usually something like 'name@example.com'");return false};site9.verifyURL=function(theURL){site9.deprecated("site9.verifyURL",null,"Use site9.validURL.test(...) instead");return site9.validURL.test(emailAddress)};site9.verifyURLWithAlert=function(theURL){if(site9.validURL.test(theURL))return true;alert("'"+theURL+"' does not appear to be a valid URL. Please double-check it.\r\n\r\nComplete URLs must start with 'http://' or 'https://'");return false};site9.verifyText=function(theText,maxLength){return(theText.length<=maxLength)};site9.verifyTextWithAlert=function(theText,maxLength){if(verifyText(theText,maxLength))return true;theText=theText.substring(maxLength-20,maxLength);alert("The text you provided is too long. Everything after '..."+theText+"' will be cut off.");return false};site9.paginatedConfirm=function(pageHeader,text,linesPP){var lines=text.split("\r\n").join("\n").split("\r").join("\n").split("\n");if(lines.length<linesPP)return confirm(pageHeader+text);var page;var pi=1;var pn=parseInt(""+(lines.length/linesPP))+1;for(var i=0;i<lines.length;i++){page=pageHeader;var eop=i+linesPP;for(var j=i;j<eop;j++){if(j<lines.length)page+=lines[j];page+="\r\n"}page+="\r\nPage "+pi+" of "+pn+".\r\nClick OK to contiue, or Cancel to exit.";if(!confirm(page))return false;i=j;pi++}return true};site9.replaceHash=function(theUrl,newHash){if(!/^(#.*)?$/.test(newHash))newHash='#'+newHash;return theUrl.replace(/(#.*)?$/,newHash)};site9.formUtil={};site9.formUtil.ensureHiddenFieldValue=function(theForm,fieldName,fieldValue){var field=theForm[fieldName];if(!field){field=document.createElement("input");field.setAttribute("type","hidden");field.setAttribute("name",fieldName);theForm.appendChild(field)}field.value=fieldValue};site9.formUtil.replaceUrlField=function(theUrl,fieldName,fieldValue){fieldName=escape(fieldName,1);if(typeof(fieldValue)=="undefined")fieldValue=null;else if(typeof(fieldValue)=="number"&&fieldValue==0)fieldValue="0px";else if(typeof(fieldValue)=="boolean"&&fieldValue==false)fieldValue="false";else if(typeof(fieldValue)=="string"&&fieldValue=="")fieldValue=null;var a=theUrl.search(new RegExp("[?&]"+fieldName+"([=&].*)?$"))+1;if(a>0){var b=theUrl.indexOf('&',a);if(b==-1){b=theUrl.length-1;a--}theUrl=theUrl.substring(0,a)+theUrl.substring(b+1)}if(fieldValue)theUrl+=(theUrl.indexOf('?')>=0?'&':'?')+fieldName+'='+escape(fieldValue,1);return theUrl};site9.formUtil.getUrlField=function(theUrl,fieldName){theUrl=theUrl.replace(/^[^?]*\?/,"");fieldName=escape(fieldName,1);if(theUrl.length>0){var pairs=theUrl.split('&');for(var i=0;i<pairs.length;i++){var pair=pairs[i];if(pair==fieldName||pair.indexOf(fieldName+'=')==0)return pair.substring(pair.indexOf('=')+1)}}return null};site9.formUtil.addCurrentDateTime=function(theFormOrUrl,fieldName){if(!fieldName)fieldName="z";var fieldValue=(new Date()).getTime();if(theFormOrUrl.tagName=="form")return site9.formUtil.ensureHiddenFieldValue(theFormOrUrl,fieldName,fieldValue);else return site9.formUtil.replaceUrlField(theFormOrUrl,fieldName,fieldValue)};site9.events={_pending:[],_dispatcher:{},_nextID:0};site9.events.attach=function(node,eventName,handler,priority,conditional){var attachment=new this._Attachement(node,eventName,handler,priority,conditional);if(typeof(node)=="string"&&this._pending!=null)this._pending.push(attachment);else this._attach(attachment);return attachment};site9.events.dettach=function(attachment){var list;if(typeof(attachment.node)=="string"){list=this._pending;for(var i=0;i<list.length;i++){if(list[i]==attachment){list.splice(i,1);return true}}}else if((list=this._eventQ(attachment.node,attachment.eventName,false))!=null){for(var i=0;i<list.length;i++){if(list[i]==attachment){if(list.length>1)list=list.splice(i,1);else{attachment.node[attachment.eventName]=null;this._dispatcher[attachment.node][attachment.eventName]=null}return true}}}site9.debug("Could not dettach the attachment, perhaps it was already dettached?");return false};site9.events._attach=function(attachment){if(typeof(attachment.node)=="string")attachment.node=site9.getElementBySelector(attachment.node);if(typeof(attachment.handler)=="string")attachment.handler=new Function(attachment.handler);if(typeof(attachment.priority)=="undefined")attachment.priority=0;if(typeof(attachment.conditional)=="string")attachment.conditional=new Function("results",attachment.conditional);var q=this._eventQ(attachment.node,attachment.eventName,true);var notAttached=true;for(var i=0;(notAttached&&i<q.length);i++){if(q[i].priority>attachment.priority){q.splice(i,0,attachment);notAttached=false}}if(notAttached)q.push(attachment)};site9.events._Attachement=function(node,eventName,handler,priority,conditional){this._id=site9.events._nextID++;this.node=node;this.eventName="on"+eventName;this.handler=handler;this.priority=priority;this.conditional=conditional};site9.events._Attachement.prototype={toString:function(attachment){if(!attachment)attachment=this;return"["+attachment._id+"]: "+site9.nodeDescription(attachment.node)+"."+attachment.eventName+"+="+attachment.handler+"("+attachment.priority+")"}};site9.events._loadPending=function(){var list=this._pending;this._pending=null;for(var i=0;i<list.length;i++)this._attach(list[i])};site9.events._dispatch=function(node,eventName,args){var q=this._eventQ(node,eventName,false);if(q==null)return;var results=[];for(var i=0;i<q.length;i++){var qi=q[i];try{if(!qi.conditional||qi.conditional(results))results.unshift(qi.handler.apply(node,args))}catch(e){site9.debug("Exception while executing event: "+node+"["+eventName+"]["+i+"]:\r\n"+site9.Objects.toString(e))}}return results[0]};site9.events._eventQ=function(node,eventName,create){var qs4Obj=this._dispatcher[node];if(!qs4Obj){if(create)this._dispatcher[node]=qs4Obj=new Object();else return null}var q4Event=qs4Obj[eventName];if(!q4Event){if(create){qs4Obj[eventName]=q4Event=[];var defaultHandler=node[eventName];if(typeof(defaultHandler)=="function")q4Event.push(new this._Attachement(node,eventName,defaultHandler,0));node[eventName]=new Function("return site9.events._dispatch(this,'"+eventName+"',arguments);")}else return null}return q4Event};site9.events.conditionals={isTrue:function(results){return results[0]==true},isFalse:function(results){return results[0]==false},isNotTrue:function(results){return results[0]!=true},isNotFalse:function(results){return results[0]!=false}};site9.events.currentEvent=function(pEvent){if(pEvent){return pEvent}if(window.event){return window.event}var x;if(x=site9.events.currentEvent.caller){if(x=site9.events.currentEvent.caller.arguments){if(x.length>0){return site9.events.currentEvent.caller.arguments[0]}}}return null};site9.events.attach(window,"load","site9.events._loadPending();",-1);site9.HttpConnection=function(async,allowsQueuing,onload,onerror){this._id="id:"+site9.HttpConnection.prototype._static_nextId++;this._async=async;this._usesQ=allowsQueuing;this._q=[];this._current=null;this._loadAttachment=null;this._errorAttachment=null;this.xmlHttp=null;this._reusable=0;if(onload)this.onload=onload;else if(async)this.onload=function(){site9.debug("site9.HttpConnection taking no action onload!")};if(onerror)this.onerror=onerror;else if(async)this.onerror=function(){site9.debug("site9.HttpConnection taking no action onerror.")}};site9.HttpConnection.prototype={get:function(url){this.push(this.queuedGET(url));return this},post:function(url,data){this.push(this.queuedPOST(url,data));return this},onload:function(){},onerror:function(){},succeeded:function(){return(200<=this.xmlHttp.status&&this.xmlHttp.status<300)},getCurrentRequest:function(){return this._current},createGET:function(url){return{method:"GET",url:url,data:null}},createPOST:function(url,data){return{method:"POST",url:url,data:data}},push:function(request){if(!this._usesQ)this.stop(true);this._q.push(request);if(this._current==null)this._resume()},unshift:function(request){if(!this._usesQ)this.stop(true);this._q.unshift(request);if(this._current==null)this._resume()},stop:function(all){if(this.xmlHttp)this.xmlHttp.abort();if(all)this._q=[];this._resume();return this},_resume:function(){this._checkAttachmentTo("load");this._checkAttachmentTo("error");this._current=null;if(this._q.length>0){var request=this._q.shift();this._current=request;switch(this._reusable){case 0:try{this.xmlHttp=new XMLHttpRequest();this._reusable=1}catch(e1){try{this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");this._reusable=0}catch(e2){try{this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");this._reusable=0}catch(e3){site9.debug("No XML HTTP found.");return}}}case 1:this.xmlHttp.onreadystatechange=new Function("site9.HttpConnection.prototype._static_onreadystatechange('"+this._id+"');");case 2:site9.HttpConnection.prototype._static_active[this._id]=this}this.xmlHttp.open(request.method,request.url,this._async);this.xmlHttp.send(request.data);if(!this._async)site9.HttpConnection.prototype._static_onreadystatechange(this._id)}},_checkAttachmentTo:function(eventName){var checkName="_"+eventName+"Attachment";var fnName="on"+eventName;if(this[checkName]!=this[fnName]){site9.events.attach(this,eventName,"this._resume();",10);this[checkName]=this[fnName]}},toString:function(){return'[site9.HttpConnection ('+this._id+')]'},_static_nextId:0,_static_active:{},_static_onreadystatechange:function(id){var context=site9.HttpConnection.prototype._static_active[id];if(!context)return;if(context.xmlHttp.readyState==4){if(context.succeeded())context.onload(context,1,2,3,4,5);else context.onerror(context,1,2,3,4,5);site9.HttpConnection.prototype._static_active[id]=null}}};site9.pseudoHover={_pseudoHoverBehavior:"behavior:url(/scripts/pseudo_hover.htc);",_specificityFix:"pseudo_hover_fix",loaded:function(theNode){var sheets=[];sheets.pushAll(document.styleSheets);if(sheets.length==0||typeof(sheets[0].imports)=="undefined"){return}if(!theNode){theNode=document;document.body.parentNode.className+=" "+this._specificityFix;document.body.className+=" "+this._specificityFix}var _mediaCleaner=/\bnot\s+/g,_mediaTester=/\b(screen|all)\b/i;var _selectorSplitter=/\s+/,_selectorParser=/^(([^.#:]*))?(\.([^#:]*))?(#([^:]*))?(:(.*))?$/;var behaviors={};for(var i=0;i<sheets.length;i++){var sheet=sheets[i];if(!sheet.media||_mediaTester.test(sheet.media.replace(_mediaCleaner,"$1"))){if(sheet.imports){sheets.pushAll(sheet.imports)}var rules=sheet.rules;for(var j=0;j<rules.length;j++){var rule=rules[j];var selectorText="",behaviorSelText="",ruleStyle;var stopNow=false,shouldDelete=false,shouldAdd=false;var lostSpecificity=0;var endOfHTML=0,endOfBODY=0;var basicSels=rule.selectorText.split(_selectorSplitter);for(var k=0;!stopNow&&k<basicSels.length;k++){var bits=basicSels[k].match(_selectorParser);var foundHTML=false;if(!bits){site9.debug("This basic selector text is unrecognizable: "+basicSels[k]);shouldDelete=shouldAdd=false;stopNow=true}else if(bits[2]=="UNKNOWN"){shouldAdd=false;shouldDelete=true;stopNow=true}else{if(behaviorSelText.length)behaviorSelText+=' ';behaviorSelText+=(bits[1]+bits[3]+bits[5]);switch(bits[2]){case"HTML":if(bits[3])endOfHTML=selectorText.length+4;else endOfHTML=-1;foundHTML=true;break;case"BODY":if(bits[3])endOfBODY=selectorText.length+4;else endOfBODY=-1;break;case"A":if(bits[7])lostSpecificity++;break;default:if(bits[8]=="hover"||bits[8]=="active"){if(!bits[3])bits[3]=('.'+(bits[2]='x'));else{lostSpecificity++}bits[3]=bits[3]+"_pseudo_"+bits[8];bits[7]=bits[8]="";behaviors[behaviorSelText]=true;shouldDelete=shouldAdd=true}}if(selectorText.length)selectorText+=' ';selectorText+=(bits[1]+bits[3]+bits[5]+bits[7]);if(foundHTML)endOfHTML=selectorText.length+1}}if(shouldAdd)ruleStyle=site9.Objects.copyTo({},rule.style);if(shouldDelete){sheet.removeRule(j--)}if(shouldAdd){while(lostSpecificity>0){if(endOfHTML>=0){selectorText=selectorText.spliced(endOfHTML,0,'.'+this._specificityFix+' ');endOfHTML=-1}else if(endOfBODY>=0){selectorText=selectorText.spliced(endOfBODY,0,'.'+this._specificityFix+' ');endOfBODY=-1}else{site9.debug("WARNING: The modified rule's specificity is "+(lostSpecificity*10)+" lower than the original rule");lostSpecificity=0}lostSpecificity--}sheet.addRule(selectorText,"not-a-property: not-a-value",++j);site9.Objects.copyTo(sheet.rules[j].style,ruleStyle)}}}}sheet=document.styleSheets[document.styleSheets.length-1];for(var selectorText in behaviors){sheet.addRule(selectorText,this._pseudoHoverBehavior)}},_turnOn:/\b(\w+)\b/g,_turnOff:/\s*\w+_pseudo_hover\b/g,setState:function(theNode,on){var cn=theNode.className;if(on)cn=cn.replace(this._turnOn,"$1 $1_pseudo_hover")+" x_pseudo_hover";else cn=cn.replace(this._turnOff,"");theNode.className=cn}};site9.events.attach(window,"load","site9.pseudoHover.loaded();");site9.deprecated=function(theName,replacedBy,message){var theCaller=site9.deprecated.caller;if(!theCaller)theCaller=eval(theName);var theCallerCaller=theCaller.caller;if(!theCallerCaller)theCallerCaller=theCaller.arguments.caller;var theCallerArgs=theCaller.arguments;var args="";for(var i=0;i<theCallerArgs.length;i++){if(i>0)args+=", ";args+=typeof(theCallerArgs[i])}site9.debug("\r\n\r\n---\r\nWarning: Deprecated function: "+theName+"( "+args+" ) called from "+(theCallerCaller?theCallerCaller:"?")+(message?"\r\n"+message:"")+"\r\n---\r\n\r\n");if(typeof(replacedBy)=="function")return replacedBy.apply(this,theCaller.arguments)};site9._firstInList=function(theList){site9.deprecated("site9._firstInList",null,"Use theList[0] instead");return theList[0]};site9._getElementsByAttributes=function(theNode,isDirect,theTag,theIds,theClasses){site9.deprecated("site9._getElementsByAttributes",null,"Use new site9.CssSelector( selectorText ).selectAll( theNode ) instead");var selectorText=theTag;if(isDirect)selectorText=">"+selectorText;for(var i=0;i<theIds.length;i++)selectorText+='#'+theIds[i];for(var i=0;i<theClasses.length;i++)selectorText+='.'+theClasses[i];return new site9._BasicCssSelector(selectorText).selectAll(theNode)};site9._isChildOf=function(node,parent){site9.deprecated("site9._isChildOf",null,"Use site9.indexOfObjectInArray( parent, site9.nodeAncestry(node) ) != -1 instead");return site9.indexOfObjectInArray(parent,site9.nodeAncestry(node))!=-1};site9.trim=function(theString){site9.deprecated("site9.trim",null,"Use theString.trim() instead");return theString.trim()};site9._unique=function(theArray){site9.deprecated("site9._unique",null,"Use site9.Arrays.uniqueCopy( theArray ) or theArray.uniqueCopy() instead. Also, you may want to use theArray.removeDuplicates()");return theArray.uniqueCopy()};site9.indexOfObjectInArray=function(theObject,theArray){site9.deprecated("site9.indexOfObjectInArray",null,"Use site9.Arrays.indexOf( theArray, theObject ) or theArray.indexOf( theObject ) instead");return theArray.indexOf(theObject)};function S9debug(theText){return site9.deprecated("S9debug",site9.debug)};function S9Feature(theFeatureName){site9.deprecated("S9Feature",null,"Use new Object() or {} instead");return Object()};function S9modifyClassNames(theNodes,regex,replacements){return site9.deprecated("S9modifyClassNames",site9.modifyClassNames)};function S9getElementsBySelector(theSelector,theNode){return site9.deprecated("S9getElementsBySelector",site9.getElementsBySelector)};function S9getElementsByAttributes(theNode,isDirect,theTag,theIds,theClasses){return site9.deprecated("S9getElementsByAttributes",site9._getElementsByAttributes)};function S9isChildOf(node,parent){return site9.deprecated("S9isChildOf",site9._isChildOf)};function S9unique(theArray){return site9.deprecated("S9unique",site9._unique)};function trim(theString){return site9.deprecated("trim",site9.trim)};function verifyEmail(emailAddress){return site9.deprecated("verifyEmail",site9.verifyEmail)};function verifyEmailWithAlert(emailAddress){return site9.deprecated("verifyEmailWithAlert",site9.verifyEmailWithAlert)};function verifyURL(theURL){return site9.deprecated("verifyURL",site9.verifyURL)};function verifyURLWithAlert(theURL){return site9.deprecated("verifyURLWithAlert",site9.verifyURLWithAlert)};function verifyText(theText,maxLength){return site9.deprecated("verifyText",site9.verifyText)};function verifyTextWithAlert(theText,maxLength){return site9.deprecated("verifyTextWithAlert",site9.verifyTextWithAlert)};function S9startOfElementWithId(theHTML,theID){return site9.deprecated("S9startOfElementWithId",site9.htmlParser.startOfElementWithId)};function S9endOfElementWithId(theHTML,theID,start){return site9.deprecated("S9endOfElementWithId",site9.htmlParser.endOfElementWithId)};function S9getInnerHTML(theHTML){return site9.deprecated("S9getInnerHTML",site9.htmlParser.getInnerHTML)};function S9splitAroundElementWithId(theHTML,theID){return site9.deprecated("S9splitAroundElementWithId",site9.htmlParser.splitAroundElementWithId)};site9.Collection=function(collectionName,min,defaultState,max){this.name=collectionName;this._activateActions=[];this._deactivateActions=[];this._offscreenImages=[];this.min=(min||1);this.max=(max||0);this.defaultState=defaultState;if(collectionName){site9.Collections[collectionName]=this;this._locator=new RegExp('^#'+this.name+'=(.+)$');if(this._locator.test(window.location.hash))this.changeTo(window.location.hash)}if(this.activeState==null&&this.defaultState!=null)this.changeTo(this.defaultState)};site9.Collections={};site9.Collection.prototype={activeState:null,_locator:null,timeout:null,wrap:true,cachesNodes:true,recordStateInHash:function(ofObjectWithHash){if(this.name&&site9.windowHasLoaded){if(!ofObjectWithHash)ofObjectWithHash=window.location;ofObjectWithHash.hash=this.name+'='+this.activeState;return true}else return false},changeTo:function(newState){if(this.timeout){clearTimeout(this.timeout);this.timeout=null}if(newState=="")newState=null;if(newState==null){newState=this.defaultState}else{if(typeof(newState)=="string"&&this._locator&&this._locator.test(newState)){newState=newState.match(this._locator)[1]}var newStateNum=parseInt(newState);if(!isNaN(newStateNum)){newState=newStateNum;if(this.max&&newState>this.max)newState=(this.wrap?this.min:this.max);if(newState<this.min)newState=(this.wrap?this.max:this.min)}}if(this.activeState!=newState){this.ondeactivate(this.activeState);this.activeState=newState;this.onactivate(this.activeState)}return true},changeToRelative:function(delta){this.changeTo((this.activeState||this.min)+delta)},changeToNext:function(){this.changeToRelative(1)},changeToPrevious:function(){this.changeToRelative(-1)},onactivate:function(state){if(this.onWillActivate)this.onWillActivate(state);this._notifyListeners(state,this._activateActions);if(this.onDidActivate)this.onDidActivate(state)},ondeactivate:function(state){if(this.onWillDectivate)this.onWillDectivate(state);this._notifyListeners(state,this._deactivateActions);if(this.onDidDectivate)this.onDidDectivate(state)},_notifyListeners:function(state,listeners){for(var i=0;i<listeners.length;i++){listeners[i].invoke(state)}},display:function(selectorText,display,trigger){return this._addAction(new site9._CollectionAction(selectorText,null,display),trigger)},swap:function(selectorText,attr,list,trigger){return this._addAction(new site9._CollectionAction(selectorText,attr,list,null,true),trigger)},replace:function(selectorText,attr,regexp,replacements,trigger){return this._addAction(new site9._CollectionAction(selectorText,attr,regexp,replacements),trigger)},replaceSrc:function(selectorText,regexp,replacements,trigger){return this.replace(selectorText,"src",regexp,replacements,trigger)},invalidate:function(){for(var i=0;i<this._activateActions.length;i++){this._activateActions[i].invalidate()}for(var i=0;i<this._deactivateActions.length;i++){this._deactivateActions[i].invalidate()}},_addAction:function(theAction,trigger){if(trigger=="activate")trigger=true;else if(trigger=="deactivate")trigger=false;else{site9.debug("unknown trigger: "+trigger);return}(trigger?this._activateActions:this._deactivateActions).push(theAction);if(this.activeState!=null){if(trigger){theAction.invoke(this.activeState)}else if(this.max){for(var i=this.min;i<=this.max;i++){}}}return theAction},_retainImage:function(src){var img=new Image();img.src=src;this._offscreenImages.push(img)}};site9._CollectionAction=function(selectorText,attr,options,replacements,stateless){this._selector=new site9.CssSelector(selectorText);this._nodes=null;this._attr=attr;this._options=options;this._replacements=replacements;this._stateless=stateless};site9._CollectionAction.prototype={invoke:function(state){var list=this.nodes();var node=this._stateless?list[0]:list[state-1];if(!node){site9.debug("Ignoring missing node!")}else if(this._replacements){node[this._attr]=node[this._attr].replace(this._options,this._replacements)}else if(this._attr){node[this._attr]=this._options[state]}else{if(node.style.display!=this._options)node.style.display=this._options}},invalidate:function(){this._nodes=null},nodes:function(){var list=this._nodes;if(list==null){list=this._selector.selectAll();if(this.cachesNodes)this._nodes=list}return list}};site9.linkTBA=function(){alert("The page or service to which this link refers is unfinished. Please check back later");return false};site9.events.attach(window,"load","site9.windowHasLoaded=true");