function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}
	function opacity(id, opacStart, opacEnd, millisec) {
		//speed for each frame
		var speed = Math.round(millisec / 100);
		var timer = 0;
	
		//determine the direction for the blending, if start and end are the same nothing happens
		if(opacStart > opacEnd) {
			for(i = opacStart; i >= opacEnd; i--) {
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
			//document.getElementById(id).style.display = 'none';
		} else if(opacStart < opacEnd) {
			for(i = opacStart; i <= opacEnd; i++)
				{
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
		}
	
	}
	
	//change the opacity for different browsers
	function changeOpac(opacity, id) {
		var object = document.getElementById(id).style;
		object.opacity = (opacity / 100);
		object.MozOpacity = (opacity / 100);
		object.KhtmlOpacity = (opacity / 100);
		object.filter = "alpha(opacity=" + opacity + ")";
		if(opacity > 0) document.getElementById(id).style.display = 'block';
		else document.getElementById(id).style.display = 'none';
	} 
	
	function writeFlash(url_root, width, height, bgcolor, version, name) {
		if (version == null || version == ''){
			version = '7,0,0,0';
		}
		document.writeln("<object name='"+name+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");
		document.writeln(" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+version+"' ");
		document.writeln(" width='"+width+"' height='"+height+"'> ");
		document.writeln("<param name='movie' value='"+url_root+"'>");
		document.writeln("<param name='quality' value='high'>");
		document.writeln("<param name='menu' value='false'>");
		document.writeln("<param name='bgcolor' value='#"+bgcolor+"'>");
		if (bgcolor == null || bgcolor == 'FFFFFF'){
			document.writeln("<param name='wmode' value='transparent'>");
		}
		document.writeln("<embed src='"+url_root+"' ");
		if (bgcolor == null || bgcolor == 'FFFFFF'){
			document.writeln(" wmode='transparent' ");
		}
		
		document.writeln(" quality='high' bgcolor='#"+bgcolor+"'  width='"+width+"' height='"+height+"' ");
		document.writeln(" type='application/x-shockwave-flash' ");
		document.writeln(" pluginspage='http://www.macromedia.com/shockwav/download/index.cgi?P1_Prod_Version=ShockwaveFlash'");
		document.writeln(" menu='false'>");
		document.writeln("</embed></object>");
	}
	
	
/*--------------------------------------------------------------------------------------------------------------------------------------*/;


	/*
	 * Função de validação e formatação de campos(máscara)
	 * obj 		-> Objeto que deseja aplicar a máscara
  	 * str 		-> String que deseja usar.
  	 * strone	-> Realizar ou não a validação.
	 * mask 	-> Texto que representa o nome do objeto que representa o radio. 	 
	 */

	MaskData    	= "  /  /    ";
	MasKCPF			= "   .   .   -  ";
	MasKCNPJ		= "  .   .   /    -  ";
	MaskCEP			= "     -   ";
	MaskHora   		= "  :  ";
	MaskMonetario   = " .   .   .   ,    ";
	
		
	StrAlfaMin		= "abcdefghijklmnopqrstuvwxyz";
	StrAlfaMai		= "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	StrNumeros 		= "0123456789";
	StrTodos		= "abcdefghijklmnopqrstuvwxyz. ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}[]<>,.;:?/ºª²³¹|\áéíóúÁÉÍÓÚãõÃÕâêîôûÂÊÎÔÛäëïöüÄËÏÖÜàèìòùÀÈÌÒÙçÇ";
	StrEmail   		= "abcdefghijklmnopqrstuvwxyz_-.0123456789";
	StrTelefones 	= "()-x+ 0123456789";
		
	ChrEmail  	= "@";
	ChrBarra   	= "/";
	ChrVirgula 	= ",";
	ChrPonto 	= ".";

	function validaTecla(obj,str,strone,mask) {
		code = (window.Event) ? event.which : event.keyCode;
		mykey=String.fromCharCode(code);
		if(code==8 || code==9 || code==13) return true;
		if ( ( ( str.indexOf(mykey)==-1 & strone.indexOf(mykey)==-1 ) || 
		( obj.value.indexOf(mykey)!=-1 & strone.indexOf(mykey)!=-1) )) return false; 
		else {
			tam=obj.value.length;
			submask=mask.substr(tam,mask.length-tam);
			while (submask.indexOf(' ')!=-1 && submask.indexOf(' ')!=0) {
				obj.value=obj.value+submask.charAt(0);
				tam++;
				submask=mask.substr(tam,mask.length-tam);
			}
			if(obj.value.length<mask.length || mask.length==0) return true; 
			else {
				if(obj.value.length>mask.length) obj.value=obj.value.substr(0,mask.length);
				return false;
			}
		}
	}
	
	
function redimensiona(){
	$("#div_menu_fundo1").height( $("#area_conteudo").height()+150 );
}
