function IsFilled( f, n ) {
	if ( /\S/i.test( f.value ) == false ) {
		alert( n ); f.focus( ); f.select( ); return false;
	}
	return true;
}

function IsEmail( f, n ) {
	if ( /^[a-z\d][a-z\d\-\._%]*@([a-z\d][a-z\d\-]*)(\.[a-z\d][a-z\d\-]*)*$/i.test( f.value ) == false ) {
		alert( n ); f.focus( ); f.select( ); return false;
	}
	return true;
}

function IsInteger( f, n ) {
	if ( /^\+?\d{1,8}$/i.test( f.value ) == false ) {
		alert( n ); f.focus( ); f.select( ); return false;
	}
	return true;
}

function IsNumber( f, n ) {
	if ( /^\+?\d{1,8}(\.\d{1,8})?$/i.test( f.value ) == false ) {
		alert( n ); f.focus( ); f.select( ); return false;
	}
	return true;
}

function IsDate( f, n ) {
	if ( /^\d{4}\-\d{1,2}\-\d{1,2}$/i.test( f.value ) == false ) {
		alert( n ); f.focus( ); f.select( ); return false;
	}
	return true;
}

function IsDateTime( f, n ) {
	if ( /^\d{4}\-\d{1,2}\-\d{1,2} \d{1,2}\:\d{1,2}\:\d{1,2}$/i.test( f.value ) == false ) {
		alert( n ); f.focus( ); f.select( ); return false;
	}
	return true;
}

function IsSelected( f, n ) {
	if ( f.options.length == 0 || f.selectedIndex < 0 || f.options[ f.selectedIndex ].value == '' ) {
		alert( n ); f.focus( ); return false;
	}
	return true;
}

function IsChecked( f, n ) {
	if ( f.length ) {
		for ( var i = 0; i < f.length; i++ ) {
			if ( f[ i ].checked == true ) {
				return true;
			}
		}
		alert( n ); f[ 0 ].focus( ); return false;
	}
	else if ( f.checked == false ) {
		alert( n ); f.focus( ); return false;
	}
	return true;
}


 

			function openDiv (elName) {
				var theElemenet = document.getElementById(elName);
				if (theElemenet) {
					theElemenet.style.display = "block";
				}
			}
			function closeDiv (elName) {
				var theElemenet = document.getElementById(elName);
				if (theElemenet) {
					theElemenet.style.display = "none";
				}
			}
			
			function showInline (elName) {
				 
				var theElemenet = document.getElementById(elName);
				if (theElemenet) {
					theElemenet.style.display = "block";
				}
			}
		
			function hideInline (elName) {
				var theElemenet2 = document.getElementById(elName);
				if (theElemenet2) {
					theElemenet2.style.display = "none";
				}
			}

function movedn()
{
	if (window.moveupvar) clearTimeout(moveupvar)
	if (iens6)
		if(parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
			crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
	if(-1 * parseInt(crossobj.style.top) + speed >= contentheight)
	{
		crossobj.style.top = 0;
	}
}
function moveup()
{
	if (window.movedownvar) clearTimeout(movedownvar)
	if (iens6&&parseInt(crossobj.style.top)<0)
		crossobj.style.top=parseInt(crossobj.style.top)+speed+"px";
}
function stopscroll()
{
	if (window.moveupvar) clearTimeout(moveupvar)
	if (window.movedownvar) clearTimeout(movedownvar)
}
function movetop()
{
	stopscroll()
	if (iens6)
		crossobj.style.top=0+"px"
}
function getcontent_height()
{
	if (iens6)
		contentheight=crossobj.offsetHeight
}


/***********************************************
* Fixed ToolTip script- 
***********************************************/
		
var tipwidth='150px' //default tooltip width
var tipbgcolor='lightyellow'  //tooltip bgcolor
var disappeardelay=250  //tooltip disappear speed onMouseout (in miliseconds)
var vertical_offset="0px" //horizontal offset of tooltip from anchor link
var horizontal_offset="-3px" //horizontal offset of tooltip from anchor link

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, tipwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function fixedtooltip(menucontents, obj, e, tipwidth){

 if ( menucontents ==0)
 {
///alert ( menucontents );
clearhidetip();
return ;


  }

if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidetip()
dropmenuobj=document.getElementById? document.getElementById("fixedtipdiv") : fixedtipdiv
dropmenuobj.innerHTML=menucontents

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", tipwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
}

function hidetip(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidetip(){
if (ie4||ns6)
delayhide=setTimeout("hidetip()",disappeardelay)
}

function clearhidetip(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

function checkFormat(ft,f,n)	
	{
		if ( /\S/i.test( f.value ) !=  false ) {

		 		var ufile;
				var  fformat;
				
				
				ufile =f.value;	
				fformat = ufile.substring(ufile.length - 3,ufile.length);  
				
				
				 
				 fformat = fformat.toLowerCase();
				
			 
		 
			  		if (fformat !=ft)  
					{
						alert( n ); f.focus( ); f.select( ); return false;
					} 
 			   	
				 
			   
			   	
		
			}
			
		 return true;
	}

 
/////////////////////////////////Blink Label////////////////////////////////////////

function doBlink() {
  // Blink, Blink, Blink...
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink() {
  // Make sure it is IE4
  if (document.all)
    setInterval("doBlink()",500)
}
window.onload = startBlink;


//////////////////
 
<!--
function runDoc(docFile)
{
try {
var word=new ActiveXObject('Word.Application');
eword.Workbooks.Open(docFile);
word.visible=true;
} catch(e) {}
}
//-->
 

/////////////////////////////Select Disbaled////////////////////////////////


function ativaOptionsDisabled(){
					var sels = document.getElementsByTagName('select');
					for(var i=0; i < sels.length; i++){
						sels[i].onchange= function(){ //pra se mudar pro desabilitado
							if(this.options[this.selectedIndex].disabled){
								if(this.options.length<=1){
									this.selectedIndex = -1;
								}else if(this.selectedIndex < this.options.length - 1){
									this.selectedIndex++;
								}else{
									this.selectedIndex--;
								}
							}
						}
						if(sels[i].options[sels[i].selectedIndex].disabled){
							//se o selecionado atual é desabilitado chamo o onchange
							sels[i].onchange();
						}    
						for(var j=0; j < sels[i].options.length; j++){ //colocando o estilo
							if(sels[i].options[j].disabled){
								sels[i].options[j].style.color = '#0066AA';
							}
						}
					}
				}
////////////////////////////////////////////////////////////
		function bringBackBlinky() {
		
		if (swi == 1) {
		sho="visible";
		swi=0;
		}
		else {
		sho="hidden";
		swi=1;
		}
		
		for(i=0;i<na.length;i++) {
		na[i].style.visibility=sho;
		}
		
		setTimeout("bringBackBlinky()", spe);
		}
	///////////////////////////////////////////	
 

