//------------------------------------------------------------------------------------------
// Javascript Methods
// Created on 01 de Setembro de 2006, 17:28
// By: DataView Tecnology Solutions
// Contatct: suporte@dataview.com.br
flag = 0;

try {
 this.xmlRequest = new XMLHttpRequest();
 } 
 
 //cria o objeto XMLHttpRequest pra IE 6.0 e posteriormente para IE7+
 catch (e) {
 try {
 this.xmlRequest = new ActiveXObject("Msxml2.XMLHTTP");
 } 
 
 catch (e) {
 this.xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
 }
 }


div_base = "";

function abre(arquivo,metodo,div){
div_base = div;
xmlRequest.open(metodo,arquivo);
xmlRequest.onreadystatechange=conteudo
xmlRequest.send(null)
}

function conteudo() {
nova_div = div_base;
document.getElementById(nova_div).innerHTML="<div style='text-align:center;'><img src=\"../imagens/carregando.gif\" /><br /><br /><br /><br /><br />&nbsp;</div>"
if (xmlRequest.readyState==4){
	document.getElementById(div_base).innerHTML=xmlRequest.responseText;
}
}

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 = "#f9f9f9";}
            navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";this.style.backgroundColor = "#f9f9f9";}
         }
      }
   }
 
}

function abriCalendario(){
		$('#data_6').calendario({ 
			target :'#data_6',
			dateDefault:$('#data_6').val(),
			minDate:'01/01/2010',
			maxDate:'31/01/2010'
		});
}

function abriCalendario2(){
		$('#clickcalendario').calendario({ 
			target :'#data_6',
			dateDefault:$('#data_6').val(),
			minDate:'01/01/2010',
			maxDate:'31/01/2010'
		});
}

var RBOPlayer='<OBJECT ID="RBOPlayer" width=1 height=1 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"   CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..."         type="application/x-oleobject">  <PARAM NAME="AutoStart" VALUE="True">  <PARAM NAME="FileName" VALUE="radiofm.asx">  <PARAM NAME="ShowControls" VALUE="True">  <PARAM NAME="ShowStatusBar" VALUE="False">  <EMBED type="application/x-mplayer2"    pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"   SRC="radiofm.asx"   name="RBOPlayer"   width=1   height=1   autostart=1   showcontrols=0>  </EMBED></OBJECT>';
var ledRadioStop = '<img src="imagens/led.png" alt="led" />';
var ledRadioPlay = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="75" height="42" title="led">				<param name="movie" value="led.swf" /> <param name="quality" value="high" /> <embed src="led.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="75" height="42"></embed> </object>';

function iniciaraudio(){
	document.getElementById('media').innerHTML=RBOPlayer;
	document.getElementById('led_radio').innerHTML=ledRadioPlay;
}
function pararaudio(){
	document.getElementById('media').innerHTML="";
	document.getElementById('led_radio').innerHTML=ledRadioStop;
}

