vLastPlayedLast = 'Ha sonat: ';

vLastPlayedNow = 'Està sonant: ';



function HTML(w, oParam){

	var op = '';

	switch(w){

		

		/**

		 * Login Failure Message

		 * --------------------------------------------------------------------------------

		 */

		case 'LoginFailureMessage':

			op += '<div class="warning">';

			op += 	'Nom d\'usuari/clau incorrecte';

			op += '</div>';

			op += '<ul>';

			op += 	'<li><a href="https://secure.ccrtvi.com/su/cr/crClauOblidada.jsp" target="_blank">Recordar clau</a></li>';

			op += 	'<li><a href="https://secure.ccrtvi.com/su/cr/crReg1.jsp" target="_blank">Registra\'t</a></li>';

			op += '</ul>';

			break;

		

		

		/**

		 * Anonymous Identification Form

		 * --------------------------------------------------------------------------------

		 */

		case 'AnonymousID':

			op += '<div class="note">';

			op += 	'Recorda que també pots participar en el debat com a usuari registrat. D’aquesta manera no t’hauràs d’identificar cada vegada.';

			op += 	'<strong><a href="#" onclick="InterfaceAgent.focusLoginInterface(); return false;">Identifica\'t</a></strong> ';

			op += '</div>';

			op += '<div>Nom</div>';

			

			var vALIAS_ID="";

			var vTITOL="";

			var vENTRADETA="";

			

			try{

				if(fieldExists(document.commentForm.ALIAS_ID)){

					vALIAS_ID= document.commentForm.ALIAS_ID.value;

				}

				if(fieldExists(document.commentForm.TITOL)){

					vTITOL= document.commentForm.TITOL.value;

				}

				if(fieldExists(document.commentForm.ENTRADETA)){

					vENTRADETA= document.commentForm.ENTRADETA.value;

				}				

			}

			catch(error){trace(error);}

			

			op += '<input type="text" name="ALIAS_ID" id="fNom" value="'+vALIAS_ID+'" class="field" />';

			op += '<div>Correu electr&ograve;nic</div>';

			op += '<input type="text" name="TITOL" id="fCorreu" value="'+vTITOL+'" class="field" />';

			op += '<div>Poblaci&oacute;</div>';

			op += '<input type="text" name="ENTRADETA" id="fPoblacio" value="'+vENTRADETA+'" class="field" />';

			// clausula de privadesa

			op += '<input type="checkbox" name="privadesa" id="fPrivadesa" value="0" /><label><a href="#/endirecte/clausula.html" onclick="InterfaceAgent.popup(\'/endirecte/clausula.html\', 535, 500); return false;">He llegit i accepto les condicions de la cl&agrave;usula legal</a></label>';

			

			//op += 	'<input type="checkbox" name="showdata" id="idShowdata" value="1" />';

			//op += 	'<label for="idShowdata">Vull mostrar les dades</label>';

			op += '</div>';

			op += '<div class="links">';

//			op += 	'<a href="#/endirecte/moderacio.html" onclick="InterfaceAgent.popup(\'/endirecte/moderacio.html\', 325, 375); return false;" class="arrow">Moderaci&oacute; de missatges</a>';

//			op += 	' &nbsp; ';

//			op += 	'<a href="#/endirecte/normes.html" onclick="InterfaceAgent.popup(\'/endirecte/normes.html\', 550, 485); return false;" class="arrow">Normes d\'us</a>';

//			op += '</div>';

			break;

			

		

		

		/**

		 * Anonymous Identification Loading Status

		 * --------------------------------------------------------------------------------

		 */

		case 'AnonymousIDLoading':

			op += '<div class="loading"><img src="img/sending2.gif" alt="Enviant" /><div>Enviant</div></div>';

			break;

			

		/**

		 * Anonymous Identification Success Window

		 * --------------------------------------------------------------------------------

		 */

		case 'AnonymousIDSuccess':

			op += '<div class="result">';

			op +=    '<img src="img/message_ok.gif" alt="Enviant" />';

			op +=    '<div>';

			//op +=       'El teu missatge s\'ha enviat correctament.';

			if( vLoged && modType=="PUBNM" ) {

				op += 		'<div><strong>El teu missatge s&acute;ha enviat correctament, per&ograve; tardar&agrave; uns moments a   publicar-se. </strong><br>Gr&agrave;cies per haver participat</div>';

			}else{

				op += 		'<div><strong>El teu missatge s&acute;ha enviat correctament.</strong> Es publicar&agrave; quan hagi passat el   proc&eacute;s de validaci&oacute;. <br>Gr&agrave;cies per haver participat.</strong></div>';	

			}

			op +=    '</div>';

			op += '</div>';

			break;

		

		

		/**

		 * Anonymous Identification Failure Window

		 * --------------------------------------------------------------------------------

		 */

		case 'AnonymousIDFailure':

			op += '<div class="result">';

			op +=    '<img src="img/message_error.gif" alt="Enviant" />';

			op +=    '<div>';

			op +=       'El teu missatge no s\'ha pogut enviar.';

			op += 		'<div><strong>Torna-ho a intentar.</strong></div>';

			op +=    '</div>';

			op += '</div>';

			break;



		/**

		 * If the arrow points to llistaBCs[0], we try to put the divTitol's title

		 * because when we initialize the llistaTitolsBCs[0], maybe we haven't

		 * updated this. If it fails, we put the default title.

		 */			

		case 'HeaderLastPlayed':

			op += '<span id="arrowsLastPlayed">';//last played

			var bScrollLeft= (indexLastSelected < (numBCs -1))? true : false;

			var bScrollRight= (indexLastSelected >0)? true: false;

			// Left scroll arrow?

			if(bScrollLeft) {

				op += '<a class="thumbnail" href="javascript:loadBCFromList('+(indexLastSelected+1)+')" style="float: left; margin-right: 5px;';

				if(!bScrollRight) op += ' margin-right: 22px;';

				op += '">';

				op += '<img src="img/h3previous.gif" alt="" />';

				

				var vTitleTmp;

				if ((indexLastSelected+1)==0){

					try{vTitleTmp= vLastPlayedNow + vdivTitol.data["titol"]; if(vTitleTmp==undefined) throw("no data");}

					catch(error){vTitleTmp= vLastPlayedNow + vlastPlayed.data["llistaTitolsBCs"][0];}

				}

				else {

					vTitleTmp= vLastPlayedLast + vlastPlayed.data["llistaTitolsBCs"][(indexLastSelected+1)];

				}

				//alert("len: "+vlastPlayed.data["llistaTitolsBCs"].length);

				op += '<span>'+vTitleTmp+'</span>';

				op += '</a>';

			}

			

			// Right scroll arrow?

			if(bScrollRight) {

				op += '<a class="thumbnail" href="javascript:loadBCFromList('+(indexLastSelected-1)+')" style="float: left; margin-right: 5px;';

				if(!bScrollLeft) op += ' margin-left: 16px;';

				op += '">';

				op += '<img src="img/h3next.gif" alt="" />';

				var vTitleTmp;

				if ((indexLastSelected-1)==0){

					try{vTitleTmp= vLastPlayedNow + vdivTitol.data["titol"]; if(vTitleTmp==undefined) throw("no data");}

					catch(error){vTitleTmp= vLastPlayedNow + vlastPlayed.data["llistaTitolsBCs"][0];}

				}

				else {

					vTitleTmp= vLastPlayedLast + vlastPlayed.data["llistaTitolsBCs"][(indexLastSelected-1)];

				}

				op += '<span>'+vTitleTmp+'</span>';

				op += '</a>';

			}

			op += '</span>';//last played

			

			if(vlastPlayed.data["llistaTitolsBCs"].length <=1){

				//Do not add any title

			}else if (indexLastSelected==0){

				op += vTitolLastPlayed;

			}

			else{

				op += vLastPlayedLast + oParam;

			}	

			break;

			

		case 'HideCommentRows':

			op += 'En aquests moments, els comentaris via web, micr&ograve;fon o SMS estan desactivats.';

			op += 'Si ens vols contactar, ho pots fer a trav&eacute;s de:';

			op += '<p>';

			op +=    '<a target="_blank" href="http://www.catradio.cat/pcatradio/atcSeccio.jsp"><img alt="5430" src="img/footer_5430p.gif"/></a>';

			op += '</p>';		

			break;



		/**

		 * InactiveMessages

		 * --------------------------------------------------------------------------------

		 */

		case 'InactiveMessages':

			op += '<div class="warning">';

			op += 	'Els comentaris no estan activats!';

			op += '</div>';

			break;			

		

	}

	

	// return the requested piece of HTML

	return op;

}



