function popup(page,width,heigth){
		window.open(page,"quiz0",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+', height='+heigth);
	}
function opensb1(page,width,heigth){
window.open(page,'quiz','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+', height='+heigth);
	}
function janela(page,width,heigth){
window.open(page,'quiz1','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+', height='+heigth);
	}
function janela2(page,width,heigth){
window.open(page,'quiz1','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+width+', height='+heigth);
	}	

function Radinho()

{
opensb1('estudio.php',280,170)
}
function lara()

{
popup('laranjinha/laranjinha.htm',688,420)
}
function herme()

{
popup('../herme/herme.htm',688,420)
}
function roberto()

{
janela('roberto/index.htm',700,450)
} 
 
//Contents for menu 1
var menu1=new Array()
menu1[0]='<img src="images/dot.gif" width="1" height="10"/><br><a href="javascript:Radinho();">Ouça ao Vivo</a><br> '
//menu1[1]='<a href="/programas/index.htm">Programas</a><br>'
menu1[1]='<a href="locutores/index.htm" target="buraco">Locutores</a><br>'
//menu1[4]='<a href="locutores/index.htm">Equipe</a><br>'
menu1[2]='<a href="ajuda.html"  target="buraco">Ajuda</a><br>'
 

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<img src="images/dot.gif" width="1" height="10"/><br><a href="javascript:lara();">Freqüencia Máxima</a><br>'
menu2[1]='<a href="javascript:herme();">Eu Di Ká Vc Di Lá</a><br>'
menu2[2]='<a href="javascript:roberto();">Roberto Carlos</a><br>'
menu2[3]='<a href="#">Penetras</a><br>'
//menu2[5]='<a href="/promocoes/regulamento.htm">Regulamentos</a><br>'
	
//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<img src="images/dot.gif" width="1" height="10"/><br><a href="letras/letras/index.html"  target="buraco">Letras</a><br>'	
//menu3[1]='<a href="/lancamentos/index.htm">Lançamentos</a><br>'
menu3[1]='<a href="letras/10mais/index.htm"  target="buraco">As 10 Mais</a><br>'	
menu3[2]='<a href="cds/dicas.htm"  target="buraco">Dicas de CD</a><br>'

//Contents for menu 4, and so on
var menu4=new Array()	
menu4[0]='<img src="images/dot.gif" width="1" height="10"/><br><a href="destaque/index.htm"  target="buraco">Ouvinte do Mês</a><br>'
menu4[1]='<a href="promo/promo1.htm"  target="buraco">Promoções</a><br>'
//menu4[2]='<a href="/videos/index.htm">Vídeos</a><br>'
//menu4[3]='<a href="/destaque/index.htm">Destaque do Mês</a><br>'
//menu4[4]='<a href="/paredao/index.htm">Paredão</a><br>'

	

var menuwidth='265px' //default menu width
var disappeardelay=150  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth, menuheight){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu




//---------------------------------------------  randomize blocks

function randomizeContent(classname){
var contents=randomizeContent.collectElementbyClass(classname)
contents.text.sort(function() {return 0.5 - Math.random();})
var tbodyref=contents.ref[0].tagName=="TR"? contents.ref[0].parentNode : new Object()
for (var i=0; i<contents.ref.length; i++){
if (tbodyref.moveRow) //if IE
tbodyref.moveRow(0, Math.round(Math.random()*(tbodyref.rows.length-1)))
else
contents.ref[i].innerHTML=contents.text[i]
contents.ref[i].style.visibility="visible"
}
}

randomizeContent.collectElementbyClass=function(classname){ //return two arrays containing elements with specified classname, plus their innerHTML content
var classnameRE=new RegExp("(^|\\s+)"+classname+"($|\\s+)", "i") //regular expression to screen for classname within element
var contentobj=new Object()
contentobj.ref=new Array() //array containing references to the participating contents
contentobj.text=new Array() //array containing participating contents' contents (innerHTML property)
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (var i=0; i<alltags.length; i++){
if (typeof alltags[i].className=="string" && alltags[i].className.search(classnameRE)!=-1){
contentobj.ref[contentobj.ref.length]=alltags[i]
contentobj.text[contentobj.text.length]=alltags[i].innerHTML
}
}
return contentobj
}

function abrir(URL) {

   var width = 688;
   var height = 420;

   var left = 99;
   var top = 99;

   window.open(URL,'Herme', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function prog(URL) {

   var width = 328;
   var height = 417;

   var left = 99;
   var top = 99;

   window.open(URL,'Herme', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function addFav(){
		var url      = "http://www.radiocgfm.com";
    var title    = "Radio CG FM - A Estação do Som";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);
	}
}


