<!--inicio bloco javascript -->




<!-- inicio script enfeita form -->
function textOn0(txt){
	document.getElementById(txt).className="textboxOn0";
}

function textNormal0(txt){
	document.getElementById(txt).className="textbox0";
}

function textOn1(txt){
	document.getElementById(txt).className="textboxOn1";
}

function textNormal1(txt){
	document.getElementById(txt).className="textbox1";
}

function textOn2(txt){
	document.getElementById(txt).className="textboxOn2";
}

function textNormal2(txt){
	document.getElementById(txt).className="textbox2";
}
<!-- final script enfeita form -->




<!-- inicio cookie enquete -->
 function vota(id)
			{
				var valido;
				for ( n = 0; n < document.form_enquete.resposta.length; n++ )
				{
					if(document.form_enquete.resposta[n].checked)
					{
					resp = document.form_enquete.resposta[n].value;
					valido = 1;
					}
				}
				if(valido == 1)
				{
					 window.location.href='index.php?Votar=1&id_empresa=<? echo $ID_EMPRESA ?>&id=' + id + '&voto=' + resp;
				}
				else 
				{
					alert('Selecione uma alternativa de resposta');
				}
		  }
			
		  function resultado(){
			  //window.open('enqueteResultado.php?id=1','_atleta','resizable=yes,scrollbars=yes,height=400,width=260,left=50,top=50');
			  window.open('enqueteResult.php?id=1','_atleta','resizable=yes,scrollbars=yes,height=450,width=260,left=50,top=50');
		  }	
<!-- final cookie enquete -->




<!-- inicio funcao valida news -->
function valida_news(form)
{

	if (form.nome.value == "")
    { 
        alert("Digite seu nome completo.");
        form.nome.focus();
        return false;
    }
    
	if (form.email.value.indexOf('@', 0) == -1 ||
		form.email.value.indexOf('.', 0) == -1)
		    {
			  alert("Confira seu e-mail. É necessário inserir um e-mail válido."); 
			  form.email.focus(); 
			  return false;
		    }
	
    return true;
}
<!-- final funcao valida news -->




<!-- inicio funcao hover menu IE6 -->
/*
ie6Hover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" ie6hover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" ie6hover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", ie6Hover);
*/
<!-- final funcao hover menu IE6 maldito -->




<!--inicio funcao show/hide layer -->
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

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_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];}
}
<!--final funcao show/hide layer -->




<!-- inicio funcao cria cookie -->
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
<!-- final funcao cria cookie -->




<!--inicio funcao abrir janelas -->
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
<!--final funcao abrir janelas -->




<!--inicio funcao fontsizer -->
/**
 *  Company:    IBM BCS
 *  @author     Mark Chaimungkalanont
 *  @version    $Revision:$ $Date:$
 **/
var cookieName   = "PixelFontSize_Bremil";
var sizeUnit     = "em";
var defaultSize  = .9;
var maxSize      = 1.05;
var increment    = .05;
var minSize      = .9;
var bInit        = true;

function initFontSize() 
{
    try
    {
        bInit = true;
        var size = readCookie(cookieName);
        size = !isNaN( parseFloat(size) )? parseFloat(size): defaultSize;
        if ( size > maxSize || size < minSize ) 
        {
            size = defaultSize;
        }
        debug("Default: " + size);
        setFontSize(size);
    }
    catch (eException)
    {
    	// Do nothing
    } // end try
}

function changeFontSize(inc) 
{
    if (!bInit)
    {
        initFontSize()
    } // end-if
    var size = parseFloat( getFontSize() );
    size += inc;
    // Test against max and min sizes 
    if (inc > 0) 
        size = Math.min(size, maxSize);
    else 
        size = Math.max(size, minSize);
    saveCookieForever( cookieName, size );
            debug("Change to: " + size);
    setFontSize(size);
}

function reset()
{
    setFontSize(defaultSize);
    eraseCookie(cookieName);
}

function increaseFontSize()
{
    changeFontSize(increment);
}

function decreaseFontSize()
{
    changeFontSize(-increment);
}

