﻿function getDotNetField(sObjectType,sObjectName){var eObjects=document.getElementsByTagName(sObjectType);if(eObjects!=null){for(var i=0;i<eObjects.length;i++){if(eObjects[i].id.indexOf(sObjectName)>-1){return eObjects[i]}}}}function checaCPF(source,args){var CPF=args.Value;if(CPF.length!=11||CPF=="00000000000"||CPF=="11111111111"||CPF=="22222222222"||CPF=="33333333333"||CPF=="44444444444"||CPF=="55555555555"||CPF=="66666666666"||CPF=="77777777777"||CPF=="88888888888"||CPF=="99999999999"){args.IsValid=false;return}soma=0;for(i=0;i<9;i++){soma+=parseInt(CPF.charAt(i))*(10-i)}resto=11-(soma%11);if(resto==10||resto==11){resto=0}if(resto!=parseInt(CPF.charAt(9))){args.IsValid=false;return}soma=0;for(i=0;i<10;i++){soma+=parseInt(CPF.charAt(i))*(11-i)}resto=11-(soma%11);if(resto==10||resto==11){resto=0}if(resto!=parseInt(CPF.charAt(10))){args.IsValid=false;return}args.IsValid=true;return}function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features)}
function disableForm(){if(document.forms[0].innerHTML.indexOf('__doPostBack',0)>0){PostBackFunction=__doPostBack}__doPostBack=function(a,b){PostBackFunction(a,b);MostrarCarregando()};document.forms[0].onsubmit=function(){iTimer=setInterval(MostrarCarregando,100)}}function MostrarCarregando(){clearInterval(iTimer);for(i=0;i<document.forms[0].elements.length;i++){if(document.forms[0].elements[i]=="[object]"){document.forms[0].elements[i].disabled=true;document.forms[0].elements[i].onfocus=function(){document.body.focus()}}}}
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var _elementTag = ["td","li","p","a","span","label","div","strong","u","h3","h4","h5"];
var _iElementCount = 0;
var _iFontSize = 10;
var _iFontSizeMax = 11;

function changeDivFontSize(divName,iFontSize)
{
    if(_iElementCount < _elementTag.length)
    {
        var _divPrincipal =  document.getElementById(divName);
        changeFontSize(divName,_divPrincipal.getElementsByTagName(_elementTag[_iElementCount]),iFontSize);
    }

}
function changeFontSize(divName,aElements,iFontSize)
{
    if(iFontSize <= _iFontSizeMax && iFontSize >= _iFontSize)
    {
        for(i = 0; i < aElements.length; i++)
        {
            aElements[i].style.fontSize = iFontSize + 'px';
        }
        _iElementCount++;
        document.getElementById(divName).style.fontSize = iFontSize;
        changeDivFontSize(divName,iFontSize);
    }
}

function ZoomInFont(divName)
{
    _iElementCount = 0;
    var _divPrincipal =  document.getElementById(divName);
    var iFontSize = _iFontSize;
    if(_divPrincipal.style.fontSize.toString().length > 0)
    {
        iFontSize = parseInt(_divPrincipal.style.fontSize.toString().split('px').join('').split('pt').join(''));
    }
    iFontSize++;
    changeDivFontSize(divName,iFontSize);
}

function ZoomOutFont(divName)
{
    status = 'chamou';
    _iElementCount = 0;
    var _divPrincipal =  document.getElementById(divName);
    var iFontSize = _iFontSize;
    if(_divPrincipal.style.fontSize.toString().length > 0)
    {
        iFontSize = parseInt(_divPrincipal.style.fontSize.toString().split('px').join('').split('pt').join(''));
    }
    iFontSize--;
    status = iFontSize;
    changeDivFontSize(divName,iFontSize);
}


//-->
