// JavaScript Document

// POPUP
function pedido(){
	window.open("pedido.php","POPUP","toolbar=0,location=0,directories=0,scrollbars=0,width=223,height=300,left=10,top=5");
}
function popUp(PG,W,H){
	window.open(PG,"POPUP","toolbar=0,location=0,directories=0,scrollbars=0,width="+W+",height="+H+",left=10,top=5");
}
function copa(W,H){
	window.open('tabela_atualizada_da_copa_2010.html',"POPUP","toolbar=0,location=0,directories=0,scrollbars=1,width="+W+",height="+H+",left=10,top=5");
}
function aovivo(){
	window.open("player.php","POPUP","toolbar=0,location=0,directories=0,scrollbars=0,width=318,height=148,left=10,top=5");
}
function viewFoto(F,W,H){
	window.open("fotoview.php?id="+F,"POPUP","toolbar=0,location=0,directories=0,scrollbars=0,width="+W+",height="+H+",left=60,top=10");
}


//	RADIO
<!--
function RegisterEventObservers(){ 
    var plugin = document.WMPlay;
    document.appObs.setByProxyDSNewStreamObserver(plugin, true); 
    troca();
    numero = numero - 1;
}

function OnDSNewStreamEvt(oldstate, newstate){
    setTimeout('troca();',1000);
}
         
function PlayClick(){
    document.WMPlay.Play();
}

function StopClick(){
    numero = 1;
    document.WMPlay.Stop();
    if (navigator.appName.indexOf('Netscape') != -1) {
        document.WMPlay.SetCurrentPosition(0);
    } else {
        document.WMPlay.CurrentPosition = 0;
    }
}

function PauseClick(){
    if (navigator.appName.indexOf('Netscape') != -1) {
        estado=document.WMPlay.GetPlayState();
    } else {
        estado=document.WMPlay.PlayState;
    }

    if (estado==1) {
        document.WMPlay.Play();
    } else if (estado==2) {
        document.WMPlay.Pause();
    }
}

function FowardClick(){
    document.WMPlay.Next();
}

function BackClick(){
    numero = numero - 2;
    document.WMPlay.Previous();
}

function UpVolumeClick(){
    if (document.WMPlay.Volume <= -300) {
        document.WMPlay.Volume = document.WMPlay.Volume + 300;
    }
}

function DownVolumeClick(){
    if (document.WMPlay.Volume >= -8000) {
        document.WMPlay.Volume = document.WMPlay.Volume - 300;
    }
}
//-->

//	STATUS PROGRAMAÇÃO
var progNow;
function ajaxProgNow(){
progNow = null;
	if(window.XMLHttpRequest){
		progNow = new XMLHttpRequest();
		progNow.onreadystatechange = progressoProgNow; 
        progNow.open("GET","prognow.php"); 
        progNow.send(null);
	} else if(window.ActiveXObject){
		progNow = new ActiveXObject("Microsoft.XMLHTTP"); 
		progNow.onreadystatechange = progressoProgNow; 
        progNow.open("GET","prognow.php"); 
        progNow.send(null);
	} else {
		alert('Seu navegado está desatualizado!');
	}
}

function progressoProgNow(){
	if(progNow.readyState == 4){
		if(progNow.status == 200){
			document.getElementById('marqueeProgNow').innerHTML = progNow.responseText;
		} else {
			alert ("Falha\n" + progNow.statusText);
		}
	}
}
//	status programação