// JavaScript Document:::Tecnologia CliqNet:::Por:Alexandre Costa
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;

function validaForm(){
	var formulario = document.getElementById('actionForm');
	formulario.onsubmit = function(){
		var status = 'ok';
		if(document.getElementById('nome').value==''){
			alert('campo nome nao foi digitado');
			status = 'ruim';
			document.getElementById('nome').focus();
			return false;
		}
		if(document.getElementById('email').value=='' && status=='ok'){
			alert('campo email nao foi digitado');
			status = 'ruim';
			document.getElementById('email').focus();
			return false;
		}
        if(document.getElementById('mensagem').value=='' && status=='ok'){
			alert('campo mensagem nao foi digitado');
			status = 'ruim';
			document.getElementById('mensagem').focus();
			return false;
		}
	}

}

function mensagem (obj){
	alert(obj);
}

function mostrar_div(obj){
	var div = document.getElementById(obj);
	div.className = 'mostrar';
}

function abrir_popup(){
	pUrl = '../enquete/resultados.php';
	pWidth = '400px';
	pHeight = '260px';

	if (window.showModalDialog) {
		return window.showModalDialog(pUrl, window,
		  "dialogWidth:" + pWidth + "px;dialogHeight:" + pHeight + "px");
	} else {
		try {
			netscape.security.PrivilegeManager.enablePrivilege(
			  "UniversalBrowserWrite");
			window.open(pUrl, "wndModal", "width=" + pWidth
			  + ",height=" + pHeight + ",resizable=no,modal=yes, scrollbars=no, status=no");
			return true;
		}
		catch (e) {
			pHeight = '220px';
			window.open(pUrl, "wndModal", "width=" + pWidth
			  + ",height=" + pHeight + ",resizable=no, scrollbars=no left=300, screenX=300, top=300, screenY=300");
			return true;
		}
	}

}

	c=0
		du="";
		n_divs='21';
	function escondediv(dv,n){

		   for(i=1;i<=n;i++){
			   if(i==dv ){
				   if(du!=dv){
					   if(!(document.getElementById('mdiv'+i).style.display=="block")){
				      document.getElementById('mdiv'+i).style.display="block";
					   du=dv;
					   }else{
					   	document.getElementById('mdiv'+i).style.display="none";
						du=dv;
					   }
					}else{
					   du=""
					   document.getElementById('mdiv'+i).style.display="none"
					}
			   }else{
				     document.getElementById('mdiv'+i).style.display="none"
			   }

			}
		}


		function showdiv(obj){
			var div = document.getElementById(obj);
			div.style.display = 'block';
		}


	function confirmDelete(delUrl) {
	  if (confirm("Deseja Deletar o item?")) {
	    document.location = delUrl;
	  }
	}
