function Utilities(){} Utilities.Constants={"ITEM_DELIMITER":",,","GROUP_DELIMITER":"@@"};Utilities.generateIDNumber=function(){var timestamp=new Date().getTime();var rand=parseInt((Math.random()*100000));return timestamp+rand;};Utilities.DefaultWindow=window;Utilities.Window=window;Utilities.Window.name="n"+Utilities.generateIDNumber();Utilities.setWindow=function(win){Utilities.Window=win;};Utilities.resetWindow=function(){Utilities.Window=Utilities.DefaultWindow;};if(!Utilities.Window.Node) {Utilities.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};} else {Utilities.Node=Utilities.Window.Node;} Utilities.Browser={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(Utilities.Window.navigator.userAgent)||this.searchVersion(Utilities.Window.navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";this.isIpod=this.browser=="iPod";this.isIphone=this.browser=="iPhone";this.isOpera=this.browser=="Opera";this.isMozilla=this.browser=="Firefox"||this.browser=="Mozilla"||this.browser=="Netscape";this.isSafari=this.browser=="Safari";this.isIE=this.browser=="Internet Explorer";this.isiCab=this.browser=="iCab";this.isMac=this.OS=="Mac";this.isWin=this.OS=="Windows";this.isLinux=this.OS=="Linux";this.tested_intra=false;if(this.browser=="Firefox"&&parseFloat(this.version)>=1.5)this.tested_intra=true;else if(this.browser=="Safari"&&parseInt(this.version)>=412)this.tested_intra=true;else if(this.browser=="AppleWebKit/KHTML"&&parseInt(this.version)>=418)this.tested_intra=true;else if(this.browser=="SeaMonkey"&&parseFloat(this.version)>=1)this.tested_intra=true;else if(this.browser=="Camino"&&parseInt(this.version)>=1)this.tested_intra=true;else if(this.browser=="iPhone"||this.browser=="iPod")this.tested_intra=true;this.tested_inter=this.tested_intra;if(this.browser=="Internet Explorer"&&parseInt(this.version)>=7)this.tested_inter=true;else if(this.browser=="Opera"&&parseInt(this.version)>=9)this.tested_inter=true;else if(this.browser=="OmniWeb"&&parseInt(this.version)>=607)this.tested_inter=true;else if(this.browser=="iCab"&&parseInt(this.version)>=3)this.tested_inter=true;var isCMS=(typeof _isCMS=="boolean")?_isCMS:false;if(isCMS&&!this.tested_intra)Utilities.Window.location="https://journalism.indiana.edu/apps/browser_check/";},searchString:function(data){for(var i=0;i0) {var height=Utilities.WindowTypeDimensions.LargeY;var marginTop=parseInt(heightDiff/2);} else {var height=windowHeight;var marginTop=0;} var defaultStyles={"width":Utilities.WindowTypeDimensions.MidLargeX,"height":height,"style":"z-index:9999;position:fixed;display:block;top:0;left:50%;margin:"+marginTop+"px 0 0 -"+parseInt(Utilities.WindowTypeDimensions.MidLargeX/2)+"px;border:1px solid #000;background-color:#000;"};var style=typeof _style=="undefined"?defaultStyles:_style;if((Utilities.Browser.browser=="Internet Explorer"&&parseInt(Utilities.Browser.version)<8)||Utilities.Browser.isIphone||Utilities.Browser.isIpod) return Utilities.openNewWindow(url,"height="+style.height+",width="+style.width+",resizable");if(url=="")return null;var doc=Utilities.Window.document;var iframe=doc.createElement("iframe");iframe.setAttribute("id",id);iframe.setAttribute("style",style);iframe.setAttribute("frameborder","0");iframe.setAttribute("width",style.width);iframe.setAttribute("height",style.height);if(style.style) iframe.setAttribute("style",style.style);iframe.setAttribute("src",url+(url.indexOf("?")==-1?"?":"&")+"iframeid="+id);iframe.screenLock=Utilities.ScreenLock;iframe.removeMe=function(){this.screenLock.unlockScreen();this.parentNode.removeChild(this);};doc.getElementsByTagName("body")[0].appendChild(iframe);Utilities.ScreenLock.lockScreen();return id;};Utilities.openNewWindow=function(_url,_features,_name){var url=_url||"";var features=_features||"";var n=_name||"";n=n.replace(/^\s+/g,"").replace(/\s+$/g,"");if(n=="") var n="n"+Utilities.generateIDNumber();var win=Utilities.Window.open(url,n,features,false);if(win==null) {if(Utilities.Window.confirm("I couldn't open the link in a new window; should I load it in main window?")) Utilities.Window.location.href=url;else return win;} else {return win;} return null;};Utilities.getHTTPObject=function(){if(Utilities.Window.XMLHttpRequest) {try{return new XMLHttpRequest();}catch(e){return null;}} else if(Utilities.Window.ActiveXObject) {try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){return null;}} else return null;};Utilities.HttpRequest=function(obj){this.error=false;this.message="";this.defaultErrorResponse=function(response){var doc=Utilities.Window.document;if(Utilities.useDHTMLWindows) {var error=doc.createElement("span");if(response&&response!="") {error.appendChild(doc.createTextNode(response));} Utilities.alertWindow({message:error});} else {var error="There was an error processing the response.\n";error+=obj.errorString?obj.errorString:"";error+=(!response||response=="")?"":"\nResponse: "+response;Utilities.alertWindow(error);}};if(!obj.URL||typeof obj.URL!="string") {this.error=true;this.message="The given URL is invalid.";} if(typeof obj.method!="string") obj.method="GET";obj.method=obj.method.toUpperCase()=="POST"?"POST":"GET";if(typeof obj.parameters=="undefined") obj.parameters="";if(typeof obj.parameters=="object") obj.parameters=obj.parameters.join("&");if(obj.method=="GET"&&obj.parameters!="") {if(obj.URL.indexOf("?")!=-1) obj.URL+="&"+parameters.join("&");else obj.URL+="?"+parameters.join("&");} var processAsynchronously=true;if(obj.synchronous) processAsynchronously=false;if(obj.username||obj.password) {this.username=obj.username||"";this.password=obj.password||"";} var processXML=false;if(obj.processXML) processXML=true;var returnHttpObj=false;if(obj.returnHttpObj) returnHttpObj=true;obj.defaultErrorResponse=this.defaultErrorResponse;if(!obj.onSuccess) obj.onSuccess=function(){};if(!obj.onFailure) obj.onFailure=function(){};if(obj.holder) this.holder=obj.holder;this.http=null;obj.showWaitWindow=(typeof obj.showWaitWindow=="undefined")?false:(Utilities.useDHTMLWindows?obj.showWaitWindow:false);if(obj.showWaitWindow) obj.waitWindow=null;var http=Utilities.getHTTPObject();if(http==null) {this.error=true;this.message="Unable to create XMLHttpRequest object.";} this.http=http;this.attemptRequest=function(){try {if(obj.showWaitWindow) {var doc=Utilities.Window.document;var waitWindowContent=doc.createElement("table");var tbody=doc.createElement("tbody");var tr=doc.createElement("tr");var td=doc.createElement("td");td.style.textAlign="left";td.appendChild(doc.createTextNode(obj.waitWindowMessage?obj.waitWindowMessage:"Please wait..."));tr.appendChild(td);var transferInterrupt=doc.createElement("input");transferInterrupt.setAttribute("type","button");transferInterrupt.value="Abort";Utilities.addEventHandler(transferInterrupt,"click",function(){http.abort();DHTMLWindow.closeDHTMLWindow(obj.waitWindow);});td=Utilities.Window.document.createElement("td");td.style.textAlign="right";td.appendChild(transferInterrupt);tr.appendChild(td);tbody.appendChild(tr);waitWindowContent.appendChild(tbody);waitWindowContent.style.width="100%";obj.waitWindow=DHTMLWindow.alertWindow({message:waitWindowContent});} var _sendHandler=function(httpObj){if(httpObj.status!=200) {var httpResponse=processXML?httpObj.responseXML:httpObj.responseText;obj.onFailure(httpResponse);} else {var httpResponse=processXML?httpObj.responseXML:httpObj.responseText;obj.onSuccess(httpResponse);} if(obj.showWaitWindow&&Utilities.useDHTMLWindows) DHTMLWindow.closeDHTMLWindow(obj.waitWindow);};if(this.username) http.open(obj.method,obj.URL,processAsynchronously,this.username,this.password);else http.open(obj.method,obj.URL,processAsynchronously);http.onreadystatechange=function(){if(!obj.synchronous&&http.readyState==4)_sendHandler(http);} if(obj.method=="POST") {http.setRequestHeader("Content-type","application/x-www-form-urlencoded");http.setRequestHeader("Content-length",obj.parameters.length);http.setRequestHeader("Connection","close");http.send(obj.parameters);} else if(obj.method=="GET") {http.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");http.send(null);} if(obj.synchronous)_sendHandler(http);} catch(e) {this.error=true;this.message="Unable to connect.";return;}};if(!obj.manualRequest) this.attemptRequest();if(this.error) Utilities.alertWindow(this.message);};Utilities.addEventHandler=function(el,eventType,f){if(el.addEventListener) {el.addEventListener(eventType,f,false);} else if(el.attachEvent) {el["e"+eventType+f]=f;el[eventType+f]=function(){el["e"+eventType+f](Utilities.Window.event);} el.attachEvent("on"+eventType,el[eventType+f]);}};Utilities.removeEventHandler=function(el,eventType,f){if(el.removeEventListener) {el.removeEventListener(eventType,f,false);} else if(el.detachEvent) {el.detachEvent("on"+eventType,el[eventType+f]);el[eventType+f]=null;el["e"+eventType+f]=null;}};Utilities.cancelEventPropagation=function(e){if(!e) {var _e=window.event;_e.cancelBubble=true;} else if(e.stopPropagation) {e.stopPropagation();}};Utilities.addClass=function(el,className){if(el.className=="") el.className=className;else el.className+=" "+className;};Utilities.removeClass=function(el,className){if(el.className==className) {el.className="";} else {var regex=new RegExp("(\\W+)"+className+"\\W+","g");el.className=el.className.replace(regex,"$1");regex=new RegExp("^"+className+"\\W+","g");el.className=el.className.replace(regex,"");regex=new RegExp("\\W+"+className+"$","g");el.className=el.className.replace(regex,"");}};Utilities.hasClass=function(el,className){if(el==null)return false;var classes=el.className.replace(/\s+/g," ").split(" ");for(var i=0;i