function $(id){return document.getElementById(id)}function submitOnEnter(event){var keycode;if(window.event){keycode=window.event.keyCode}else if(event.which){keycode=event.which}else{return false}if(keycode==13){return true}else return false}function getInputByEnding(form,inputId){var inputs=document.getElementsByTagName('input');var submit;if(inputs!=null&&inputs.length>0){for(i=0;i=s.length&&t.substr(t.length-s.length)==s}function forceSubmit(buttonId){var inputs=document.getElementsByTagName('input');var submit;if(inputs!=null&&inputs.length>0){for(i=0;i0){for(i=0;imax)field.value=field.value.substring(0,max)}function submitAndCheck(buttonId){testPopUp();forceSubmit(buttonId)}function forceCaptchaRefresh(randomId){document.getElementById("subViewContractDetails:iceForm:captchaRandomImage").src="/captcha?"+randomId;return false}function putWarning(elem,msg){if(elem.value==null||elem.value=="")elem.value=msg}function removeWarning(elem,msg){if(elem.value==msg)elem.value=""}function matches(string,regexPattern){var pattern=new RegExp(regexPattern,'gi');var matches=string.match(pattern);return matches.split(',').lenght}function testPassword(passwd,idRectangle,idColorRectangle){var intScore=0;if(passwd.length>0){if(passwd.length<5){intScore=(intScore+3)}else if(passwd.length>4&&passwd.length<8){intScore=(intScore+6)}else if(passwd.length>7){intScore=(intScore+18)}if(passwd.match(/[a-z]/)){intScore=(intScore+1)}if(passwd.match(/[A-Z]/)){intScore=(intScore+5)}if(passwd.match(/\d+/)){intScore=(intScore+5)}if(passwd.match(/(.*[0-9].*[0-9].*[0-9])/)){intScore=(intScore+5)}if(passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)){intScore=(intScore+5)}if(passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){intScore=(intScore+5)}if(passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){intScore=(intScore+2)}if(passwd.match(/([a-zA-Z])/)&&passwd.match(/([0-9])/)){intScore=(intScore+2)}if(passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)){intScore=(intScore+2)}}setProgressBar(intScore,idRectangle,idColorRectangle)}function setProgressBar(intScore,idRectangle,idColorRectangle){var progressBar=document.getElementById(idColorRectangle);var rectangle=document.getElementById(idRectangle);progressBar.style.width=(intScore*2)+"%";if(intScore==0){progressBar.style.display="none";rectangle.style.display="none";return}else{progressBar.style.display=null;rectangle.style.display=null}if(intScore>39){progressBar.style.backgroundColor="#3bce08";rectangle.style.border="1px solid #ccc";return}if(intScore>29){progressBar.style.backgroundColor="orange";rectangle.style.border="1px solid #ccc";return}if(intScore<19&&intScore>0){progressBar.style.backgroundColor="red";rectangle.style.border="1px solid #ccc";return}}function toogleChildVisibility(id){var obj=document.getElementById(id).childNodes[0];if(obj.style.display=="none"){obj.style.display="inline"}else{obj.style.display="none"}}function toogleVisibility(id){var obj=document.getElementById(id);if(obj.style.display=="none"){obj.style.display="inline"}else{obj.style.display="none"}}function isVisible(id){var obj=document.getElementById(id);return obj.style.display!="none"}function toogleClass(id,c1,c2){var obj=document.getElementById(id);if(obj.className==c1){obj.className=c2}else{obj.className=c1}}var tooltip=function(){var id='tt';var top=3;var left=3;var maxw=300;var speed=10;var timer=20;var endalpha=95;var alpha=0;var tt,t,c,b,h;var ie=document.all?true:false;return{show:function(v,w){if(tt==null){tt=document.createElement('div');tt.setAttribute('id',id);t=document.createElement('div');t.setAttribute('id',id+'top');c=document.createElement('div');c.setAttribute('id',id+'cont');b=document.createElement('div');b.setAttribute('id',id+'bot');tt.appendChild(t);tt.appendChild(c);tt.appendChild(b);document.body.appendChild(tt);tt.style.opacity=0;tt.style.filter='alpha(opacity=0)';document.onmousemove=this.pos}tt.style.display='block';c.innerHTML=v;tt.style.width=w?w+'px':'auto';if(!w&&ie){t.style.display='none';b.style.display='none';tt.style.width=tt.offsetWidth;t.style.display='block';b.style.display='block'}if(tt.offsetWidth>maxw){tt.style.width=maxw+'px'}h=parseInt(tt.offsetHeight)+top;clearInterval(tt.timer);tt.timer=setInterval(function(){tooltip.fade(1)},timer)},pos:function(e){var u=ie?event.clientY+document.documentElement.scrollTop:e.pageY;var l=ie?event.clientX+document.documentElement.scrollLeft:e.pageX;tt.style.top=(u-h)+'px';tt.style.left=(l+left)+'px'},fade:function(d){var a=alpha;if((a!=endalpha&&d==1)||(a!=0&&d==-1)){var i=speed;if(endalpha-a'+this.point.name+': '+this.y+' %'}},plotOptions:{pie:{allowPointSelect:true,cursor:'pointer',dataLabels:{enabled:true,formatter:function(){if(this.y>5)return''+this.point.name+''},color:'#333333',style:{font:'12px Trebuchet MS, Verdana, sans-serif'}}}},legend:{enabled:false,layout:'vertical',style:{display:'none',left:'auto',bottom:'auto',right:'50px',top:'100px'}},series:[{type:'pie',name:'Perfil Estatistico',data:myData}]})})}function doLogin(inputUserName,inputPassword,defaultFailureUrl,redirectSuccessUrl,formId){var formUserName=document.getElementById('f_username');var formPassword=document.getElementById('f_password');var formDefaultFailureUrl=document.getElementById('f_defaultFailureUrl');var formRedirectSuccessUrl=document.getElementById('f_redirectSuccessUrl');formUserName.value=inputUserName.value;formPassword.value=inputPassword.value;formDefaultFailureUrl.value=defaultFailureUrl;formRedirectSuccessUrl.value=redirectSuccessUrl;var login=document.getElementById(formId);login.submit()}function doLoginCaptcha(inputUserName,inputPassword,defaultFailureUrl,redirectSuccessUrl,formId,captcha){var formUserName=document.getElementById('f_username');var formPassword=document.getElementById('f_password');var formDefaultFailureUrl=document.getElementById('f_defaultFailureUrl');var formRedirectSuccessUrl=document.getElementById('f_redirectSuccessUrl');var formCaptcha=document.getElementById('f_captcha');formUserName.value=inputUserName.value;formPassword.value=inputPassword.value;formDefaultFailureUrl.value=defaultFailureUrl;formRedirectSuccessUrl.value=redirectSuccessUrl;formCaptcha.value=captcha.value;var login=document.getElementById(formId);login.submit()}