function setFontSize(nSize)
{
    var oContent = new getObj("contentInt");
    oContent.style.fontSize = nSize + sizeUnit;
    
    var aTdTags  = document.getElementsByTagName('DIV');
    if (aTdTags)
    {
        for (nIndex = 0; nIndex < aTdTags.length; nIndex++)
        {
            var oTd = aTdTags[nIndex];
            if (oTd.id != 'imgD' && oTd.id != 'imgE' && oTd.id != 'menu' && oTd.id != 'fixo' && oTd.id != 'footer')
            {
                debug("oTd: " + oTd.className + " : change to : " + (nSize * 1) + sizeUnit);

                oTd.style.fontSize = (nSize * 1) + sizeUnit;
            } // end-if
        } // end for    
    } // end-if
}

function getFontSize()
{
    var oContent = new getObj("contentInt");
    return oContent.style.fontSize;
}

// Cookie handling functions
function saveCookie(name,value,days)
{
  if (days) 
  {
    var d = new Date();
    d.setTime(d.getTime()+(days*24*60*60*1000));
    var ex = "; expires="+d.toGMTString();
  }
  else 
  {
    var ex = "";
  }
  
  document.cookie = name+"="+value+ex+"; path=/";
}

function saveCookieForYear(name,value)
{
    saveCookie(name,value,365);
}



function saveCookieForever(name,value)
{
    saveCookie(name,value,1000);
}

function readCookie(name)
{
  var eq = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i<ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(eq) == 0) return c.substring(eq.length,c.length);
  }
  return null;
}

function eraseCookie(name)
{
  saveCookie(name,"",-1);
}

addEvent(window, 'load', initFontSize);

function getObj(name)
{
   this.exists = false;
   if(document.getElementById)
   {
      this.obj = document.getElementById(name);
      // debug(name + " : " + this.obj);
      if(this.obj != null)
      {
         this.style = document.getElementById(name).style;
         this.exists = true;
      }
   }
   else if(document.all)
   {
      this.obj = document.all[name];
      if(this.obj != null)
      {
         this.style = document.all[name].style;
         this.exists = true;
      }
   }
   else if(document.layers)
   {
      this.obj = document.layers[name];
      if(this.obj != null)
      {
         this.style = document.layers[name];
         this.exists = true;
      }
   }
}

function addEvent(oTargetElem, sOnWhat, oFunction)
{
    if (oTargetElem.attachEvent)
    {
        oTargetElem.attachEvent('on'+sOnWhat, oFunction);
    }
    else if(oTargetElem.addEventListener)
    {
        oTargetElem.addEventListener(sOnWhat, oFunction, false);
    }
    else
    {
        // Cannot attach event
    } // end-if
}

function debug(sText)
{
   /*
   var message = document.getElementById("message");
   if (message)
       message.innerHTML += "<li>" + new Date() + " : " + sText + "</li>";
    */
}
<!--final funcao fontsizer -->




<!--inicio funcao alternate rows table -->
// source: http://www.quirksmode.org/dom/getElementsByTagNames.html
function getElementsByTagNames(list,obj) {
	if (!obj) var obj = document;
	var tagNames = list.split(',');
	var resultArray = new Array();
	for (var i=0;i<tagNames.length;i++) {
		var tags = obj.getElementsByTagName(tagNames[i]);
		for (var j=0;j<tags.length;j++) {
			resultArray.push(tags[j]);
		}
	}
	var testNode = resultArray[0];
	if (!testNode) return [];
	if (testNode.sourceIndex) {
		resultArray.sort(function (a,b) {
				return a.sourceIndex - b.sourceIndex;
		});
	}
	else if (testNode.compareDocumentPosition) {
		resultArray.sort(function (a,b) {
				return 3 - (a.compareDocumentPosition(b) & 6);
		});
	}
	return resultArray;
}

/*
 * plaid
 *
 * A JavaScript class for dynamically striping HTML data tables.
 *
 * @author Aaron Collegeman <acollegeman@clutch-inc.com>
 * @version 1.0.0 2006/30/31
 *
 */

