
var elemento=null;

function init(number){

	var rel=document.getElementById('release_'+number);
	if (rel!=null){
	Effect.Grow(rel);
	elemento=rel;
	}
	
	}
function release_swap(release){
	
	var res=document.getElementById(release);
	if (elemento==null){
	
	elemento=res;
	return 0;
	
	}else{
		
		if (elemento!=res)
		{
			new Effect.SwitchOff(elemento); 
			elemento=res;
		}
		
		return 0;
		}
	
	
	}
	
	function setBack_link(elem,value){
		
		var res=document.getElementById(elem);
		if (value ==1){
		
		res.style.backgroundColor="black";
		res.style.color="white";
		
		}else {
			res.style.backgroundColor="white";
			res.style.color="black";
	
			
			}
		
		return 0;
		
		
		}
	
	
	function open_news(elem,type){
		
		
		var me=document.getElementById(elem);
		
		
		
		
			
				me.style.display="table";
			
		
			
				
			
			
		}
			
	function close_news(elem){
		
		var me=document.getElementById(elem);
		
		
		if(me.style.display=="none") {
			
			
			}else{
		
		Effect.SwitchOff(me); 
		me.style.display="none";
			}
		
		}
		
		
		
		function setimage_open1(elem){
			
			var me=document.getElementById(elem);
			
			 
    me.setAttribute("src", "./imagens/open.gif");

			}
			
			function setimage_open2(elem){
			
			var me=document.getElementById(elem);
			
			me.setAttribute("src", "./imagens/open2.gif");
			
			}
			
			
				
		function setimage_close1(elem){
			
			var me=document.getElementById(elem);
			
			 
    me.setAttribute("src", "./imagens/close.gif");

			}
			
			function setimage_close2(elem){
			
			var me=document.getElementById(elem);
			
			me.setAttribute("src", "./imagens/close2.gif");
			
			}




function ValidateMailAdress(str){


	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID @ not founded")
		   return false
		}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID @ in the beg ")
		   return false
		}
		
	if (lat>ldot){
		 alert("Invalid E-mail ID lat>ldot")
		 return false

	} 

	if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID Remove Spaces")
		    return false
	}
	
	if (str.match(/<.*/)!=null){
		    alert("Invalid Email ID ")
	
		    return false
	}
	
	if (str.match(/.*>/)!=null){
		    alert("Invalid Email ID ")
	
		    return false
	}
	
	
	
	return  true;
	
}

function ValidateMail(str){

	
	if (str.match(/<.*/)!=null){
		    alert("Invalid USer ID ")
	
		    return false
	}
	
	if (str.match(/.*>/)!=null){
		    alert("Invalid USer ID ")
	
		    return false
	}

	return  true;



}


function ValidateUser(str){

	if (str.match(/<.*/)!=null){
		    alert("Invalid USer ID ")
	
		    return false
	}
	
	if (str.match(/.*>/)!=null){
		    alert("Invalid USer ID ")
	
		    return false
	}


}


function ValidateInfoForm(form){

	var mail=form.email.value;
	var nome=form.nome.value;

	if(form.email.value==""|| form.email.value==null||form.nome.value==""||form.nome.value==null)
	{
	
	 	 alert("Invalid mail or Name ");
		    return false;

	}

	if (ValidateMailAdress(mail)==false)
	{

		return false;
	}

	if (ValidateUser(nome)==false)
	{

		return false
	}

	return true;
}


function ValidateMailForm(form){

	var subject=form.subject.value;
	var message=form.message.value;
	

	
	if(subject==""|| subject==null||message.value==""||message==null)
	{
	
	 	 alert("Invalid mail or Subject ");
		 return false;

	}
	
	if (subject.match(/<.*/)!=null){
		    alert("Invalid Subject ")
	
		    return false
	}
	
	if (subject.match(/.*>/)!=null){
		    alert("Invalid Subject  ")
	
		    return false
	}

	if (message.match(/<.*/)!=null){
		    alert("Invalid Mail Text , HTML not allowed ")
	
		    return false
	}
	
	if (message.match(/.*>/)!=null){
		    alert("Invalid Mail Text ,USer ID HTML not allowed")
	
		    return false
	}

	return true;



}
