function terraform_textarea_counter(c,a,b){if(c.value.length>b){c.value=c.value.substring(0,b)}else{a.value=b-c.value.length}}var terraFormApi=new Object();terraFormApi.fields=new Object();terraFormApi.forms=new Object();terraFormApi.formatPrototypes=new Object();function getDisabled(){return document.getElementById(this.id).disabled}function getValue(){return document.getElementById(this.id).value}function setDisabled(c){document.getElementById(this.id).disabled=c;if(this.suffixes){var a=this.suffixes.split(",");if(a.length){for(var b in a){if(document.getElementById(this.id+"."+a[b])){document.getElementById(this.id+"."+a[b]).disabled=c}}}}return c}function setValue(a){document.getElementById(this.id).value=a;return a}function toggleDisabled(){return this.setDisabled(!this.getDisabled())}function doNothing(){}function booleanGetValue(){return document.getElementById(this.id).checked}terraFormApi.formatPrototypes["boolean"]=function(a){this.id=a;this.suffixes="label";this.getDisabled=getDisabled;this.getValue=booleanGetValue;this.setDisabled=setDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};terraFormApi.formatPrototypes.button=function(a){this.id=a;this.suffixes="";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=setDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};terraFormApi.formatPrototypes.calendar=function(a){this.id=a;this.suffixes="anchor";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=setDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};function checkboxGetValue(){var d=document.getElementById(this.id).title;var b=new Array();var a;for(var c=0;c<d;c++){a=document.getElementById(this.id+".value."+c);if(a.checked){b.push(a.value)}}return b}function checkboxSetDisabled(b){var c=document.getElementById(this.id).title;for(var a=0;a<c;a++){document.getElementById(this.id+".value."+a).disabled=b;document.getElementById(this.id+".label."+a).disabled=b}document.getElementById(this.id+".fieldset").disabled=b;return b}terraFormApi.formatPrototypes.checkbox=function(a){this.id=a;this.getDisabled=getDisabled;this.getValue=checkboxGetValue;this.setDisabled=checkboxSetDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};terraFormApi.formatPrototypes.colorpicker=function(a){this.id=a;this.suffixes="anchor";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=setDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};terraFormApi.formatPrototypes.combo=function(a){this.id=a;this.suffixes="select";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=setDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};function datepickerGetValue(){var c=document.getElementById(this.id+".year").value;var a=document.getElementById(this.id+".month").value;var b=document.getElementById(this.id+".day").value;if((c>0)&&(a>0)&&(b>0)){return new Date(c,a-1,b)}else{return null}}function datepickerSetValue(a){document.getElementById(this.id+".year").value=a.getFullYear();document.getElementById(this.id+".month").value=a.getMonth()+1;document.getElementById(this.id+".day").value=a.getDate()}terraFormApi.formatPrototypes.datepicker=function(a){this.id=a;this.suffixes="day,month,year";this.getDisabled=getDisabled;this.getValue=datepickerGetValue;this.setDisabled=setDisabled;this.setValue=datepickerSetValue;this.toggleDisabled=toggleDisabled};terraFormApi.formatPrototypes.enhancedfile=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes.fckeditor=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes.file=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes.hidden=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes.htmlarea=function(a){this.id=a;this.suffixes="";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=doNothing;this.setValue=setValue;this.toggleDisabled=doNothing};terraFormApi.formatPrototypes.image=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes.moveselect=function(a){this.id=a;this.suffixes="left,right,heading1,heading2,button1,button2,button3,button4";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=setDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};terraFormApi.formatPrototypes.msslider=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes["null"]=function(a){this.id=a;this.suffixes="";this.getDisabled=doNothing;this.getValue=doNothing;this.setDisabled=doNothing;this.setValue=doNothing;this.toggleDisabled=doNothing};terraFormApi.formatPrototypes.numeric=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes.password=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes.radio=terraFormApi.formatPrototypes.checkbox;function selectSetDisabled(c){document.getElementById(this.id).disabled=c;if(this.suffixes){var a=this.suffixes.split(",");if(a.length){for(var b in a){if(document.getElementById(this.id+"."+a[b])){document.getElementById(this.id+"."+a[b]).disabled=c}}}}return c}terraFormApi.formatPrototypes.select=function(a){this.id=a;this.suffixes="";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=selectSetDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};function spineditSetDisabled(a){document.getElementById(this.id).disabled=a;if(a){document.getElementById(this.id+".up").style.display="none";document.getElementById(this.id+".down").style.display="none";document.getElementById(this.id+".upDisabled").style.display="inline";document.getElementById(this.id+".downDisabled").style.display="inline"}else{document.getElementById(this.id+".up").style.display="inline";document.getElementById(this.id+".down").style.display="inline";document.getElementById(this.id+".upDisabled").style.display="none";document.getElementById(this.id+".downDisabled").style.display="none"}return a}terraFormApi.formatPrototypes.spinedit=function(a){this.id=a;this.suffixes="";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=spineditSetDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};function starsSetDisabled(a){document.getElementById(this.id).disabled=a;if(a){document.getElementById(this.id+".disabledStars").style.display="inline";document.getElementById(this.id+".enabledStars").style.display="none"}else{document.getElementById(this.id+".disabledStars").style.display="none";document.getElementById(this.id+".enabledStars").style.display="inline"}return a}terraFormApi.formatPrototypes.stars=function(a){this.id=a;this.suffixes="";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=starsSetDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};function submitSetDisabled(a){document.getElementById(this.id).disabled=a;return a}terraFormApi.formatPrototypes.submit=function(a){this.id=a;this.suffixes="";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=submitSetDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};terraFormApi.formatPrototypes.submitbutton=terraFormApi.formatPrototypes.submit;terraFormApi.formatPrototypes.text=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes.textarea=terraFormApi.formatPrototypes.button;function timepickerGetValue(){var a=document.getElementById(this.id+".hours").value;if(document.getElementById(this.id+".minutes")){a=a+":"+document.getElementById(this.id+".minutes").value}if(document.getElementById(this.id+".seconds")){a=a+":"+document.getElementById(this.id+".seconds").value}if(document.getElementById(this.id+".ampm")){a=a+" "+document.getElementById(this.id+".ampm").value}return a}terraFormApi.formatPrototypes.timepicker=function(a){this.id=a;this.suffixes="hours,minutes,seconds,ampm";this.getDisabled=getDisabled;this.getValue=timepickerGetValue;this.setDisabled=setDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};function timespanpickerGetValue(){var a=0;var b=document.getElementById(this.id+".baseUnit").value;if(document.getElementById(this.id+".days")){a+=parseInt(document.getElementById(this.id+".days").value*86400)}if(document.getElementById(this.id+".hours")){a+=parseInt(document.getElementById(this.id+".hours").value*3600)}if(document.getElementById(this.id+".minutes")){a+=parseInt(document.getElementById(this.id+".minutes").value*60)}if(document.getElementById(this.id+".seconds")){a+=parseInt(document.getElementById(this.id+".seconds").value)}switch(b){case"d":return a/86400;case"h":return a/3600;case"n":return a/60;case"s":return a}}terraFormApi.formatPrototypes.timespanpicker=function(a){this.id=a;this.suffixes="days,hours,minutes,seconds";this.getDisabled=getDisabled;this.getValue=timespanpickerGetValue;this.setDisabled=setDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};terraFormApi.formatPrototypes.url=function(a){this.id=a;this.suffixes="button";this.getDisabled=getDisabled;this.getValue=getValue;this.setDisabled=setDisabled;this.setValue=setValue;this.toggleDisabled=toggleDisabled};function terraFormRefresh(b){var a=(b.target)?b.target.form:b.srcElement.form;a.elements[a.name].value="refresh";a.submit()}isMac=(navigator.appVersion.indexOf("Mac")!=-1)?true:false;NS4=(document.layers)?true:false;IEmac=((document.all)&&(isMac))?true:false;IE4plus=(document.all)?true:false;IE4=((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1))?true:false;IE5=((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1))?true:false;ver4=(NS4||IE4plus)?true:false;NS6=(!document.layers)&&(navigator.userAgent.indexOf("Netscape")!=-1)?true:false;var gSafeOnload=new Array();function SafeAddOnload(a){if(IEmac&&IE4){window.onload=SafeOnload;gSafeOnload[gSafeOnload.length]=a}else{if(window.onload){if(window.onload!=SafeOnload){gSafeOnload[0]=window.onload;window.onload=SafeOnload}gSafeOnload[gSafeOnload.length]=a}else{window.onload=a}}}function SafeOnload(){for(var a=0;a<gSafeOnload.length;a++){gSafeOnload[a]()}}function hidebuttons(a){document.body.style.cursor="wait";if(document.all||document.getElementById){for(i=0;i<a.length;i++){var b=a.elements[i];try{if(b.type.toLowerCase()=="submit"||b.type.toLowerCase()=="button"){var d=b.name.match(/_hidden$/);if(d){b.style.display="inline"}else{b.style.display="none"}}}catch(c){}}}}function comboLookup(h){var g=document.getElementById(h);var f=document.getElementById(h+".select");f.selectedIndex=-1;if(g.createTextRange){var d=window.event;if(d.keyCode!=8&&d.keyCode!=46){var b=g.value.toLowerCase();if(b.length){for(var a=0;a<f.options.length;a++){if(b==f.options[a].innerHTML.substr(0,b.length).toLowerCase()){f.selectedIndex=a;g.value=f.options[a].innerHTML;var c=g.createTextRange();c.moveStart("character",b.length);c.select()}}}}else{var b=g.value.toLowerCase();if(b.length){for(var a=0;a<f.options.length;a++){if(b==f.options[a].innerHTML.toLowerCase()){f.selectedIndex=a;g.value=f.options[a].innerHTML;var c=g.createTextRange();c.moveStart("character",b.length);c.select()}}}}}}terraFormApi.formatPrototypes.soeditor=terraFormApi.formatPrototypes.button;terraFormApi.formatPrototypes.tinymce=terraFormApi.formatPrototypes.button;