function plaid() {

	// some sensible row-color defaults
	var _evenRowColor = 'white';
	var _oddRowColor = '#eee';
	var _specialRowColor = 'black';
	var _reverseSpecialRowTextColor = true;
	var _specialColColor = 'black';
	var _reverseSpecialColTextColor = true;
	var _evenOverlapColor = '#bbb';
	var _oddOverlapColor = '#ddd';
	var _overlapOnClass = null;
	var _paintOverlap = false;

	/*
	 * Performs the formatting configured in this plaid object.
	 * @className Optional; only fix those tables with this class name
	 */
	this.stripe = function(className) {

		var allTables = getElementsByTagNames('table');

		for (var i=0; i<allTables.length; i++) {
			var table = allTables[i];

			if (className && table.className != className)
				continue;

			var tbody;

			for (var c=0; c<table.childNodes.length; c++)
				if (table.childNodes[c].nodeName.toLowerCase() == 'tbody')
					tbody = table.childNodes[c];

			var rowCount = 0;
			var overlapOnCol = new Array();
			for (var c=0; c<tbody.childNodes.length; c++) {

				if (tbody.childNodes[c].nodeName.toLowerCase() == 'tr') {
					var tr = tbody.childNodes[c];
					if (rowCount % 2 == 0)
						tr.style.backgroundColor = _evenRowColor;
					else
						tr.style.backgroundColor = _oddRowColor;

					if (_paintOverlap) {
						var colCount = 0;
						for (var col=0; col<tr.childNodes.length; col++) {
							var node = tr.childNodes[col];
							var nodeName = node.nodeName.toLowerCase();
							if (nodeName == 'th' || nodeName == 'td') {
								//if ((_overlapOnClass && (node.className == _overlapOnClass || overlapOnCol[col] == true)) || (!_overlapOnClass && colCount % 2 != 0)) {
								if ((_overlapOnClass && (node.className == _overlapOnClass || overlapOnCol[colCount])) || (!_overlapOnClass && colCount % 2 != 0)) {
									overlapOnCol[colCount] = true;
									if (rowCount % 2)
										node.style.backgroundColor = _evenOverlapColor;
									else
										node.style.backgroundColor = _oddOverlapColor;
								}
								colCount++;
							}
						}
					}

					rowCount++;
				}
			}
		}
	}

	this.setEvenRowColor = function(color) {
		_evenRowColor = color;
	}

	this.setOddRowColor = function(color) {
		_oddRowColor = color;
	}

	this.setSpecialRowColor = function(color) {
		_specialRowColor = color;
	}

	this.setReverseSpecialRowTextColor = function(color) {
		_reverseSpecialRowTextColor = color;
	}

	this.setSpecialColColor = function(color) {
		_specialColColor = color;
	}

	this.setReverseSpecialColTextColor = function(color) {
		_specialColTextColor = color;
	}

	this.setEvenOverlapColor = function(color) {
		_evenOverlapColor = color;
	}

	this.setOddOverlapColor = function(color) {
		_oddOverlapColor = color;
	}

	this.setOverlapOnClass = function(color) {
		_overlapOnClass = color;
		_paintOverlap = true;
	}

	this.setPaintOverlap = function(b) {
		_paintOverlap = b;
	}

}
<!--final funcao alternate rows table -->




<!--inicio formatacao texto no form -->
function txtBoxFormat(campo, sMask, evtKeyPress) {
var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;

if(document.all) { // Internet Explorer
nTecla = evtKeyPress.keyCode;
} else if(document.layers) { // Nestcape
nTecla = evtKeyPress.which;
} else {
nTecla = evtKeyPress.which;
if (nTecla == 8) {
return true;
}
}

sValue = campo.value;
// Limpa todos os caracteres de formatação que
// já estiverem no campo.
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( " ", "" );
sValue = sValue.toString().replace( " ", "" );
fldLen = sValue.length;
mskLen = sMask.length;

i = 0;
nCount = 0;
sCod = "";
mskLen = fldLen;

while (i <= mskLen) {
bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ":") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/"))
bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " "))

if (bolMask) {
sCod += sMask.charAt(i);
mskLen++;
} else {
sCod += sValue.charAt(nCount);
nCount++;
}
i++;
}

campo.value = sCod;
if (nTecla != 8) { // backspace
if (sMask.charAt(i-1) == "9") { // apenas números...
return ((nTecla > 47) && (nTecla < 58)); } // números de 0 a 9
else { // qualquer caracter...
return true;
}
} else {
return true;
}
}
<!--final formatacao texto no form -->




<!--fim bloco javascript -->

