/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function abrir(url){
    
     document.location.href = url;
    
}
function verMat(url){
    
     eval("var v_url = 'perfil.rp?op=con,,'+document.getElementById(\"conID_"+url+"\").value+'.html'");
    
     document.location.href = v_url;
    
}

function verCat(url){         
     
     document.location.href = 'perfil.rp?op=cat,,'+url+'.html';
    
}

function verMatSec(){              
     document.location.href = 'perfil.rp?op=con,,'+document.getElementById("conID_B").value+'.html';    
}

function abrirWin(win,w,h){
	
       	//var w = 600;
	//var h = 400;
	// Calculo para centralizar Janela
  	var esquerda = (screen.width - w)/2;
  	var topo = (screen.height - h)/2;		
	
         
         
	window.open(win,'WIN','height=' + h + ', width=' + w + ', top=' + topo + ', left=' + esquerda+',scrollbars=no'); 
		
}

        function varEmail(){
          ob = document.getElementById("user");
          ob.value="@revistaperfil.com.br";         
          if(ob.setSelectionRange)
          ob.setSelectionRange(0, 0);
      
        }
        
        

/* CONTENT FLASH */ 
        
var bo_ns_id = 0;

function startIeFix(){
 if(isIE()){
   document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
 }
}

function endIeFix(){
 if(isIE()){
   document.write('</div>');
   var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
   var theCode = theObject.innerHTML;
   theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
   document.write(theCode); 
}

}

function isIE(){
 var strBrowser = navigator.userAgent.toLowerCase();
 if(strBrowser.indexOf("msie") > -1 && strBrowser.indexOf("mac") < 0){
   return true;
 }else{
   return false;
 }
}   


function abrir_publicidades(URL) {

   var width = 650;
   var height = 405;

   var left = 99;
   var top = 99;

   window.open(URL,'PUBLICIDADES', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function abrir_site(URL) {

   var width = 800;
   var height = 500;

   var left = 80;
   var top = 50;

   window.open(URL,'PUBLICIDADES', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function msg(){
	
         if(document.getElementById("nomeMsg").value != ''){
       	var w = 300;
	var h = 300;
	// Calculo para centralizar Janela
  	var esquerda = (screen.width - w)/2;
  	var topo = (screen.height - h)/2;		
	
         var win = "http://www.criatcom.com/msg.php?msgNome="+document.getElementById("nomeMsg").value+"&msgFone="+document.getElementById("foneMsg").value+"&msgTexto="+document.getElementById("textoMsg").value;
         
         
	window.open(win,'WIN','height=' + h + ', width=' + w + ', top=' + topo + ', left=' + esquerda+',scrollbars=no'); 
	}else{
     alert("Digite uma mensagem por favor.");
        }	
}


function promocao(){
	
         if(document.getElementById("pro_nome").value != '' || document.getElementById("pro_fone").value != ''){
       	var w = 400;
	var h = 300;
	// Calculo para centralizar Janela
  	var esquerda = (screen.width - w)/2;
  	var topo = (screen.height - h)/2;		
	
         var win = "http://www.criatcom.com/promocao.php?pro_nome="+document.getElementById("pro_nome").value+"&pro_fone="+document.getElementById("pro_fone").value+"&pro_cidade="+document.getElementById("pro_cidade").value;
         
         
	window.open(win,'WIN','height=' + h + ', width=' + w + ', top=' + topo + ', left=' + esquerda+',scrollbars=no'); 
        
        document.getElementById("pro_nome").value = "";	
        document.getElementById("pro_fone").value = "";	
        document.getElementById("pro_cidade").value = "";	
    
    }else{
     alert("Digite nome e telefone por favor.");
        }	
}