function horizontal() {
 
   var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li");
    
   for (var i=0; i< navItems.length; i++) {
      if(navItems[i].className == "submenu")
      {
         if(navItems[i].getElementsByTagName('ul')[0] != null)
         {
            navItems[i].onmouseover=function() {this.getElementsByTagName('ul')[0].style.display="block";this.style.backgroundColor = "#ECDADA";} /*Enquanto o menu é escolhido*/

           navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";this.style.backgroundColor = "#FFFFFF";} /*Sair do Menu*/
           /*navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";this.style.background-image = url('imagens/menu002.png');}*/

         }
      }
   }
 
}

function ChangeMyItem(select) {
	/*if(select.selectedIndex == select.options.length - 1) {
	select.style.display = 'none';
	var edit = document.getElementById(select.id + '_text');
	edit.style.display = '';
	edit.focus();
	*/

		if(select.selectedIndex != 0) {
			 document.getElementById("ElementosLivro").style.visibility="hidden";
			 document.getElementById("CampoLivro").style.visibility="hidden";
 		}
		else {
			document.getElementById("ElementosLivro").style.visibility="visible";
			document.getElementById("CampoLivro").style.visibility="visible";   
		}
	
	/*}*/
}

function open_new_window(url)
{ 
//var new_window = window.open(url,'window_name','toolbar=0,menubar=0,scrollbars=0,resizable=0,dependent=0,status=0,width=190,height=380,top left')
var popup = window.open(url,'window_name','toolbar=0,menubar=0,scrollbars=0,resizable=0,dependent=0,status=0,width=190,height=380,top left')
  if (popup) popup.focus();
}

function clock()
	{
	   var today = new Date();
	   var hours = today.getHours();
	   var minutes = today.getMinutes();
	   var seconds = today.getSeconds();
	   var time_holder; // holds the time
	   var flag24h = 0;//0==>24 horas;1==>12h/AM/PM)
 		
	     if(flag24h > 0)
             {
                // add "AM" or "PM" if the 12-hours format is chosen
                var ampm = ((hours >= 12) ? " PM" : " AM");    
 
                // convert the hour to 12-hours format
                // javascript returns midnight as 0, but since the time is in the 12-hours format
                // force javascript to return 12
                hours = ((hours == 0) ? "12" : (hours > 12) ? hours - 12 : hours); 
 
                // add a leading zero if less than 10
                minutes = ((minutes < 10) ? "0" + minutes : minutes); 
                seconds = ((seconds < 10) ? "0" + seconds : seconds);
 
                time_holder = hours + ":" + minutes + ":" + seconds + ampm;
 
                 document.getElementById('jsClock').innerHTML =  time_holder;
	     }
	     else
	     {
               // add a leading zero if less than 10
	       hours = ((hours < 10) ? "0" + hours : hours);
               minutes = ((minutes < 10) ? "0" + minutes : minutes); 
               seconds = ((seconds < 10) ? "0" + seconds : seconds);
 
               time_holder = hours + ":" + minutes + ":" + seconds;
 
               document.getElementById('jsClock').innerHTML = time_holder;
	     } 
 
 
           // keep the clock ticking
	   setTimeout("clock()", 1000);
}

function GetData()
{
	var d=new Date();var weekday=new Array(7);
	weekday[0]="Domingo";
	weekday[1]="Segunda-feira";
	weekday[2]="Terça-feira";
	weekday[3]="Quarta-feira";
	weekday[4]="Quinta-feira";
	weekday[5]="Sexta-feira";
	weekday[6]="Sábado";
	return weekday[d.getDay()];
}

function clock_date()
	{
	   var today = new Date();
	   var hours = today.getHours();
	   var minutes = today.getMinutes();
	   var seconds = today.getSeconds();
	   var time_holder; // holds the time
	   var flag24h = 0;//0==>24 horas;1==>12h/AM/PM)
 		var myDay = today.getDate();
 		var myMonth = today.getMonth()+1;
 		var myYear = today.getFullYear();
 		var date_holder; // holds the date
	

	     if(flag24h > 0)
             {
                // add "AM" or "PM" if the 12-hours format is chosen
                var ampm = ((hours >= 12) ? " PM" : " AM");    
 
                // convert the hour to 12-hours format
                // javascript returns midnight as 0, but since the time is in the 12-hours format
                // force javascript to return 12
                hours = ((hours == 0) ? "12" : (hours > 12) ? hours - 12 : hours); 
 
                // add a leading zero if less than 10
                minutes = ((minutes < 10) ? "0" + minutes : minutes); 
                seconds = ((seconds < 10) ? "0" + seconds : seconds);
 
                time_holder = hours + ":" + minutes + ":" + seconds + ampm;
 
                 document.getElementById('jsClock').innerHTML =  time_holder;
	     }
	     else
	     {
               // add a leading zero if less than 10
	       hours = ((hours < 10) ? "0" + hours : hours);
               minutes = ((minutes < 10) ? "0" + minutes : minutes); 
               seconds = ((seconds < 10) ? "0" + seconds : seconds);
 
               time_holder = hours + ":" + minutes + ":" + seconds;
 
 			   date_holder = myDay + "/" + myMonth + "/" + myYear;

               document.getElementById('jsClock').innerHTML = GetData()+ ", " + date_holder + "<BR>" + time_holder;
	     } 
 
 
           // keep the clock ticking
	   setTimeout("clock_date()", 1000);
}


function mainADAJio()
{
	horizontal();
	clock_date();

}
