		function echeck(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("Email inválido !");
			   return false;
			}
	
			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   alert("Email inválido !");
			   return false;
			}
	
			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			    alert("Email inválido !");
			    return false;
			}
	
			 if (str.indexOf(at,(lat+1))!=-1){
			    alert("Email inválido !");
			    return false;
			 }
	
			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			    alert("Email inválido !");
			    return false;
			 }
	
			 if (str.indexOf(dot,(lat+2))==-1){
			    alert("Email inválido !");
			    return false;
			 }
			
			 if (str.indexOf(" ")!=-1){
			    alert("Email inválido !");
			    return false;
			 }
			 
	 		 return true;
		}
		
		function checa_formulario(){

			if (document.formcontato.nome.value == ""){
				alert("Por Favor não deixe o nome em branco !");
				document.formcontato.nome.focus();
				return (false);
			}
			
			if (document.formcontato.email.value == ""){
				alert("Por Favor não deixe o email em branco !");
				document.formcontato.email.focus();
				return (false);
			}
			
			if ( echeck(document.formcontato.email.value) == false ){
				document.formcontato.email.focus();
				return (false);
			}
			
/*			
			if (document.formcontato.telefone.value == ""){
				alert("Por Favor não deixe o telefone em branco !");
				document.formcontato.telefone.focus();
				return (false);
			}*/
				
/*			if ( !verifyCheckboxes("sigilo",1)){
				alert("Por Favor não deixe de informar se deseja que seus dados pessoais sejam armazenados ou não!");
				return (false);			
			}	*/
		
			return true;
		
		}	
	
	    function verifyCheckboxes(id, min) {  
		 
	       var count = 0;  
      
	       for (element in document.getElementById(id))  
	         {  
	          if (document.getElementById(id)[element].checked)  
	            {  
	             if (++count == min)  
	              { return true; }  
	           }  
	        }    
	      return false;  
   	  }  
	
	
	
function popup() {

	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  winH = document.body.clientHeight;
	 }
	}
	el = document.getElementById("popup");
/*	el.style.left = ((winW-187)/2) + 'px';*/
/*	el.style.top = ((winH-200)/2) + 'px';*/
	el.style.left = "400px";
	el.style.top = "150px";	
	el.style.width = "187px";
	el.style.height = "55px";	
	el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
}		

function cancelaform(){
	el = document.getElementById("popup");
	el.style.visibility = "hidden";	
}	
	
function submitform()
{
  document.formcontato.submit();
}

function resetform()
{
  document.formcontato.reset();
}


function retornaAtributoClasseBrowser(){

	var str = navigator.appName;

	var atributo = "class";

	if (window.navigator.appName == "Microsoft Internet Explorer")
	{
	   // Este navegador é IE, mas qual???
	   if (document.documentMode) // IE8 pois o objeto document tem a propriedade documentMode
	      atributo = "class";
	   else // Entre IE5 e IE7
	   {
	      atributo = "className";// Assumindo o IE5 até que alguém prove o contrário. IE5 e IE6 são muito parecidos então pode assumir o 5
	      if (document.compatMode)
	      {
	         if (document.compatMode == "CSS1Compat")
	            atributo = "className";
	      }
	   }
	}

	return atributo;

}

function ativarlink(id){

	
	var classeativo = "ativo";
	
	var atributo = "";
	atributo = retornaAtributoClasseBrowser();
	
	var obj = document.getElementsByName("album");

	for( var x = 0;  x < obj.length ; x++ ){
		obj.item(x).setAttribute(atributo,"");		
	}
	
	
/*	alert(id.parentNode.getAttribute(atributo));*/
	id.setAttribute(atributo,classeativo);
	/*if (id.parentNode.getAttribute(atributo) =="video"){		
		id.parentNode.setAttribute(atributo,"videoativo");		
	}else{
	if (id.parentNode.getAttribute(atributo) =="videoativo"){		
		id.parentNode.setAttribute(atributo,"video");		
	}
	}
	alert(id.parentNode.getAttribute(atributo));*/
}


