var dtCh="/",dtCh="/",minYear=1900,maxYear=2100,dtFormat=[0,1,2],dtExample="12/31/2014";function noSpam(b,a){locationstring="mailto:"+b+"@"+a;window.location=locationstring}function isInteger(c){for(var a=0;a<c.length;a++){var b=c.charAt(a);if(b<"0"||b>"9")return false}return true}function createDate(d){var a=d.split("/"),c=a[0],e=a[1],f=a[2],b=new Date(f,c-1,e);return!isNaN(b.getMonth())?b:new Date}function dateToString(c){var a=c.getMonth()+1,b=c.getDate(),d=c.getFullYear();if(a<10)a="0"+a;if(b<10)b="0"+b;return a+"/"+b+"/20"+(new String(d)).substring(2,4)}function stripCharsInBag(d,e){for(var b="",a=0;a<d.length;a++){var c=d.charAt(a);if(e.indexOf(c)==-1)b+=c}return b}function daysInFebruary(a){return a%4==0&&(!(a%100==0)||a%400==0)?29:28}function DaysArray(b){for(var a=1;a<=b;a++){this[a]=31;if(a==4||a==6||a==9||a==11)this[a]=30;if(a==2)this[a]=29}return this}function isDate(e){var g=DaysArray(12),c=e.split(dtCh);if(c.length!=3)return false;var a=c[dtFormat[0]],b=c[dtFormat[1]],d=c[dtFormat[2]];strYr=d;if(b.charAt(0)=="0"&&b.length>1)b=b.substring(1);if(a.charAt(0)=="0"&&a.length>1)a=a.substring(1);for(var f=1;f<=3;f++)if(strYr.charAt(0)=="0"&&strYr.length>1)strYr=strYr.substring(1);month=parseInt(a);day=parseInt(b);year=parseInt(strYr);return month<1||month>12?false:day<1||day>31||month==2&&day>daysInFebruary(year)||day>g[month]?false:d.length!=4||year==0||year<minYear||year>maxYear?false:isInteger(stripCharsInBag(e,dtCh))==false?false:true}function isEmail(b){var a=b;return a.indexOf("@")==-1||a.indexOf(".")==-1?false:true}function validate(a){return validateForm(a)}function getFieldName(a){return a.getAttribute("label")!=undefined?a.getAttribute("label"):a.getAttribute("name")}function validateForm(e){var a="",k=0,b=false,d,c,i=e.getElementsByTagName("input");for(f=0;f<i.length;f++){theField=i[f];if(theField.style.display=="")if(theField.getAttribute("required")=="true"&&theField.value==""){if(!b){b=true;d=f;c="input"}if(theField.getAttribute("message")==undefined)a+=getFieldName(theField).toUpperCase()+" is required\n";else a+=theField.getAttribute("message")+"\n"}else if(theField.getAttribute("validate")!=undefined&&theField.value!="")if(theField.getAttribute("validate").toUpperCase()=="EMAIL"&&!isEmail(theField.value)){if(!b){b=true;d=f;c="input"}if(theField.getAttribute("message")==undefined)a+=getFieldName(theField).toUpperCase()+" must be a valid email address\n";else a+=theField.getAttribute("message")+"\n"}else if(theField.getAttribute("validate").toUpperCase()=="NUMERIC"&&isNaN(theField.value))if(!isNaN(theField.value.replace(/\$|\,|\%/g,"")))theField.value=theField.value.replace(/\$|\,|\%/g,"");else{if(!b){b=true;d=f;c="input"}if(theField.getAttribute("message")==undefined)a+=getFieldName(theField).toUpperCase()+" must be numeric\n";else a+=theField.getAttribute("message")+"\n"}else if(theField.getAttribute("validate").toUpperCase()=="REGEX"&&theField.getAttribute("regex")!=undefined){var j=new RegExp(theField.getAttribute("regex"));if(!theField.value.match(j)){if(!b){b=true;d=f;c="input"}if(theField.getAttribute("message")==undefined)a+=getFieldName(theField).toUpperCase()+" must be numeric\n";else a+=theField.getAttribute("message")+"\n"}}else if(theField.getAttribute("validate").toUpperCase()=="MATCH"&&theField.getAttribute("matchfield")!=undefined&&theField.value!=e[theField.getAttribute("matchfield")].value){if(!b){b=true;d=f;c="input"}if(theField.getAttribute("message")==undefined)a+=getFieldName(theField).toUpperCase()+" must match"+theField.getAttribute("matchfield")+"\n";else a+=theField.getAttribute("message")+"\n"}else if(theField.getAttribute("validate").toUpperCase()=="DATE"&&!isDate(theField.value)){if(!b){b=true;d=f;c="input"}if(theField.getAttribute("message")==undefined)a+=getFieldName(theField).toUpperCase()+" must be a valid date [MM/DD/YYYY]\n";else a+=theField.getAttribute("message")+"\n"}}var g=e.getElementsByTagName("textarea");for(f=0;f<g.length;f++){theField=g[f];if(theField.style.display==""&&theField.getAttribute("required")=="true"&&theField.value==""){if(!b){b=true;d=f;c="textarea"}if(theField.getAttribute("message")==undefined)a+=getFieldName(theField).toUpperCase()+" is required\n";else a+=theField.getAttribute("message")+"\n"}else if(theField.getAttribute("validate")!=undefined&&theField.value!="")if(theField.getAttribute("validate").toUpperCase()=="REGEX"&&theField.getAttribute("regex")!=undefined){var j=new RegExp(theField.getAttribute("regex"));if(!theField.value.match(j)){if(!b){b=true;d=f;c="input"}if(theField.getAttribute("message")==undefined)a+=getFieldName(theField).toUpperCase()+" is not valid\n";else a+=theField.getAttribute("message")+"\n"}}}var h=e.getElementsByTagName("select");for(f=0;f<h.length;f++){theField=h[f];if(theField.style.display==""&&theField.getAttribute("required")=="true"&&theField.value==""){if(!b){b=true;d=f;c="select"}if(theField.getAttribute("message")==undefined)a+=getFieldName(theField).toUpperCase()+" is required\n";else a+=theField.getAttribute("message")+"\n"}}if(a!=""){alert(a);if(c=="input")i[d].focus();else if(c=="textarea")g[d].focus();else c=="select"&&h[d].focus();return false}else return true}function getURLVar(e){var d=String(document.location).split("?"),c="";if(d[1]){var b=d[1].split("&");for(i=0;i<=b.length;i++)if(b[i]){var a=b[i].split("=");if(a[0]&&a[0]==e)c=a[1]}}return unescape(c)}function submitForm(c,a,d){if(validateForm(c)){if(typeof a!="undefined"&&(a=="delete"&&confirm("Delete "+d+"?")||a!="delete")){var b=c.getElementsByTagName("input");for(f=0;f<b.length;f++)b[f].getAttribute("name")=="action"&&b[f].setAttribute("value",a)}c.submit();formSubmitted=true}return false}function isMacIE5(){var a=navigator.userAgent.toLowerCase(),c=a.indexOf("msie")!=-1,b=a.indexOf("mac")!=-1;return b&&c?false:true}function createCookie(e,d,b){if(b){var a=new Date;a.setTime(a.getTime()+b*24*60*60*1e3);var c="; expires="+a.toGMTString()}else var c="";document.cookie=e+"="+d+c+"; path=/"}function readCookie(e){for(var c=e+"=",d=document.cookie.split(";"),b=0;b<d.length;b++){var a=d[b];while(a.charAt(0)==" ")a=a.substring(1,a.length);if(a.indexOf(c)==0)return unescape(a.substring(c.length,a.length))}return""}function eraseCookie(a){createCookie(a,"",-1)}function setMuraImageOffSets(a){setImageOffSets(a,"class","syndLocal");setImageOffSets(a,"id","portal")}function setImageOffSets(i,j,h){if(j=="class")var c=document.getElementsByClassName(h);else{var c=new Array(1);c[0]=document.getElementById(h)}if(c[0]!=null)for(var a=0;a<c.length;a++)for(var d=c[a].getElementsByTagName("DL"),b=0;b<d.length;b++){var e=null;if(d[b].getElementsByTagName("DD").length>0){var f=d[b].getElementsByTagName("DD")[0];if(f.getElementsByTagName("IMG").length>0)e=f.getElementsByTagName("IMG")[0];else if(f.getElementsByTagName("P").length>0)for(var g=f.getElementsByTagName("P"),a=0;a<g.length;a++)if(g[a].getElementsByTagName("IMG").length>0){e=g[a].getElementsByTagName("IMG")[0];break}if(e!=null){title=new Element.extend(d[b].getElementsByTagName("DT")[0]);e.onload=function(){var a=0;if(this.parentNode.parentNode.getElementsByTagName("DT")[0]!=undefined)var e=new Element.extend(this.parentNode.parentNode);else var e=new Element.extend(this.parentNode.parentNode.parentNode);var f=new Element.extend(e.getElementsByTagName("DT")[0]);a=f.getHeight();var b=e.getElementsByTagName("DD")[0].getElementsByTagName("P");if(b.length)for(var d=0;d<b.length;d++)if(b[d].getElementsByTagName("IMG").length)break;else{var c=new Element.extend(b[d]);c.style.marginLeft=this.width+i+"px";a=a+c.getHeight()+c.style.marginBottom+c.style.marginTop}f.style.marginLeft=this.width+i+"px";this.style.marginTop=-a+"px";this.style.float="left"}}}}}sfHover=function(){if(document.getElementById("navPrimary")!=undefined)for(var b=document.getElementById("navPrimary").getElementsByTagName("LI"),a=0;a<b.length;a++){b[a].onmouseover=function(){this.className+=" sfhover"};b[a].onmouseout=function(){this.className=this.className.replace(new RegExp(" sfhover\\b"),"")}}};window.attachEvent&&window.attachEvent("onload",sfHover);function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function")window.onload=a;else window.onload=function(){b();a()}}function addUnloadEvent(a){var b=window.onunload;if(typeof window.onunload!="function")window.onunload=a;else window.onunload=function(){b();a()}}function keyCheck(b){var a=window.event?event.keyCode:b.keyCode;if(typeof pressed_keys=="undefined")pressed_keys="";if(a==27)pressed_keys=a;else if(a==76)pressed_keys=pressed_keys+""+a;if(a!=27&&a!=76)pressed_keys="";if(pressed_keys!=""){aux=new String(pressed_keys);if(aux.indexOf("2776")!=-1&&location.search.indexOf("display=login")==-1){if(typeof loginURL=="undefined")lu="?display=login";else lu=loginURL;if(typeof returnURL=="undefined")ru=location.href;else ru=returnURL;pressed_keys="";lu=new String(lu);if(lu.indexOf("?")!=-1)location.href=lu+"&returnUrl="+escape(ru);else location.href=lu+"?returnUrl="+escape(ru)}}}function setKeyCheck(){document.onkeydown=keyCheck}function fadeToggle(a){if(jslib=="jquery")$("#"+a).animate({opacity:"toggle"});else Effect.toggle(a,"appear")}function setHTMLEditors(d,e){var b=document.getElementsByTagName("textarea"),c=[];for(i=0;i<b.length;i++)if(b[i].className=="htmlEditor"){var a=new FCKeditor(b[i].id);a.ToolbarSet="htmlEditor";a.Config.EditorAreaCSS=themepath+"/css/editor.css";a.Config.StylesXmlPath=themepath+"/css/fckstyles.xml";a.BasePath=context+"/wysiwyg/";a.Height=d;a.Width=e;a.Config.ImageBrowser=false;a.Config.ImageUpload=false;a.Config.ForcePasteAsPlainText=true;a.Config.StartupFocus=false;a.ReplaceTextarea();c.push(a)}}addLoadEvent(setKeyCheck)
