function interna(arq){
document.getElementById("secao").value = arq;
document.getElementById("frmsecao").submit();
}

function fazBusca(){
if(document.getElementById("txt_busca").value == ""){
alert("Informe algum dado para efetuar a busca.");
}else{
document.getElementById("frmbusca").submit();
}
}

function envianews() {

if(document.getElementById("news_nome").value == "" || document.getElementById("news_mail").value == ""){

		alert("Preencha os campos Nome e E-mail para assinar a newsletter.");

}else{

	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById("news_mail").value)){
	
			if(document.getElementById("chk_sairnews").checked){
	
			ajax_get("http://www.omegatecnologia.com/envianews.php?assina=N&nome="+ escape(document.getElementById("news_nome").value) +"&email="+ document.getElementById("news_mail").value +"","divnews");
	
	
			}else{
	
   			ajax_get("http://www.omegatecnologia.com/envianews.php?assina=S&nome="+ escape(document.getElementById("news_nome").value) +"&email="+ document.getElementById("news_mail").value +"","divnews");
	
	
			}
	
	}else{
	alert("Endereço de e-mail inválido!");
	}

	
}
}

function verProdHome(object){
		
				var tblhome = document.getElementById("tblprodhome");
				var tdshome = tblhome.getElementsByTagName("tr");
				
				for (j=0; j < tdshome.length ; j++){
					if(object == j){
					document.getElementById("prodhome"+j).style.display = "";
					}else{
					document.getElementById("prodhome"+j).style.display = "none";
					}
	
				}	
}

function ligueme(){
		
		if(document.getElementById("nome").value == "" || document.getElementById("achamar").value == ""){
			alert("Por favor, preencha todos os campos antes de enviar sua requisição.");
		}else{
		var achamar = document.getElementById("achamar").value;
		achamar = achamar.replace("(","");
		achamar = achamar.replace(")","");
		achamar = achamar.replace(" ","");
		achamar = achamar.replace("-","");
		var prefixo = achamar.substr(2,4);
						
			if (prefixo >= 7000){
			
			alert("Este serviço não permite números de telefone celular.\nPor favor, informe outro telefone.");
			
			}else{
			
			ajax_get("http://www.omegatecnologia.com/clicktocall/chamada_novo.php?enviar=s&nome="+escape(document.getElementById("nome").value) +"&achamar=0"+ achamar +"&quando="+ document.getElementById("quando").value +"","divclicktocall");

			}
			
		}	
}		

		
	

url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend);


function parse_new (object) {
var shadowbox = document.getElementById(object);
var scripts = new Array();
scripts = shadowbox.getElementsByTagName("script");
if(scripts != null){
for(i=0; i < scripts.length; i++) {
if(scripts[i].getAttribute("type") == "text/javascript") {
eval(scripts[i].innerHTML);
}
}
}
}

function ajax_do (url) {
       
        if (url.substring(0, 4) != 'http') {
                url = base_url + url;
        }

        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;

        document.body.appendChild (jsel);
		
}

var i=0;

function ajax_get (url, el) {
		
		var obj = el;

		if (typeof(el) == 'string') {
                el = document.getElementById(el);
        }

    
        if (el == null) { return false; }

	

     
        if (url.substring(0, 4) != 'http') {
				url = "http://blog.omegatecnologia.com/"+ url;
				
        }
        
        getfile_url =  base_url + "getfile.php?url=" + escape(url) + "&el=" + escape(el.id);

        
       

	  ajax_do (getfile_url);
	  
	  setTimeout("parse_new('"+obj+"');",1500);
	   
          return true;
}

function mostraCidade(object){

	ajax_get("cidades_detalhes.php?codcid="+object+"","tdcidades");

}

function showContent(object){

for (j=1; j < maxitems+1; j++){


	if (object == j){
	
	document.getElementById("img"+object+"").style["border"] = "1px Solid #CECECE";
	document.getElementById("img"+object+"").style["borderRight"] = "1px Solid white";
	document.getElementById("img"+object+"").style["backgroundColor"] = "White";
	}else{
	document.getElementById("img"+j+"").style["border"] = "none";
	document.getElementById("img"+j+"").style["borderRight"] = "none";
	document.getElementById("img"+j+"").style["backgroundColor"] = "";
	
	}





}

document.getElementById("prodcontent").innerHTML = document.getElementById("divprod"+object+"").innerHTML;

}


function showContentClientes(host,object){

for (j=1; j < maxitems+1; j++){


	if (object == j){
	//tdhost$host_1
	document.getElementById("tdhost"+host+"_"+j+"").style["border"] = "1px Solid #CECECE";
	document.getElementById("tdhost"+host+"_"+j+"").style.border = "1px Solid #CECECE";
	document.getElementById("tdhost"+host+"_"+j+"").style["borderRight"] = "1px Solid white";
	document.getElementById("tdhost"+host+"_"+j+"").style["backgroundColor"] = "#f2f2f2";
	document.getElementById("grafico_host"+host+"_"+j+"").style.display="";
	}else{
	document.getElementById("tdhost"+host+"_"+j+"").style["border"] = "none";
	document.getElementById("tdhost"+host+"_"+j+"").style["borderRight"] = "none";
	document.getElementById("tdhost"+host+"_"+j+"").style["backgroundColor"] = "";
	document.getElementById("grafico_host"+host+"_"+j+"").style.display="none";
	}

}

}