function disableLiveInterface() {

	var thumbs = new Array();

	thumbs[0] = new Array();

	thumbs[0]['source'] = 'img/thumb_elmati2.jpg';

	thumbs[0]['title'] = 'El matí de Catalunya Ràdio';

	thumbs[0]['description'] = 'de dilluns a divendres, de 08.00 a 12.00';

	

	thumbs[1] = new Array();

	thumbs[1]['source'] = 'img/thumb_elsecret.jpg';

	thumbs[1]['title'] = 'El secret';

	thumbs[1]['description'] = 'de dilluns a divendres, de 16.00 a 19.00';

		

	thumbs[2] = new Array();

	thumbs[2]['source'] = 'img/thumb_ofici.jpg';

	thumbs[2]['title'] = 'L\'ofici de viure';

	thumbs[2]['description'] = 'de dilluns a divendres, de 21.00 a 22.00';

	

	thumbs[3] = new Array();

	thumbs[3]['source'] = 'img/thumb_millorsanys2.jpg';

	thumbs[3]['title'] = 'El club de la mitjanit';

	thumbs[3]['description'] = 'de dilluns a divendres, de 00.00 a 01.30';

	

	thumbs[4] = new Array();

	thumbs[4]['source'] = 'img/thumb_generaciodigital.jpg';

	thumbs[4]['title'] = 'Generació Digital';

	thumbs[4]['description'] = 'Dissabte, de 16:00 a 17:00';

	

	thumbs[5] = new Array();

	thumbs[5]['source'] = 'img/thumb_totgira.jpg';

	thumbs[5]['title'] = 'Tot gira';

	thumbs[5]['description'] = 'Les tardes de dissabtes i diumenges';



	var title = 'En aquests moments, els comentaris via web, micròfon o SMS estan desactivats.Si vols opinar sobre el programa fora de les hores d\'emissió en directe o fer-nos arribar els teus suggeriments, tens a la teva disposició el <a href="http://www.catradio.cat/pcatradio/atcSeccio.jsp">Servei d\'Atenció 5430</a>';

	var intro = 'Aquestes opcions s\'activen per als programes:';

	var outro = '<a href="http://www.catradio.cat/siteindex/siteIndex.jsp?pid=5">Consulta l\'arxiu de missatges</a>';//

	

	InterfaceAgent.disableLiveInterface(title, thumbs, intro, outro);

}