function detect(){
	if(screen.width<1024||screen.height<768){
		alert("Este site é melhor visualizado em uma resolução de monitor de 1024x768 ou maior. Sua definição atual é de "+screen.width+"x"+screen.height+". Se possível, altere a definição de seu monitor.")
	}
}


function getURLParam(strParamName){

  strParamName=strParamName.toLowerCase(); 
  var strReturn = "";
  var strHref = window.location.href;

  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }

  return strReturn;
}

function geraPlayer(strVideo,strPreview,intDuracao){

	document.write("<object id='player' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' name='player' width='640' height='390' >");  
	document.write("<param name='movie' value='player.swf' /> "); 
	document.write("<param name='allowfullscreen' value='true' /> "); 
/*	document.write("<param name='allowscriptaccess' value='always' /> "); */
	if (intDuracao > 0){
	document.write("<param name='flashvars' value='duration=25&file=videos/"+strVideo+"&image=videos/"+strPreview+"&skin=modieus.swf' /> "); 
	}
	else
	{
	document.write("<param name='flashvars' value='file=videos/"+strVideo+"&image=videos/"+strPreview+"&skin=modieus.swf' /> "); 

	}
/*	document.write("<param name='flashvars' value='duration=25&file=videos/"+strVideo+"&image=videos/"+strPreview+"&skin=modieus.swf' /> "); */
	document.write("<object type='application/x-shockwave-flash' data='player.swf' width='640' height='390'> "); 
	document.write("<param name='movie' value='player.swf' /> "); 
	document.write("<param name='allowfullscreen' value='true' /> "); 
/*	document.write("<param name='allowscriptaccess' value='always' /> "); */
	if (intDuracao > 0){
	document.write("<param name='flashvars' value='duration=25&file=videos/"+strVideo+"&image=videos/"+strPreview+"&skin=modieus.swf' /> "); 	}
	else
	{
	document.write("<param name='flashvars' value='file=videos/"+strVideo+"&image=videos/"+strPreview+"&skin=modieus.swf' /> "); 
	}
/*	document.write("<param name='flashvars' value='duration=25&file=videos/"+strVideo+"&image=videos/"+strPreview+"&skin=modieus.swf' /> "); */
	document.write("<p><a href='http://get.adobe.com/flashplayer'>Get Flash</a> to see this player.</p> "); 
	document.write("</object> "); 
	document.write("</object> "); 
		
}


function initMenu(){

  var menus, menu, menupronto,divscroll ,text, a, i , j;
  var atributo = "";
  
  atributo = retornaAtributoClasseBrowser();
  
    menupronto =   document.getElementById("lyr1");

  if (menupronto.clientHeight < 400){
  
  		divscroll = 	document.getElementById("scrollLinks");
  		divscroll.setAttribute(atributo,"scrollinativo");
  }
  
  menus = document.getElementsByTagName("ul");

  for(i = 0; i < menus.length; i++){
    menu = menus[i];;
	 if (menu.getAttribute("name") =="submenu"){
		menu.setAttribute(atributo,"texthidden");
		menu.className="texthidden";
	 }
  }
  
/*  menus = document.getElementsByName("itemmenu");*/
  menus = document.getElementsByTagName("a");

  for(i = 0; i < menus.length; i++){
    menu = menus[i];
	 if (menu.getAttribute("name")=="itemmenu"){
		menu.setAttribute(atributo,"menuinativo");
		menu.className="menuinativo";
	 }	 	 
  }
  


	
  
  
}  

function finishMenu(){
var submenus, submenu, j;

  var submenus=document.getElementsByTagName("ol");
  for ( j= 0 ; j < submenus.length ; j++){
  		submenu = submenus[j];
/*		alert( submenu.style.display);*/
		submenu.style.display = 'none'; 
		
/*		alert( submenu.style.display);*/

  }
  
  
}


function expandcollapse (postid,parent) {
   			
	whichpost = document.getElementById(postid);
	
	if (whichpost.className=="shown")
		{whichpost.className="texthidden";
		}
	else 
		{whichpost.className="shown";
		}
		
	if (parent.className=="menuativo"){
		parent.className="menuinativo";
	}
	else{
		parent.className="menuativo";
	}
	
		
}