/*
RIPPERS WILL SUFFER
*/


function nospam(user, domain, suffix){
		document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + user + '@' + domain + '.' + suffix + '</a>');
}	


function varr() {
	document.writeln('<input type=hidden name="varr[]" value="'+navigator.appName+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+navigator.appVersion+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+navigator.platform+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+screen.width+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+screen.height+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+screen.colorDepth+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+screen.pixelDepth+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+navigator.javaEnabled()+'">');
	//document.writeln('<input type=hidden name="plataforma" value="'+navigator.platform+'">');
	//document.writeln('<input type=hidden name="appname" value="'+navigator.appName+'">');
}

function pop(endereco, X, Y, rolagem) {
	var windowX = Math.ceil((window.screen.width  - X) / 2);
	var windowY = Math.ceil((window.screen.height - Y) / 2);
	parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars='+rolagem+',status=1,toolbar=0,resizable=0,width=' + X.toString()+ ',height=' +Y.toString()
	+ ',left=' + Math.ceil(windowX).toString() + ',top=' + Math.ceil(windowY).toString()
	nova = window.open (endereco, '', parametros)
	if (navigator.platform == 'MacPPC') nova.resizeTo (X, Y);
}


function display(id, on_off) { 
	var el = document.all ? document.all[id] : document.getElementById(id);  if(el) el.style.display = on_off ? '' : 'none'; 
}

function foto(endereco) {
	sobraX = 12;
	sobraY = (screen.height - screen.availHeight);
	if (navigator.appName != "Microsoft Internet Explorer" || (navigator.platform == 'MacPPC' && navigator.appName != "Netscape"))
	{sobraX = 0;	sobraY = 0;	}
	nova = window.open('', 'foto', 'fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,status=0,resizable=1,scrollbars=0, width=100, height=50, top=50, left=100')
	//nova.document.open("text/html", "replace");
	nova.document.write('<HTML><HEAD><TITLE>'+endereco+'</TITLE></HEAD>');
	nova.document.write('<BODY bgcolor=black background=f6.jpg leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="margin:0;overflow:hidden" onload="self.resizeTo(document.pic.width + ' + sobraX.toString() + ', document.pic.height + ' + sobraY.toString() + ');">\r\n');
	nova.document.write('<a href="#"><IMG SRC="' + endereco + '" BORDER=0 name="pic" alt="clique para fechar" onclick="parent.self.close();"></a></BODY></HTML>');
	nova.document.close();
	nova.focus();
}




	function get0(id) {
		if(document.getElementById(id).value)
		location.href = "index.php?id="+document.getElementById(id).value
		//proj = document.getElementById(id).value;
		//if (proj) {
			location.href = "index.php?id="+proj;
		//}
	}


	// REVISADO - INDIO USA
	function get(id) {
		if(document.getElementById(id).value)
		location.href = "?id="+document.getElementById(id).value;
	}

	// revisao pro htaccess
	function get_url(id) {
		if(document.getElementById(id).value != '')
		location.href = document.getElementById(id).value;
	}

	function editar (n) {
		//if (confirm('erase?'))
		location.href='editar.php?id='+n
	}
	
	function mudapagina(n) {
		document.pagina.pagina.value = n;
		document.pagina.submit();
	}
	

	var ycsdone;
	function visita(acao) {
		var z;
		if (ycsdone)
		return;
		z="&r="+escape(document.referrer);
		z=z+"&b="+escape(navigator.appName+" "+navigator.appVersion);
		var w=parseFloat(navigator.appVersion);
		if (w > 2.0) {
			z=z+"&s="+screen.width+"x"+screen.height;
			z=z+"&o="+navigator.platform;
			var v="1.2";
		if (navigator.appName != "Netscape") {
			z=z+"&c="+screen.colorDepth;
		} else {
			z=z+"&c="+screen.pixelDepth
		}
		z=z+"&j="+navigator.javaEnabled();
	} else {
		v=1.0;
	}
	z=z+"&v="+v;
	
	if (acao!=undefined) {
		z=z+"&acao="+acao;
		//document.writeln("<img src=\"visita.php?"+z+"\" width=0 height=0>");
		document.writeln("<img src=\"http://dromma.org/visita.php?"+z+"\" width=0 height=0>");
		ycsdone=1;
		}
	}
	

function ValidateForm(emailID, msg){
	//var emailID=document.mailing.email;
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value, msg)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	else
	return true
	//posta.submit()
	//document.forms['posta'].submit()
 }

function echeck(str,msg) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert(msg)
	   return false
	}
	
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert(msg)
	   return false
	}
	
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert(msg)
		return false
	}
	
	 if (str.indexOf(at,(lat+1))!=-1){
		alert(msg)
		return false
	 }
	
	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert(msg)
		return false
	 }
	
	 if (str.indexOf(dot,(lat+2))==-1){
		alert(msg)
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		alert(msg)
		return false
	 }

	 return true					
}