// Capaçalera CatRadio.com

var CRhomepage;
var CRsecure;

function capse(homepage, secure){	
CRhomepage = homepage;
CRsecure = secure;
//
var jsPathBar = (secure) ? "https://secure.ccrtvi.com/barra" : "http://www.tv3.cat/barra";
var jsPath = (secure) ? "https://secure.ccrtvi.com/catradio" : "";
//
document.write('<script language="javascript" type="text/javascript" src="'+jsPathBar+'/js/ccmabar.js"> </script>');
document.write('<script language="javascript" type="text/javascript" src="http://www.catradio.cat/js/CRcap.js"> </script>');
/*document.write('<script language="javascript" type="text/javascript" src="'+jsPath+'/js/CRcap.js"> </script>');*/
}

// Si no tenim el flash instal.lat, posem un missatge en cop de la capse generica
function noFlash(){
document.write("<div class='capse' style='height:40px'><table width='100%'  border='0' cellpadding='0' cellspacing='0' class='block'><tr><td class='noflashmsg'>"+
"	Per veure correctament els continguts de catradio.com has de tenir el reproductor de flash instal·lat.<br>"+
"	Descarrega-te\'l <a href='http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Spanish&P5_Language=Spanish' target='_blank'>des d'aquí</a> o accedeix al <a href='http://www.catradio.cat/mapaweb.htm'>mapa web</a> per navegar de manera accessible."+
"	</td></tr></table></div>");
}
// Peu de pŕgina CatRadio.com
function peu(secure){
var sImgBase = (secure==null) ? "http://www.catradio.cat/img/" : "https://secure.ccrtvi.com/catradio/img/";
document.write("<table width='100%'  border='0' cellpadding='0' cellspacing='0' id='peu'>"+
"  <tr>"+
"    <td>"+
"	<div class='left'><p class='footer'>&copy; 2009 Catalunya R&agrave;dio S.R.G., S.A. - CCRTV Interactiva, S.A.<br>"+
"<a href='http://www.catradio.cat/mapaweb.htm'>Mapa web</a> | <a href='http://www.catradio.cat/arxiu/siteindex/siteIndex.jsp'>Arxiu</a> | <a href='http://www.catradio.cat/avis/'>Avís legal</a> | <a href='http://www.catradio.cat/quisom/publicitat.htm'>Publicitat</a> | <img src='" + sImgBase + "icopeu_pod.gif' alt='' width='10' height='10'><a href='http://www.catradio.cat/pcatradio/crRadioAlacarta.jsp?pagina=podcasting&seccio=cr&tipus=emissio'>&nbsp;Podcast</a> | <img src='" + sImgBase + "icopeu_pod.gif' alt='' width='10' height='10'><a href='http://www.catradio.cat/rss'>&nbsp;RSS</a> | <a href='http://www.catradio.cat/widgets/' alt='Pŕgina de widgets de catradio.cat'>Widgets</a> | <a href='http://www.ccma.cat/atencio/catradio'>Atenció a l\’Audičncia <img src='http://www.ccma.cat/atencio/img/logoatencio_peu.gif' width='11' height='13' border='0' alt= \"Atenció a l\'Audičncia\" style='margin-top:2px'></a></p>"+
"	</div>"+
"	<div class='right'><a href='http://www.catradio.cat'><img src='" + sImgBase + "logo_catradio_main.gif' alt='catradio.com' title='catradio.com' width='96' height='31' border='0'></a><a href='http://www.ccrtvi.com'><img src='" + sImgBase + "logo_interactiva_main.gif' alt='ccrtv interactiva' title='ccrtv interactiva' width='95' height='31' border='0'></a></div>"+
"    <img src='" + sImgBase + "peu_gif.gif' width='757' height='13' style='margin-top:5px'></td>"+
"  </tr>"+
"</table>" +
((secure==null) ? "<script src='http://www.catradio.cat/js/ojd.js\'></script>" : ""));
}

// Pinta modulo arafem homepage

function araFemHp(n){
document.write("<object align='middle' id='arafem_hp' height='225' width='100%' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'><param value='sameDomain' name='allowScriptAccess'><param value='/flash/arafem_hp.swf?nombre_elements="+n+"' name='movie'><param name='wmode' value='opaque'/><param value='high' name='quality'><param value='#c00000' name='bgcolor'><param value='false' name='menu'>"+
"<embed pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' allowScriptAccess='sameDomain' align='middle' name='arafem_hp' height='225' width='100%' wmode='opaque' bgcolor='#c00000' quality='high' menu='false' src='/flash/arafem_hp.swf?nombre_elements="+n+"'></embed></object>");	
}

// Utilities
function changeTxtSize(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}

//
function stata(txt) {
self.status = txt
}

//
function statb() {
self.status = ""
}
//
// FUNCIÓ CAMBIA CSS (SWAP VISIBLE / HIDDEN)
var toggle = true;
function changeStyle(id, btn, newClass,oldClass,urlOn,urlOff) {
iden=document.getElementById(id);
btniden=document.getElementById(btn);
if(toggle){
iden.className=newClass;
btniden.src=urlOff;
}else{
iden.className=oldClass;
btniden.src=urlOn;
}
toggle = !toggle;
}


function sR(target) {
    pixel = new Image();
    parent.location.href = target;
    pixel.src = IVW+"?p="+Math.random();
}

function showMenu(id,cl){
document.getElementById(id).className = cl;
}
function hideMenu(id,cl){
document.getElementById(id).className = cl;
}