
					//########### Funções Globais #####################
					var ie4
					var ie5
					var ie6
					var ns4
					var ns6
					
					ie4 = (document.all) ? true : false;
					ie5 = (navigator.userAgent.indexOf("MSIE 5.")>-1) ? true : false;
					ie6 = (navigator.userAgent.indexOf("MSIE 6.")>-1) ? true : false;
					ns4 = (document.layers) ? true : false;
					ns6 = (document.getElementById && !document.all) ? true : false;
					
					url = window.location.href;
					url = (url.indexOf("?") != -1) ? url.substring(0, url.indexOf("?")) : url;
					url = (url.indexOf("#") != -1) ? url.replace("#", "") : url;
					// Abre Janela ----------------------------------------------------
					function openWindow(url, name,  width, height, param){
						
						var url = (url.indexOf("#") != -1)?url.replace("#", ""):url;
						if(typeof(url) != "undefined"){
							
							var str = "height=" + height + ",innerHeight=" + height;
							str += ",width=" + width + ",innerWidth=" + width;
							str +=",scrollbars=yes, status=no, resizable=no";
						
							if (window.screen) {
								var ah = screen.availHeight - 30;
								var aw = screen.availWidth - 10;
								
								var xc = (aw - width) / 2;
								var yc = (ah - height) / 2;
								
								str += ",left=" + xc + ",screenX=" + xc;
								str += ",top=" + yc + ",screenY=" + yc;
							}
							window.open(url+param, name, str,scrollbars="yes");
						}else
							alert("Não foi informado a URL para abrir uma nova janela!!!");
					}
					
					// Redimensiona a Janela--------------------------
					function resizeWindow(aw, ah) {
					  if (window.screen) {
							window.focus();
							window.resizeTo(aw, ah);
							var xc = (screen.availWidth  - aw) / 2;
							var yc = (screen.availHeight - ah) / 2;
							window.moveTo(xc, yc);
					  }
					}
					
					function getElement(obj){
						if(typeof(obj) == "string"){
							objRetun = window.document.getElementById(obj);
							/* FELIX REFERENTE AO SITE NOVO 16/03/2010
							if(objRetun == null)
								objRetun = window.parent.document.getElementById(obj); 
							*/
						}
						if(objRetun == null){
								return false;
						}else
							return objRetun;
					}
					
					// Adiciona Eventos
					function addEvent(obj, evType, fn){
						if (obj.addEventListener)
							obj.addEventListener(evType, fn, true)
						if (obj.attachEvent)
							obj.attachEvent("on"+evType, fn)
					}
					
					function getForm(obj, vescape) {
						var getstr = "";

						for (i=0; i<obj.elements.length; i++) {
							var element = obj.elements[i];
							var tipo_element = element.type;
							var cont_index=0;
							name = value = null;
							
							switch (tipo_element){
								case "password":						
									var name = element.name;
									var value = element.value;
									break;
								case "text":						
									var name = element.name;
									var value = element.value;
									break;
								case "textarea":
									var name = element.name;
									var value = element.value;
									break;
								case "hidden":
									var name = element.name;
									var value = element.value;
									break;
								case "checkbox":
									if (element.checked){
										var name = element.name;
										var value = element.value;
									}
									break;
								case "radio":
									if (element.checked){
										var name = element.name;
										var value = element.value;
									}
									break;
								case "select-one":
									var sel = element;
									var name = element.name;
									var value = sel.options[sel.selectedIndex].value;
									break;
								case "select-multiple":
									var name = element.name;
									var value = new Array();
									for(sm=0; sm<element.length; sm++){
										if(element.options[sm].selected == true){
											value[cont_index] = element.options[sm].value;
											cont_index++;
										}
									}									
									break;
								case "file":
									var name = element.name;
									var value = element.value;
									break;
								case "button":
									var name = element.name;
									var value = element.value;
									break;
							}
							if(name != null){
								if(cont_index <= 0){
									value = vescape == true?escape(value):value;
									getstr += name + "=" + value + "&";
								}else{
									for(cont_i=0; cont_i<cont_index; cont_i++){
										nvalue = vescape == true?escape(value[cont_i]):value[cont_i];
										getstr += name + "[]=" + nvalue + "&";								
									}
								}
							}
						}
						getstr = getstr.substring(0, (getstr.length -1));
						return getstr;
					}
					
					function setScript(texto, obj){
						var ini, pos_src, fim, codigo;
						var objScript = null;
						ini = texto.indexOf("<script", 0)
						while (ini!=-1){
							var objScript = document.createElement("script");
							//Busca se tem algum src a partir do inicio do script
							pos_src = texto.indexOf(" src", ini)
							ini = texto.indexOf(">", ini) + 1;
					
							//Verifica se este e um bloco de script ou include para um arquivo de scripts
							if (pos_src < ini && pos_src >=0){//Se encontrou um "src" dentro da tag script, esta e um include de um arquivo script
								//Marca como sendo o inicio do nome do arquivo para depois do src
								ini = pos_src + 4;
								//Procura pelo ponto do nome da extencao do arquivo e marca para depois dele
								fim = texto.indexOf(".", ini)+4;
								//Pega o nome do arquivo
								codigo = texto.substring(ini,fim);
								//Elimina do nome do arquivo os caracteres que possam ter sido pegos por engano
								codigo = codigo.replace("=","").replace(" ","").replace("\"","").replace("\"","").replace("\"","").replace("\"","").replace(">","");
								// Adiciona o arquivo de script ao objeto que sera adicionado ao documento
								objScript.src = codigo;
							}else{//Se nao encontrou um "src" dentro da tag script, esta e um bloco de codigo script
								// Procura o final do script
								fim = texto.indexOf("</script>", ini);
								// Extrai apenas o script
								codigo = texto.substring(ini,fim);
								// Adiciona o bloco de script ao objeto que sera adicionado ao documento
								objScript.text = codigo;
							}
							//Adiciona o script ao documento
							obj.appendChild(objScript);
							// Procura a proxima tag de <script
							ini = texto.indexOf("<script", fim);
					
							//Limpa o objeto de script
							objScript = null;
						}
					}
					
					function setSizeIframe(){
						if(typeof(window.parent.document.getElementById("ifrLoad")) == "object"){
							iframe = window.parent.document.getElementById("ifrLoad");
							if(iframe != null){
								if(typeof(window.document.getElementById("tblLoad")) == "object"){
									tabela = window.document.getElementById("tblLoad");
									if(tabela != null){
										aux = iframe;
										while(aux.nodeName.toLowerCase() != "td"){
											if (navigator.appName == "Netscape")
												aux = aux.parentNode;
											else
												aux = aux.parentElement;
										}
										iframe.height = 0;
										iframe.height = tabela.offsetHeight;
										iframe.width = aux.offsetWidth;				
										tabela.width = aux.offsetWidth;
									}
								}
							}
						}
					}/* FELIX REFERENTE AO SITE NOVO 16/03/2010
						addEvent(window, "load", setSizeIframe);
						*/
					
					function validaCPF(cpf){
						var numeros, digitos, soma, i, resultado, digitos_iguais;
						digitos_iguais = 1;
						if (cpf.length < 11)
							return false;
						for (i = 0; i < cpf.length - 1; i++)
							if (cpf.charAt(i) != cpf.charAt(i + 1))
							{
								digitos_iguais = 0;
								break;
							}
						if (!digitos_iguais)
						{
							numeros = cpf.substring(0,9);
							digitos = cpf.substring(9);
							soma = 0;
							for (i = 10; i > 1; i--)
								soma += numeros.charAt(10 - i) * i;
							resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
							if (resultado != digitos.charAt(0))
								return false;
							numeros = cpf.substring(0,10);
							soma = 0;
							for (i = 11; i > 1; i--)
								soma += numeros.charAt(11 - i) * i;
							resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
							if (resultado != digitos.charAt(1))
								return false;
							return true;
						}else{
							return false;
						}
					}
					
					function MoveObj (e, sM)
					{
						bNS = document.getElementById&&!document.all;
				
						if(typeof(oB) != "object" && typeof(oM) != "object")
						{
							oM = window.document.getElementById(sM);
							oM.dragObj = true;
							
							oM.onmouseup = function () {
								oM.dragObj = false;
							}
							oM.onmouseout= function (e)
							{			
								oM.dragObj = false;
							}
						}else
							oM.dragObj = true;
						
						mouseY = bNS ? parseInt(e.clientY) : parseInt(event.clientY) ;
						dialogY = parseInt(oM.style.top);
						posY = mouseY - dialogY;
						
						mouseX = bNS ? parseInt(e.clientX) : parseInt(event.clientX) ;
						dialogX = parseInt(oM.style.left);	
						posX = mouseX - dialogX;
						
						oM.onmousemove = function (e)
						{			
							if(typeof(oM.dragObj) != "undefined")
								if(oM.dragObj == true)
								{
									oM.style.top = bNS ? parseInt(e.clientY - posY) + "px" : parseInt(event.clientY - posY) + "px";
									oM.style.left = bNS ? parseInt(e.clientX - posX) + "px" : parseInt(event.clientX - posX) + "px";
								}
						}
				}
				
				function getTotalCaracter(valor, tipo){
					var cont_valor = valor.length;
					
					var list_string = "ABCÇDEFGHIJKLMNOPQRSTUVWXYZ";
					var tot_string = 0;
					
					var list_number = "1234567890";
					var tot_number = 0;
			
					for(i=0; i < cont_valor; i++){
						var valchar = valor.charAt(i);
						if(list_string.indexOf(valchar.toUpperCase()) != -1){
							//alert(valor+","+valchar +","+tot_string);
							tot_string++;
						}else if(list_number.indexOf(valchar) != -1){				
							tot_number++;
						}
					}
					if(tipo == "string"){
						return(tot_string);
					}else if(tipo == "number"){
						return(tot_number);
					}
				}
					