// JavaScript Document
function Abre(pg)   {window.open(pg,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=yes,width=520,height=400")}
function agenda(pg)   {window.open(pg,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=no,width=400,height=260")}
function enquete(pg)   {window.open(pg,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=yes,width=270,height=300")}
function anuncie(pg)   {window.open(pg,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=no,width=600,height=420")}
function aovivo(pg)   {window.open(pg,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=yes,width=418,height=500")}

//para players
function webcam(webcam)   
		{window.open(webcam,"playerw","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=no,width=370,height=340");
		}

function Open() {window.open('player/player.htm','radio','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,height=327,width=375');}
function AbrePagina(Radio, tamx, tamy) {window.open(Radio,"player","resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,width=" + tamx + ",height=" + tamy)}
function play2(pla) {window.open(pla2,'player','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,height=400,width=370');}
function play(pla) {window.open(pla,'player','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,height=400,width=370');}

function galeria2(gale) {window.open('gale','radio','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,height=250,width=400');}
function galeria2(gale) {window.open('gale','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,height=250,width=400');}
function galeria3(pg)   {cWin=window.open(pg,"galeria","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=no,width=620,height=500,left=" + ((screen.width / 2) - 290) + ",top=" + ((screen.height / 2) - 175));cWin.focus();}
function galeria(pg)   {cWin=window.open(pg,"galeria","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=no,width=690,height=575,left=" + ((screen.width / 2) - 290) + ",top=" + ((screen.height / 2) - 175));cWin.focus();}

//Adicionando aos favoritos
var url_site="http://www.radiocriciuma.com.br/" 
var titulo_site="..: Rádio Criciúma - A nossa rádio na Web :.." 
function adiciona_bookmark(){if (document.all)window.external.AddFavorite(url_site,titulo_site)} 

defaultStatus="Rádio Criciúma"
function MM_displayStatusMsg(msgStr) {
  status=msgStr;
  document.MM_returnValue = true;}

// Being of Scrolling text in the Status bar
var speed = 50 //decrease value to increase speed (must be positive) 
var pause = 2500 //increase value to increase pause
var timerID = null 
var bannerRunning = false
var ar = new Array()
ar[0] = "... :: : .  ... :::"
ar[1] = "A nossa rádio na web"
ar[2] = "a informação muito mais rápida"
ar[3] = "entrevistas, informação e muita diversão"
ar[4] = "www.radiocriciuma.com.br"
var currentMessage = 0
var offset = 0
function stopBanner() {if (bannerRunning)
		clearTimeout(timerID)
		bannerRunning = false}
function startBanner() {stopBanner()
						showBanner()}
function showBanner() { var text = ar[currentMessage]
		if (offset < text.length) {if (text.charAt(offset) == " ")
			offset++ 
			var partialMessage = text.substring(0, offset + 1)
			window.status = partialMessage
			offset++ 
			timerID = setTimeout("showBanner()", speed)
			bannerRunning = true
				} else {offset = 0
			currentMessage++
				if (currentMessage == ar.length)
					currentMessage = 0
					timerID = setTimeout("showBanner()", pause)
					bannerRunning = true}}
// -->
<!-- ##END SCROLLING -->
startBanner();

// Anti-Clicks na página - Apenas troque o "new Function("Return true;") por false, ou vice-versa para desabilitar ou habilitar o mesmo comando"
function click() {
if (event.button==2||event.button==3) { oncontextmenu='return false	';}}
document.onmousedown=click
document.oncontextmenu = new Function("return true;")

function MM_openBrWindow(theURL,winName,features) {  window.open(theURL,winName,features);}
  
function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}
function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;}

function MM_nbGroup(event, grpName) {var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {if ((img = MM_findObj(args[2])) != null && !img.MM_init) {img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {if (!img.MM_up) img.MM_up = img.src;
																				        img.src = img.MM_dn = args[i+1];
																				        nbArr[nbArr.length] = img; } }
  } else if (event == "over") {document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {if (!img.MM_up) img.MM_up = img.src;
																				      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
																				      nbArr[nbArr.length] = img;}
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {if (!img.MM_up) img.MM_up = img.src;
																				      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
																				      nbArr[nbArr.length] = img;}}}
//Botão de onBlur
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }}
<!--
var outColor;
function setColor(src,cor){
if(cor){outColor = src.bgColor;
src.bgColor=cor; c="hand";}
else{src.bgColor=outColor; c="default";}
src.style.cursor=c;}
function Go(){return};
function SH(nL){vLayers=new Array('menu1','menu2','menu3','menu4','menu5','menu6','menu7');
for(var i=0;i<vLayers.length;i++) MM_showHideLayers(vLayers[i],'','hide');
if(nL>vLayers.length) return; if((nL)||nL==0) MM_showHideLayers(vLayers[nL],'','show');}

//Função para abrir um pop-up redimensionável com a foto
function amplia(){
	var o = amplia.arguments;
		src = o[0];
		url = "./visualiza.htm?src="+src;
		url += "&legenda="+o[1];
		window.open(url,"","top=20,left=20,width=220,height=150");
}
// Função que vai dando transparência de leve
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){ 
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }

    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;
 
    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

var arrayList = new Array("news", "screenshots", "downloads", "buyonline", "lfs_world", "racercheckpoint", "toolsandaddons", "forum", "faqs", "links", "contactus", "lfs");
function clickLink(Name) {
   for (var i=0; i<arrayList.length; i++) {
      linkName = arrayList[i];
	  document[linkName].src = "page_images/emptydot.gif";
	  document[Name].src = "page_images/dot.gif";
   }
}

////////////////////////////////////////////////////////////////////////////////////////
// CORREÇÃO PARA EXIBIÇÃO DE PLAYERS PARA VÍDEO E ÁUDIO [ BERNE DA MICROSOFT] //////////
////////////////////////////////////////////////////////////////////////////////////////

function addgamepop(id,list) {
    popupWin = window.open('/pages/profile/add_game.php?pid=' + id + '&list=' + list, 'trackpop', 'width=260,height=440,resizable=1,scrollbars=0');
}

function track_contact(contact_username, mode, force_reload ) {
    if('undefined' == typeof force_reload) {force_reload = true;}
    addcontactpop( contact_username, mode );

    if ( force_reload ) {
        // reload the current page with the updated data.
        window.location.reload( force_reload );
    }
}

function track_union(union_id, mode, force_reload  ) {
    popupWin = window.open('/pages/profile/track_union.php?mode=' + mode + '&union_id=' + union_id, 'uniontrackpop', 'width=260,height=260,resizable=1,scrollbars=0');

    if('undefined' == typeof force_reload) {force_reload = true;}
    if ( force_reload ) {
        // reload the current page with the updated data.
        window.location.reload( force_reload );
    }
}

function addcontactpop(contact_username,mode) {
  popupWin = window.open('/pages/profile/track_contact.php?mode=' + mode + '&username=' + contact_username, 'contactpop', 'width=260,height=260,resizable=1,scrollbars=0');
}

function videoplayerpop(sid,pid,rgroup) {
  rgroup = rgroup ? '&rgroup=' + rgroup : '';
  popupWin = window.open('/pages/video_player/popup.php?sid=' + sid + '&pid=' + pid + rgroup, 'videoplayerpop', 'width=810,height=700,resizable=1,scrollbars=0');
  popupWin.focus();
}

function boxshotpop(pid) {
  popupWin = window.open('/pages/image_viewer/boxshot.php?pid=' + pid, 'boxshotpop', 'width=640,height=910,resizable=1,scrollbars=1');
  popupWin.focus();
}

function pollPop() {
  pollwin = window.open('/pages/modules/poll.php','pollwin','height=500,width=400');
  pollwin.focus();
}

function chatpop(chatroom) {
  popupWin = window.open('/chat/chat.php?room='+chatroom,'chatpop','width=620,height=420,scrollbars=0,menubar=0,toolbar=0,location=0,status=0,resizable=1');
}

function tourntvpop(tourn,rgroup) {
  window.location = 'http://www.gamespot.com/tournaments/'+tourn+'/tv.php';
  popupWin = window.open('/pages/gamecenter/tournaments/video_player/popup.php?id=' + tourn + '&rgroup=' + rgroup, 'tourntvplayerpop', 'width=810,height=700,resizable=1,scrollbars=0');
  popupWin.focus();
}

function onthespotpop(rgroup) {
  popupWin = window.open('/pages/features/onthespot/video_player/popup.php?rgroup=' + rgroup, 'onthespotplayerpop', 'width=867,height=800,resizable=0,scrollbars=1');
  popupWin.focus();
}

function eventPopup(event) {
  popupWin = window.open('/pages/event_popup/index.php?event=' + event, 'eventPopup_'+event, 'width=800,height=800,resizable=1,scrollbars=0,menubar=0,toolbar=0,location=0,status=0,');
  popupWin.focus();
}


function livereviewpop(rgroup) {
  popupWin = window.open('/pages/video_player/popup_special.php?rgroup=' + rgroup, 'livereviewpop', 'width=867,height=840,resizable=0,scrollbars=1');
  popupWin.focus();
}

function prefspop(tab) {
  popupWin = window.open('/pages/preferences/' + tab + '.php','prefspop','width=778,height=480,scrollbars=1,menubar=0,toolbar=0,location=0,status=0,resizable=1');
}

function pmpop(tab,user) {
  popupWin = window.open('/pages/pm/' + tab + '.php?to=' + user,'pmpop','width=778,height=480,scrollbars=1,menubar=0,toolbar=0,location=0,status=0,resizable=1');
}

function emblempop(id) {
  popupWin = window.open('/pages/profile/show_emblem.php?id=' + id,'emblempop','width=330,height=360,scrollbars=auto,menubar=0,toolbar=0,location=0,status=0,resizable=1');
  popupWin.focus();
}

function open_image_viewer(pid,img,sid,path,caption,numimg) {
    var page = '/pages/image_viewer/frame_lead.php?pid=' + pid + '&img=' + img + '&sid=' + sid;
    if(path) {
        page += '&path=' + path;
    }
    if(caption) {
        page += '&caption=' + caption;
    }
    if(numimg) {
        page += '&numimg=' + numimg;
    }

    x = window.open(page, '_blank', 'location=0,menubar=0,statusbar=0,toolbar=0,resizable=1,scrollbars=0,width=800,height=600,left=0,top=0');

}

function open_image_viewer_for_feature(pid,img,sid,path,caption,single) {
    var page = '/pages/image_viewer/frame.php?pid=' + pid + '&img=' + img + '&sid=' + sid;
    if(path) {
        page += '&path=' + path;
    }
    if(caption) {
        page += '&caption=' + caption;
    }
    if(single) {
    	page += '&single=1';
    }

    x = window.open(page, '_blank', 'location=0,menubar=0,statusbar=0,toolbar=0,resizable=1,scrollbars=0,width=800,height=600,left=0,top=0');

}

function open_image_viewer_for_path_gallery(img,numimg,path,caption) {
    var page = '/pages/image_viewer/frame.php?img=' + img + '&numimg=' + numimg + '&path=' + path;
    if(caption) {
        page += '&caption=' + caption;
    }

    x = window.open(page, '_blank', 'location=0,menubar=0,statusbar=0,toolbar=0,resizable=1,scrollbars=0,width=800,height=600,left=0,top=0');

}

function genpop(url,name,width,height,resize,scroll) {
    popupWin = window.open(url, name,'width='+width+',height='+height+',resizable='+resize+',scrollbars='+scroll+',location=0,menubar=0,statusbar=0,toolbar=0');
}



// use this instead of body.onload (see below for usage)

function addEvent(obj, evType, fn, useCapture){
    if (obj.addEventListener){
        obj.addEventListener(evType, fn, useCapture);
        return true;
    }
    else if (obj.attachEvent) {
        var r = obj.attachEvent("on"+evType, fn);
        return r;
    }
    else {
        alert("Handler could not be attached");
    }
}

// resize forum images

function resize_forum_images() {
    divs = document.getElementsByTagName("div");
    for (i=0; i < divs.length; i++) {
        if (divs[i].className == 'message') {
//            alert('message ' + i);
//            pop.document.write('starting new message<br>');
            child = divs[i].childNodes;
            for (j=0; j < child.length; j++) {
//                pop.document.write(child[j].nodeName + '<br>');
                if (child[j].nodeName.toLowerCase() == 'img' && child[j].width > 600) {
                    child[j].width = 600;
                }
            }
        }
    }
}

//Begin Iframe Auto Resize

var iframeids=["most_popular"]
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=getFFVersion>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function dyniframesize() {
    var dyniframe=new Array()
    for (i=0; i<iframeids.length; i++) {
        if (document.getElementById) { //begin resizing iframe procedure
            dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
            if (dyniframe[i] && !window.opera) {
                dyniframe[i].style.display="block"
                if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight) //ns6 syntax
                    dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight+FFextraHeight;
                else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) //ie5+ syntax
                dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;
            }
        }
    }
}

addEvent(window, "load", dyniframesize);

// community piechart flipper

function show_piechart(x) {
    var a = new Array('score', 'curve', 'diff', 'time');
    for (i=0; i < a.length; i++) {
        if (a[i] == x) {
            document.getElementById('piechart_' + a[i]).style.display='';
            document.getElementById('piechart_span_' + a[i]).style.color='white';
        }
        else {
            document.getElementById('piechart_' + a[i]).style.display='none';
            document.getElementById('piechart_span_' + a[i]).style.color='';
        }
    }
}


// use: <img onerror="hide_broken_img(this)" src="http://broken.com/image.gif" />
function hide_broken_img(img) {
    img.src='http://img.gamespot.com/gamespot/shared/forum/user_icons/GameSpot/gamespot.gif';
}

function hide_broken_union_img(img) {
    img.src='http://img.gamespot.com/gamespot/shared/unions/union_icon.gif';
}

function embed(tag){
    // msoft activex controls no longer start up 'activated' after april 11/06 (require focus to activate)
    // workaround requires object/embed tags to be included in external js
    // hence this func... sb
    // note: if 'allow script debugging' is *not* checked in ie settings, you will still get the activiation prompt!
    document.write(tag);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////
// CORREÇÃO PARA EXIBIÇÃO DE OBJETOS ACTIVEX COMO SWF [OUTRO BERNE DA MICROSOFT + MACROMEDIA] /////////
///////////////////////////////////////////////////////////////////////////////////////////////////////

function monta_swf($arquivo,$altura,$largura,$id){
    document.writeln('    <object id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + $largura + '" height="' + $altura + '" id="' + $id + '" name="' + $id + '">');
    document.writeln('        <param name="movie" value="' + $arquivo + '" />');
    document.writeln('        <param name="FlashVars" value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />');
    document.writeln('        <param name="bgcolor" value="#ffffff" />');
    document.writeln('        <param name="menu" value="false" />');
    document.writeln('        <param name="quality" value="high" />');
    document.writeln('        <param name="salign" value="tl" />');
    document.writeln('        <param name="scale" value="noscale" />');
    document.writeln('        <param name="wmode" value="transparent" />');
    document.writeln('        <embed id="globalnav-embed" src="' + $arquivo + '" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" wmode="transparent" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#ffffff" menu="false" quality="high" salign="tl" scale="noscale" id="' + $id + '" width="' + $largura + '" height="' + $altura + '"></embed>');
    document.writeln('    </object>');
}


/*function fechaFloater(){
	var f = document.getElementById( "floater" );
	f.parentNode.removeChild( f );
}

function fechaFloaterCamara(){
	var f = document.getElementById( "floaterCamara" );
	f.parentNode.removeChild( f );
}*/