var ie=(document.all) ? 1:0;
var n4=(document.layers) ? 1:0;
var n6=(document.getElementById) ? 1:0;  

var notiOptVis = '';
var submenuAct = '0';
var vaciarSubmenu = 'no';
var cont = '';

var num_art_MN = '6';
var num_art_O = '9';
var tipo_apart = 'foto';

var redac_act = 0;
var cat_act = 1;
var cat_act_mesedi = 44;
var whitespace = " \t\n\r";
var reWhitespace = /^\s+$/

var letra = 12;
var inter_letra = 1;
var letra_max = 16;
var letra_min = 10;
var idv_act = "";
/**
 * Verifica que no este vacio
 */
function isEmpty(s){   
	return ((s == null) || (s.length == 0)) 
}

/**
 * Verifica que no sean espacios en blanco
 */
function isWhitespace (s){
    return (isEmpty(s) || reWhitespace.test(s));
}
/**
 * Devolver cadena sin espacios por delante y por detras.
 */
function trimAll(sString) 
{
	while (sString.substring(0,1) == ' '){
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' '){
		sString = sString.substring(0,sString.length-1);
	}
return sString;
}
/**
 * Valida un email mediante expresiones regulares
 */
function validarEmail(valor) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(valor)){
		return true;
	} else {
		return false;
	}
}
/**
 * Verifica que sea un número
 */
function IsNum(strString, masChars){
	var strValidChars = "0123456789"+masChars;
	var strChar;
	var blnResult = true;

	if (strString.length == 0) return false;

	for (i = 0; i < strString.length && blnResult == true; i++){
		strChar = strString.charAt(i);
		if (strValidChars.indexOf(strChar) == -1){
			blnResult = false;
		}
	}
	return blnResult;
}

function overMenu(obj, idsecc){
  var str = obj.src;
  str = str.replace ('.gif', '_over.gif');
  obj.src = str;
/*  if (submenuAct!=0){
    //document.getElementById('seccion_' + submenuAct).style.display = 'none';
//    var mySlide2 = new Fx.Slide('seccion_' + submenuAct, {mode: 'vertical'});
//    mySlide2.slideOut();
  }
  //document.getElementById('seccion_' + idsecc).style.display = 'inline';
//  var mySlide2 = new Fx.Slide('seccion_' + idsecc, {mode: 'vertical'});
//  mySlide2.slideIn();*/
  submenuAct = idsecc;
}
function outMenu(obj){
  var str = obj.src;
  str = str.replace ('_over.gif', '.gif');
  obj.src = str;
}
function outMenuGlobal(menuPred, total){
  for (i=0; i<total;i++){
    if (document.getElementById('seccion_' + i)){
//      document.getElementById('seccion_' + i).style.display = 'none';
      var mySlide2 = new Fx.Slide('seccion_' + i, {mode: 'vertical'});
      mySlide2.slideOut();
      
      var str = "";
      str = document.getElementById('imgMenu_'+i).src;
      str = str.replace ('_over.gif', '.gif');
      document.getElementById('imgMenu_'+i).src = str;
    }
  }
  if (menuPred!=0){
//    document.getElementById('seccion_' + menuPred).style.display = 'inline';
    var mySlide2 = new Fx.Slide('seccion_' + menuPred, {mode: 'vertical'});
    mySlide2.slideIn();
  }
}
function overMenuGlobal(menuPred, total){
  if (vaciarSubmenu=='no'){
    if (submenuAct!=0){
//      document.getElementById('seccion_' + submenuAct).style.display = 'inline';
      var mySlide2 = new Fx.Slide('seccion_' + submenuAct, {mode: 'vertical'});
      mySlide2.slideIn();
      
      var str = document.getElementById('imgMenu_'+submenuAct).src;
      str = str.replace ('_over.gif', '.gif');
      str = str.replace ('.gif', '_over.gif');
      document.getElementById('imgMenu_'+submenuAct).src = str;
    }
  }else{
    vaciarSubmenu='no';
  }
}
function overSubMenu(obj){
}
function outSubMenu(obj){
}

function onMenu(){
  var obj = document.getElementById("imgMenu_"+submenuAct);
  var str = obj.src;
  str = str.replace ('_over.gif', '.gif');
  str = str.replace ('.gif', '_over.gif');
  obj.src = str;
//  if (!isWhitespace(cont))
  if ((isWhitespace(cont))||(cont=="<SPAN class=qmclear>&nbsp;</SPAN>")){
    document.getElementById('id_submenu').style.display = 'none';
  }else{
    document.getElementById('id_submenu').style.display = 'inline';
  }
}
function offMenu(){
  var obj = document.getElementById("imgMenu_"+submenuAct);
  var str = obj.src;
  str = str.replace ('_over.gif', '.gif');
  obj.src = str;
  document.getElementById('id_submenu').style.display = 'none';
}
function onEstado(obj){
  var str = obj.src;
  str = str.replace('_out', '_over');
  obj.src = str;
}
function offEstado(obj){
  if ((obj.id != tipo_apart)&&(obj.id!='pagMN'+num_art_MN)&&(obj.id!='pagO'+num_art_O)){
    var str = obj.src;
    str = str.replace('_over', '_out');
    obj.src = str;
  }
}
function go(theFrame) {
//	alert(theFrame);
  if (movieIsLoaded(thisMovie(movieName))) {
//	alert (movieName);
    thisMovie(movieName).GotoFrame(theFrame);
  }
}
function overEnlOpinio(enl){
  if (enl!=redac_act){    document.getElementById('enl_opinio'+enl).style.color = "#000000";  }
}
function outEnlOpinio(enl){
  if (enl!=redac_act){    document.getElementById('enl_opinio'+enl).style.color = "#757371";  }
}
function overUlttit(enl){
  if (enl!=cat_act){    document.getElementById('enl_ulttit'+enl).style.color = "#000000";  }
}
function outUlttit(enl){
  if (enl!=cat_act){    document.getElementById('enl_ulttit'+enl).style.color = "#757371";  }
}
function overMesEdi(enl){
  if (enl!=cat_act_mesedi){    document.getElementById('enl_mesedi'+enl).style.color = "#000000";  }
}
function outMesEdi(enl){
  if (enl!=cat_act_mesedi){    document.getElementById('enl_mesedi'+enl).style.color = "#757371";  }
}
function printResult(namSpan, result){
	if(ie){    
		document.all[namSpan].innerHTML=result;
	}else{
		if(n4){
			document.layers[namSpan].innerHTML=result;
		}else{
			if(n6){      
				document.getElementById(namSpan).innerHTML=result;
			}
		}
	}
}
function compComentario(frm, idi, a){
	printResult ("spanResultComen", "");
	frm.comen.style.border="solid #E8E7DB 1px";
	frm.ciudad.style.border="solid #E8E7DB 1px";
	frm.email.style.border="solid #E8E7DB 1px";
	frm.nombre.style.border="solid #E8E7DB 1px";
	if (frm.codconf){
		frm.codconf.style.border="solid #E8E7DB 1px";
	}
	var msgCod = "";
	var msgCom = "";
	var msgCiu = "";
	var msgEma = "";
	var msgEma2 = "";
	var msgNom = "";
	var result = "";
	var retorno = true;
	var cont = 0;
	if (frm.codconf){
		if (isWhitespace(frm.codconf.value)){
			if (idi=="es"){	msgCod = " código de seguridad";	}else{	msgCod = " codi de seguretat";	}
			frm.codconf.style.border="solid #9C1F2E 1px";
			frm.codconf.select();
			frm.codconf.focus();
			cont++;
			retorno = false;
		}
	}
	if (isWhitespace(frm.comen.value)){
		if (idi=="es"){	msgCom = " comentario"	}else{	msgCom = " comentari"	}
		frm.comen.style.border="solid #9C1F2E 1px";
		frm.comen.select();
		frm.comen.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.ciudad.value)){
		if (idi=="es"){	msgCiu = " ciudad"	}else{	msgCiu = " ciutat"	}
		frm.ciudad.style.border="solid #9C1F2E 1px";
		frm.ciudad.select();
		frm.ciudad.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.email.value)){
		if (idi=="es"){	msgEma = " e-mail";	}else{	msgEma = " e-mail";	}
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.nombre.value)){
		if (idi=="es"){	msgNom = " nombre";	}else{	msgNom = " nom";	}
		frm.nombre.style.border="solid #9C1F2E 1px";
		frm.nombre.select();
		frm.nombre.focus();
		cont++;
		retorno = false;
	}
	if ((!validarEmail(frm.email.value))&&(msgEma==""))
	{
		if (idi=="es"){	msgEma2 = " e-mail";	}else{	msgEma2 = " e-mail";	}
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		cont++;
		retorno = false;
	}
	if (retorno==false){
		if ((msgNom!="")||(msgEma!="")||(msgCiu!="")||(msgCom!="")||(msgCod!="")){
			if (idi=="es"){
				if (cont==1){	result = "Informa el campo";	}else{	result = "Informa los campos";	}
			}else{
				if (cont==1){	result = "Informi el camp";	}else{	result = "Informi els camps";	}
			}
			result = result + msgNom;
			if ((msgNom!="")&&(msgEma!="")){	result = result + ",";	}
			result = result + msgEma;
			if (((msgNom!="")||(msgEma!=""))&&(msgCiu!="")){	result = result + ",";	}
			result = result + msgCiu;
			if (((msgNom!="")||(msgEma!="")||(msgCiu!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgCom;
			if (((msgNom!="")||(msgEma!="")||(msgCiu!="")||(msgCom!=""))&&(msgCod!="")){	result = result + ",";	}
			result = result + msgCod;
			result = result + ".<br />";
		}
		if (msgEma2!=""){
			if (idi=="es"){	result = result + "El e-mail informado  no es correcto.";	}else{	result = result + "L'e-mail informat no es correcte.";	}
		}
		printResult ("spanResultComen", result);
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	envComentario(frm);
}
function compEnviar(frm, idi, a){
	printResult ("spanResultEnviar", "");
	frm.mens.style.border="solid #E8E7DB 1px";
	frm.email2.style.border="solid #E8E7DB 1px";
	frm.nombre2.style.border="solid #E8E7DB 1px";
//	frm.email.style.border="solid #E8E7DB 1px";
//	frm.nombre.style.border="solid #E8E7DB 1px";
	var msgEma4 = "", msgEma3 = "", msgCom = "", msgEma2 = "", msgNom2 = "", msgEma = "", msgNom = "", result = "", msgKey = "";
	var retorno = true;
	var cont = 0;
	/*if (isWhitespace(frm.mens.value)){
		if (idi=="es"){	msgCom = " mensaje"	}else{	msgCom = " missatge"	}
		frm.mens.style.border="solid #9C1F2E 1px";
		frm.mens.select();
		frm.mens.focus();
		cont++;
		retorno = false;
	}*/
	if (isWhitespace(frm.key.value)){
		if (idi=="es"){	msgKey = " Código de seguridad";	}else{	msgKey = " Codi de seguretat";	}
		frm.key.style.border="solid #9C1F2E 1px";
		frm.key.select();
		frm.key.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.email2.value)){
		if (idi=="es"){	msgEma2 = " e-mail de tu amigo";	}else{	msgEma2 = " e-mail del teu amic";	}
		frm.email2.style.border="solid #9C1F2E 1px";
		frm.email2.select();
		frm.email2.focus();
		cont++;
		retorno = false;
	}
	var str = frm.email2.value;
	var x;
	var arr;
	arr = str.split(",");
//	alert (arr[0]);
//	alert (arr[1]);
	if (msgEma2=="")
	{
		if (arr[1])
		{
			for (x in arr)
			{
				if (!validarEmail(arr[x]))
				{
					if (idi=="es"){	msgEma4 = " e-mail";	}else{	msgEma4 = " e-mail";	}
					frm.email2.style.border="solid #9C1F2E 1px";
					frm.email2.select();
					frm.email2.focus();
					cont++;
					retorno = false;
				}
			}
		}
	}
	/*if (isWhitespace(frm.nombre2.value)){
		if (idi=="es"){	msgNom2 = " nombre de tu amigo"	}else{	msgNom2 = " nom del teu amic"	}
		frm.nombre2.style.border="solid #9C1F2E 1px";
		frm.nombre2.select();
		frm.nombre2.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.email.value)){
		if (idi=="es"){	msgEma = " e-mail";	}else{	msgEma = " e-mail";	}
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		cont++;
		retorno = false;
	}
	if ((!validarEmail(frm.email.value))&&(msgEma==""))
	{
		if (idi=="es"){	msgEma3 = " e-mail";	}else{	msgEma3 = " e-mail";	}
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.nombre.value)){
		if (idi=="es"){	msgNom = " nombre";	}else{	msgNom = " nom";	}
		frm.nombre.style.border="solid #9C1F2E 1px";
		frm.nombre.select();
		frm.nombre.focus();
		cont++;
		retorno = false;
	}*/
	if (retorno==false){
		if ((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!="")||(msgCom!="")||(msgKey!="")){
			if (idi=="es"){
				if (cont==1){	result = "Informa el campo";	}else{	result = "Informa los campos";	}
			}else{
				if (cont==1){	result = "Informi el camp";	}else{	result = "Informi els camps";	}
			}
			result = result + msgNom;
			if ((msgNom!="")&&(msgEma!="")){	result = result + ",";	}
			result = result + msgEma;
			if (((msgNom!="")||(msgEma!=""))&&(msgNom2!="")){	result = result + ",";	}
			result = result + msgNom2;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!=""))&&(msgEma2!="")){	result = result + ",";	}
			result = result + msgEma2;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgCom;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgKey;
			result = result + ".";
		}
		if (msgEma3!=""){
			result = result + "<br />";
			if (idi=="es"){	result = result + "Tu e-mail no es correcto.";	}else{	result = result + "El teu e-mail no es correcte.";	}
		}
		if (msgEma4!=""){
			result = result + "<br />";
			if (idi=="es"){	result = result + "El e-mail de tu amigo no es correcto.";	}else{	result = result + "L'e-mail del teu amic no es correcte.";	}
		}
		printResult ("spanResultEnviar", result);
		if (a==false){
			return;
		}else{
			return false;
		}
//		return false;
	}
	envAmigo(frm);
}
function compEnviarN(frm, idi, a){
	printResult ("spanResultEnviar", "");
	frm.mens.style.border="solid #E8E7DB 1px";
	frm.email2.style.border="solid #E8E7DB 1px";
	frm.nombre2.style.border="solid #E8E7DB 1px";
	frm.key.style.border="solid #E8E7DB 1px";
	var msgEma4 = "", msgEma3 = "", msgCom = "", msgEma2 = "", msgNom2 = "", msgEma = "", msgNom = "", result = "", msgKey = "";
	var retorno = true;
	var cont = 0;
	if (isWhitespace(frm.key.value)){
		if (idi=="es"){	msgKey = " Código de seguridad";	}else{	msgKey = " Codi de seguretat";	}
		frm.key.style.border="solid #9C1F2E 1px";
		frm.key.select();
		frm.key.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.email2.value) || (idi=="es" && frm.email2.value=="E-mail de tu amigo") || (idi=="cat" && frm.email2.value=="E-mail del teu amic")){
		if (idi=="es"){	msgEma2 = " e-mail de tu amigo";	}else{	msgEma2 = " e-mail del teu amic";	}
		frm.email2.style.border="solid #9C1F2E 1px";
		frm.email2.select();
		frm.email2.focus();
		cont++;
		retorno = false;
	}
	var str = frm.email2.value;
	var x;
	var arr;
	arr = str.split(",");
	if (msgEma2=="")
	{
		if (arr[1])
		{
			for (x in arr)
			{
				if (!validarEmail(arr[x]))
				{
					if (idi=="es"){	msgEma4 = " e-mail";	}else{	msgEma4 = " e-mail";	}
					frm.email2.style.border="solid #9C1F2E 1px";
					frm.email2.select();
					frm.email2.focus();
					cont++;
					retorno = false;
				}
			}
		}
	}
	if (retorno==false){
		if ((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!="")||(msgCom!="")||(msgKey!="")){
			if (idi=="es"){
				if (cont==1){	result = "Informa el campo";	}else{	result = "Informa los campos";	}
			}else{
				if (cont==1){	result = "Informi el camp";	}else{	result = "Informi els camps";	}
			}
			result = result + msgNom;
			if ((msgNom!="")&&(msgEma!="")){	result = result + ",";	}
			result = result + msgEma;
			if (((msgNom!="")||(msgEma!=""))&&(msgNom2!="")){	result = result + ",";	}
			result = result + msgNom2;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!=""))&&(msgEma2!="")){	result = result + ",";	}
			result = result + msgEma2;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgCom;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgKey;
			result = result + ".";
		}
		if (msgEma3!=""){
			result = result + "<br />";
			if (idi=="es"){	result = result + "Tu e-mail no es correcto.";	}else{	result = result + "El teu e-mail no es correcte.";	}
		}
		if (msgEma4!=""){
			result = result + "<br />";
			if (idi=="es"){	result = result + "El e-mail de tu amigo no es correcto.";	}else{	result = result + "L'e-mail del teu amic no es correcte.";	}
		}
		printResult ("spanResultEnviar", result);
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	envAmigoN(frm);
}
function compEnviarN2(frm, idi, a){
	printResult ("spanResultEnviar", "");
	frm.mens.style.border="solid #E8E7DB 1px";
	frm.email2.style.border="solid #E8E7DB 1px";
	frm.nombre2.style.border="solid #E8E7DB 1px";
	frm.key.style.border="solid #E8E7DB 1px";
	var msgEma4 = "", msgEma3 = "", msgCom = "", msgEma2 = "", msgNom2 = "", msgEma = "", msgNom = "", result = "", msgKey = "";
	var retorno = true;
	var cont = 0;
	if (isWhitespace(frm.key.value)){
		if (idi=="es"){	msgKey = " Código de seguridad";	}else{	msgKey = " Codi de seguretat";	}
		frm.key.style.border="solid #9C1F2E 1px";
		frm.key.select();
		frm.key.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.email2.value) || (idi=="es" && frm.email2.value=="E-mail de tu amigo") || (idi=="cat" && frm.email2.value=="E-mail del teu amic")){
		if (idi=="es"){	msgEma2 = " e-mail de tu amigo";	}else{	msgEma2 = " e-mail del teu amic";	}
		frm.email2.style.border="solid #9C1F2E 1px";
		frm.email2.select();
		frm.email2.focus();
		cont++;
		retorno = false;
	}
	var str = frm.email2.value;
	var x;
	var arr;
	arr = str.split(",");
	if (msgEma2=="")
	{
		if (arr[1])
		{
			for (x in arr)
			{
				if (!validarEmail(arr[x]))
				{
					if (idi=="es"){	msgEma4 = " e-mail";	}else{	msgEma4 = " e-mail";	}
					frm.email2.style.border="solid #9C1F2E 1px";
					frm.email2.select();
					frm.email2.focus();
					cont++;
					retorno = false;
				}
			}
		}
	}
	if (retorno==false){
		if ((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!="")||(msgCom!="")||(msgKey!="")){
			if (idi=="es"){
				if (cont==1){	result = "Informa el campo";	}else{	result = "Informa los campos";	}
			}else{
				if (cont==1){	result = "Informi el camp";	}else{	result = "Informi els camps";	}
			}
			result = result + msgNom;
			if ((msgNom!="")&&(msgEma!="")){	result = result + ",";	}
			result = result + msgEma;
			if (((msgNom!="")||(msgEma!=""))&&(msgNom2!="")){	result = result + ",";	}
			result = result + msgNom2;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!=""))&&(msgEma2!="")){	result = result + ",";	}
			result = result + msgEma2;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgCom;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgKey;
			result = result + ".";
		}
		if (msgEma3!=""){
			result = result + "<br />";
			if (idi=="es"){	result = result + "Tu e-mail no es correcto.";	}else{	result = result + "El teu e-mail no es correcte.";	}
		}
		if (msgEma4!=""){
			result = result + "<br />";
			if (idi=="es"){	result = result + "El e-mail de tu amigo no es correcto.";	}else{	result = result + "L'e-mail del teu amic no es correcte.";	}
		}
		printResult ("spanResultEnviar", result);
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	envAmigoN2(frm);
}

function compEnviarCine(frm, idi, a){
    printResult ("spanResultEnviar", "");
    frm.mens.style.border="solid #E8E7DB 1px";
    frm.email2.style.border="solid #E8E7DB 1px";
    frm.nombre2.style.border="solid #E8E7DB 1px";
    var msgEma4 = "", msgEma3 = "", msgCom = "", msgEma2 = "", msgNom2 = "", msgEma = "", msgNom = "", result = "";
    var retorno = true;
    var cont = 0;
    if (isWhitespace(frm.email2.value)){
        if (idi=="es"){    msgEma2 = " e-mail de tu amigo";    }else{    msgEma2 = " e-mail del teu amic";    }
        frm.email2.style.border="solid #9C1F2E 1px";
        frm.email2.select();
        frm.email2.focus();
        cont++;
        retorno = false;
    }
    var str = frm.email2.value;
    var x;
    var arr;
    arr = str.split(",");
    if (msgEma2=="")
    {
        if (arr[1])
        {
            for (x in arr)
            {
                if (!validarEmail(arr[x]))
                {
                    if (idi=="es"){    msgEma4 = " e-mail";    }else{    msgEma4 = " e-mail";    }
                    frm.email2.style.border="solid #9C1F2E 1px";
                    frm.email2.select();
                    frm.email2.focus();
                    cont++;
                    retorno = false;
                }
            }
        }
    }
    if (retorno==false){
        if ((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!="")||(msgCom!="")){
            if (idi=="es"){
                if (cont==1){    result = "Informa el campo";    }else{    result = "Informa los campos";    }
            }else{
                if (cont==1){    result = "Informi el camp";    }else{    result = "Informi els camps";    }
            }
            result = result + msgNom;
            if ((msgNom!="")&&(msgEma!="")){    result = result + ",";    }
            result = result + msgEma;
            if (((msgNom!="")||(msgEma!=""))&&(msgNom2!="")){    result = result + ",";    }
            result = result + msgNom2;
            if (((msgNom!="")||(msgEma!="")||(msgNom2!=""))&&(msgEma2!="")){    result = result + ",";    }
            result = result + msgEma2;
            if (((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!=""))&&(msgCom!="")){    result = result + ",";    }
            result = result + msgCom;
            result = result + ".";
        }
        if (msgEma3!=""){
            result = result + "<br />";
            if (idi=="es"){    result = result + "Tu e-mail no es correcto.";    }else{    result = result + "El teu e-mail no es correcte.";    }
        }
        if (msgEma4!=""){
            result = result + "<br />";
            if (idi=="es"){    result = result + "El e-mail de tu amigo no es correcto.";    }else{    result = result + "L'e-mail del teu amic no es correcte.";    }
        }
        printResult ("spanResultEnviar", result);
        if (a==false){
            return;
        }else{
            return false;
        }
    }
    envAmigoCine(frm);
}
function compEnviarCineN(frm, idi, a){
    printResult ("spanResultEnviar", "");
    frm.mens.style.border="solid #E8E7DB 1px";
    frm.email2.style.border="solid #E8E7DB 1px";
    frm.nombre2.style.border="solid #E8E7DB 1px";
    var msgEma4 = "", msgEma3 = "", msgCom = "", msgEma2 = "", msgNom2 = "", msgEma = "", msgNom = "", result = "";
    var retorno = true;
    var cont = 0;
	if (isWhitespace(frm.email2.value) || (idi=="es" && frm.email2.value=="E-mail de tu amigo") || (idi=="cat" && frm.email2.value=="E-mail del teu amic")){
        if (idi=="es"){    msgEma2 = " e-mail de tu amigo";    }else{    msgEma2 = " e-mail del teu amic";    }
        frm.email2.style.border="solid #9C1F2E 1px";
        frm.email2.select();
        frm.email2.focus();
        cont++;
        retorno = false;
    }
    var str = frm.email2.value;
    var x;
    var arr;
    arr = str.split(",");
    if (msgEma2=="")
    {
        if (arr[1])
        {
            for (x in arr)
            {
                if (!validarEmail(arr[x]))
                {
                    if (idi=="es"){    msgEma4 = " e-mail";    }else{    msgEma4 = " e-mail";    }
                    frm.email2.style.border="solid #9C1F2E 1px";
                    frm.email2.select();
                    frm.email2.focus();
                    cont++;
                    retorno = false;
                }
            }
        }
    }
    if (retorno==false){
        if ((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!="")||(msgCom!="")){
            if (idi=="es"){
                if (cont==1){    result = "Informa el campo";    }else{    result = "Informa los campos";    }
            }else{
                if (cont==1){    result = "Informi el camp";    }else{    result = "Informi els camps";    }
            }
            result = result + msgNom;
            if ((msgNom!="")&&(msgEma!="")){    result = result + ",";    }
            result = result + msgEma;
            if (((msgNom!="")||(msgEma!=""))&&(msgNom2!="")){    result = result + ",";    }
            result = result + msgNom2;
            if (((msgNom!="")||(msgEma!="")||(msgNom2!=""))&&(msgEma2!="")){    result = result + ",";    }
            result = result + msgEma2;
            if (((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!=""))&&(msgCom!="")){    result = result + ",";    }
            result = result + msgCom;
            result = result + ".";
        }
        if (msgEma3!=""){
            result = result + "<br />";
            if (idi=="es"){    result = result + "Tu e-mail no es correcto.";    }else{    result = result + "El teu e-mail no es correcte.";    }
        }
        if (msgEma4!=""){
            result = result + "<br />";
            if (idi=="es"){    result = result + "El e-mail de tu amigo no es correcto.";    }else{    result = result + "L'e-mail del teu amic no es correcte.";    }
        }
        printResult ("spanResultEnviar", result);
        if (a==false){
            return;
        }else{
            return false;
        }
    }
    envAmigoCine(frm);
}

function getSubNoti(opt, iddoc){
	if (opt!="T"){
		if (document.getElementById('notiTit')){
			document.getElementById('notiTit').style.display = 'none';
		}
	}
	if (opt!="G"){
		if (document.getElementById('notiGraf')){
			document.getElementById('notiGraf').style.display = 'none';
		}
	}
	switch (opt){
		case 'F':
			document.getElementById('notiEnv').style.display = 'none';
			document.getElementById('notiMene').style.display = 'none';
			if (document.getElementById('notiComen')){
				document.getElementById('notiComen').style.display = 'none';
			}
			document.getElementById('notiAudio').style.display = 'none';
			if (iddoc){
				document.getElementById('notiVideo'+iddoc).style.display = 'none';
				document.getElementById('notiFoto'+iddoc).style.display = 'inline';
			}else{
				document.getElementById('notiVideo').style.display = 'none';
				document.getElementById('notiFoto').style.display = 'inline';
			}
			break;
		case 'A':
			document.getElementById('notiFoto').style.display = 'none';
			document.getElementById('notiVideo').style.display = 'none';
			document.getElementById('notiEnv').style.display = 'none';
			document.getElementById('notiMene').style.display = 'none';
			document.getElementById('notiComen').style.display = 'none';
			document.getElementById('notiAudio').style.display = 'inline';
			break;
		case 'V':
			document.getElementById('notiEnv').style.display = 'none';
			document.getElementById('notiMene').style.display = 'none';
			if (document.getElementById('notiComen')){
				document.getElementById('notiComen').style.display = 'none';
			}
			document.getElementById('notiAudio').style.display = 'none';
			if (iddoc){
				document.getElementById('notiFoto'+iddoc).style.display = 'none';
				document.getElementById('notiVideo'+iddoc).style.display = 'inline';
			}else{
				document.getElementById('notiFoto').style.display = 'none';
				document.getElementById('notiVideo').style.display = 'inline';
			}
			break;
		case 'E':
			document.getElementById('notiFoto').style.display = 'none';
			document.getElementById('notiAudio').style.display = 'none';
			document.getElementById('notiVideo').style.display = 'none';
			document.getElementById('notiMene').style.display = 'none';
			document.getElementById('notiComen').style.display = 'none';
			document.getElementById('notiEnv').style.display = 'inline';
			break;
		case 'C':
			document.getElementById('notiFoto').style.display = 'none';
			document.getElementById('notiAudio').style.display = 'none';
			document.getElementById('notiVideo').style.display = 'none';
			document.getElementById('notiMene').style.display = 'none';
			document.getElementById('notiEnv').style.display = 'none';
			document.getElementById('notiComen').style.display = 'inline';
			break;
		case 'M':
			document.getElementById('notiFoto').style.display = 'none';
			document.getElementById('notiAudio').style.display = 'none';
			document.getElementById('notiVideo').style.display = 'none';
			document.getElementById('notiEnv').style.display = 'none';
			document.getElementById('notiComen').style.display = 'none';
			document.getElementById('notiMene').style.display = 'inline';
			getVotar (iddoc);
			break;
		case 'G':
			document.getElementById('notiFoto').style.display = 'none';
			document.getElementById('notiAudio').style.display = 'none';
			document.getElementById('notiVideo').style.display = 'none';
			document.getElementById('notiEnv').style.display = 'none';
			document.getElementById('notiComen').style.display = 'none';
			document.getElementById('notiMene').style.display = 'none';
			document.getElementById('notiGraf').style.display = 'inline';
//			getVotar (iddoc);
			break;
		case 'T':
			document.getElementById('notiFoto').style.display = 'none';
			document.getElementById('notiAudio').style.display = 'none';
			document.getElementById('notiVideo').style.display = 'none';
			document.getElementById('notiEnv').style.display = 'none';
			document.getElementById('notiComen').style.display = 'none';
			document.getElementById('notiMene').style.display = 'none';
			document.getElementById('notiTit').style.display = 'inline';
			break;
	}
}
function closeSubNoti (opt){
	if (opt){
		document.getElementById('notiFoto'+opt).style.display = 'none';
		document.getElementById('notiVideo'+opt).style.display = 'none';
	}else{
		document.getElementById('notiFoto').style.display = 'none';
		document.getElementById('notiVideo').style.display = 'none';
	}
	document.getElementById('notiAudio').style.display = 'none';
	document.getElementById('notiEnv').style.display = 'none';
	if (document.getElementById('notiComen')){
		document.getElementById('notiComen').style.display = 'none';
	}
	document.getElementById('notiMene').style.display = 'none';
	if (document.getElementById('notiGraf')){
		document.getElementById('notiGraf').style.display = 'none';
	}
	if (document.getElementById('notiTit')){
		document.getElementById('notiTit').style.display = 'none';
	}
//	document.getElementById(opt).style.display = 'none';
}
function closeBusc (){
	document.getElementById('notiBusc').style.display = 'none';
}
function getBusc (){
	document.getElementById('notiBusc').style.display = 'inline';
}
function getImgGaleria(obj, cat, opt){
    if (opt){
        document.getElementById('idImgGaleria'+opt).src = obj.src;
        document.getElementById('idImgGaleria'+opt).alt = obj.alt;
        document.getElementById('idImgGaleria'+opt).title = obj.title;
        if (document.getElementById('descImgGaleria'+opt)){
            var str = obj.alt;
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            if (cat!=""){
                document.getElementById('descImgGaleria'+opt).innerHTML = '<strong>' + cat + ': </strong>' + str;
            }else{
                document.getElementById('descImgGaleria'+opt).innerHTML = str;
            }
        }
    }else{
        document.getElementById('idImgGaleria').src = obj.src;
        document.getElementById('idImgGaleria').alt = obj.alt;
        document.getElementById('idImgGaleria').title = obj.title;
        if (document.getElementById('descImgGaleria')){
            var str = obj.alt;
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            if (cat!=""){
                document.getElementById('descImgGaleria').innerHTML = '<strong>' + cat + ': </strong>' + str;
            }else{
                document.getElementById('descImgGaleria').innerHTML = str;
            }
        }
    }
}
function getImgGaleriaN(obj, alt, tip, cat, opt, idv){
	document.getElementById('caja_contenedora').style.height = alt+"px";
	if (tip=="img"){
		document.getElementById('idVidGaleria').style.display = "none";
		document.getElementById('idImgGaleria').style.display = "";
		document.getElementById('descImgGaleria').style.display = "";
		document.getElementById('473').style.backgroundColor = "#FBFAF5";
	}else{
		document.getElementById('descImgGaleria').style.display = "none";
		if(document.getElementById('idImgGaleria')){
			document.getElementById('idImgGaleria').style.display = "none";
		}
		if(document.getElementById('idVidGaleria')){
			document.getElementById('idVidGaleria').style.display = "";
		}
		
		//alert(idv+" - "+idv_act);
		if (idv_act!=""){
			document.getElementById('idvid'+idv_act).style.display = "none";
		}

		document.getElementById('idvid'+idv).style.display = "";
		idv_act = idv
		document.getElementById('473').style.backgroundColor = "#FFFFFF";
	}

	document.getElementById('descImgGaleria').style.marginTop = (alt-44)+"px";
    if (opt){
        document.getElementById('idImgGaleria'+opt).src = obj.src;
        document.getElementById('idImgGaleria'+opt).alt = obj.alt;
        document.getElementById('idImgGaleria'+opt).title = obj.title;
        if (document.getElementById('descImgGaleria'+opt)){
            var str = obj.alt;
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            if (cat!=""){
                document.getElementById('descImgGaleria'+opt).innerHTML = str;
            }else{
                document.getElementById('descImgGaleria'+opt).innerHTML = str;
            }
        }
    }else{
		if(obj){
        document.getElementById('idImgGaleria').src = obj.src;
        document.getElementById('idImgGaleria').alt = obj.alt;
        document.getElementById('idImgGaleria').title = obj.title;
        if (document.getElementById('descImgGaleria')){
            var str = obj.alt;
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            if (cat!=""){
                document.getElementById('descImgGaleria').innerHTML = str;
            }else{
                document.getElementById('descImgGaleria').innerHTML = str;
            }
        }
		}
    }
}
function getImgGaleria2(obj, cat, opt, url, txt){
    if (opt){
        document.getElementById('idImgGaleria'+opt).src = obj.src;
        document.getElementById('idImgGaleria'+opt).alt = obj.alt;
        document.getElementById('idImgGaleria'+opt).title = obj.title;
        document.getElementById('idHrefGaleria'+opt).href = url;
        document.getElementById('idEnlTit'+opt).innerHTML = txt;
        document.getElementById('idEnlTit'+opt).href = url;
        if (document.getElementById('descImgGaleria'+opt)){
            var str = obj.alt;
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            
            //str = '<a class="enl_titular_noticia" style="font-size:12px;" href="' + url + '">' + txt + '</a>' + str;
            if (cat!=""){
                document.getElementById('descImgGaleria'+opt).innerHTML = '<strong>' + cat + ': </strong>' + str;
            }else{
                document.getElementById('descImgGaleria'+opt).innerHTML = str;
            }
        }
    }else{
        document.getElementById('idImgGaleria').src = obj.src;
        document.getElementById('idImgGaleria').alt = obj.alt;
        document.getElementById('idImgGaleria').title = obj.title;
        document.getElementById('idHrefGaleria').href = url;
        document.getElementById('idEnlTit').innerHTML = txt;
        document.getElementById('idEnlTit').href = url;
        if (document.getElementById('descImgGaleria')){
            var str = obj.alt;
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            str = str.replace('\\\'', '"');
            
            //str = '<a class="enl_titular_noticia" style="font-size:12px;" href="' + url + '">' + txt + '</a>' + str;
            if (cat!=""){
                if (cat){
                document.getElementById('descImgGaleria').innerHTML = '<strong>' + cat + ': </strong>' + str;
                }
            }else{
                document.getElementById('descImgGaleria').innerHTML = str;
            }
        }
    }
}
function compUsuario(frm, tipo, id, a, conf){
	var retorno;
	var usu = true;
	var pw = true;
	var error = '';
	if (tipo=="2"){
		frm.pw.style.border="solid #E8E7DB 1px";
		frm.usu.style.border="solid #E8E7DB 1px";
	}
	if (tipo=="2"){
		document.getElementById('myspanResultUsu2').innerHTML = '';
	}else{
		document.getElementById('myspanResultUsu').innerHTML = '';
	}
	if (isWhitespace(frm.pw.value) || frm.pw.value=="Pass"){
		frm.pw.select();
		frm.pw.focus();
		cont++;
		retorno = false;
		if (tipo=="2"){
			frm.pw.style.border="solid #9C1F2E 1px";
			pw = false;
		}
	}
	if (isWhitespace(frm.usu.value) || frm.usu.value=="User"){
		frm.usu.select();
		frm.usu.focus();
		cont++;
		retorno = false;
		if (tipo=="2"){
			frm.usu.style.border="solid #9C1F2E 1px";
			usu = false;
		}
	}
	if (retorno==false)
	{
		if (tipo=="2"){
			if (usu==false)
			{
				if (id=="es"){
					error = 'Informe el usuario.';
				}else{
					error = "Informi l'usuari.";
				}
			}else if (pw==false){
				if (id=="es"){
					error = 'Informe la contraseña.';
				}else{
					error = "Informi la contrasenya.";
				}
			}else{
				error = 'Error.';
			}
			document.getElementById('myspanResultUsu2').innerHTML = '<span style="color:#9C1F2E;">' + error + '</span>';
		}else{
			document.getElementById('myspanResultUsu').innerHTML = '<span style="color:#9C1F2E;">Error</span>';
		}
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	if (tipo=="2"){
		envUsuario(frm, '2', conf);
	}else{
		envUsuario(frm, '', conf);
	}
	if (a==false){
		return;
	}else{
		return false;
	}
}
function compAltaUsuario(frm, idi, a){
	printResult ("spanResultUsuario", "");
	frm.usuario.style.border="solid #E8E7DB 1px";
	frm.pw.style.border="solid #E8E7DB 1px";
	frm.pw2.style.border="solid #E8E7DB 1px";
	frm.mail.style.border="solid #E8E7DB 1px";
	frm.mail2.style.border="solid #E8E7DB 1px";
	frm.movil.style.border="solid #E8E7DB 1px";
	
	var dif_cont = false;
	var dif_mail = false;
	var	dif_mov = false;
	var retorno = true;
	var usu_exp = false;
	
	var ret_cont = "";
	var ret_mail = "";
	var ret_mov = "";
	
	if (isWhitespace(frm.movil.value)){
		frm.movil.style.border="solid #9C1F2E 1px";
		frm.movil.select();
		frm.movil.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.mail2.value)){
		frm.mail2.style.border="solid #9C1F2E 1px";
		frm.mail2.select();
		frm.mail2.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.mail.value)){
		frm.mail.style.border="solid #9C1F2E 1px";
		frm.mail.select();
		frm.mail.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.pw2.value)){
		frm.pw2.style.border="solid #9C1F2E 1px";
		frm.pw2.select();
		frm.pw2.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.pw.value)){
		frm.pw.style.border="solid #9C1F2E 1px";
		frm.pw.select();
		frm.pw.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.usuario.value)){
		frm.usuario.style.border="solid #9C1F2E 1px";
		frm.usuario.select();
		frm.usuario.focus();
		cont++;
		retorno = false;
	}
	if (retorno!=false)
	{
		if (!IsNum(frm.movil.value))
		{
			frm.movil.style.border="solid #9C1F2E 1px";
			frm.movil.select();
			frm.movil.focus();
			retorno = false;
			dif_mov = "1";
		}
		if ((frm.movil.value < 100000000)||(frm.movil.value >= 1000000000))
		{
			frm.movil.style.border="solid #9C1F2E 1px";
			frm.movil.select();
			frm.movil.focus();
			retorno = false;
			if (dif_mov==false){
				dif_mov = "2";
			}else{
				dif_mov = dif_mov + "2";
			}
		}
		var er_tlfono = /^6[0-9]{8}$/;
		if(!er_tlfono.test(frm.movil.value)) {
			if (dif_mov==false){
				dif_mov = "3";
			}else{
				dif_mov = dif_mov + "3";
			}
			retorno = false;
		}
		if (!validarEmail(frm.mail2.value))
		{
			frm.mail2.style.border="solid #9C1F2E 1px";
			frm.mail2.select();
			frm.mail2.focus();
			retorno = false;
			dif_mail = "2";
		}
		if (!validarEmail(frm.mail.value))
		{
			frm.mail.style.border="solid #9C1F2E 1px";
			frm.mail.select();
			frm.mail.focus();
			retorno = false;
			dif_mail = dif_mail + "1";
		}
		if (dif_mail==false)
		{
			if ((frm.mail.value!=frm.mail2.value)){
				frm.mail2.value = '';
				frm.mail.style.border="solid #9C1F2E 1px";
				frm.mail2.style.border="solid #9C1F2E 1px";
				frm.mail.select();
				frm.mail.focus();
				cont++;
				retorno = false;
				dif_mail = dif_mail + "3";
			}
		}
		if ((frm.pw.value!=frm.pw2.value)){
			frm.pw.value = '';
			frm.pw2.value = '';
			frm.pw.style.border="solid #9C1F2E 1px";
			frm.pw2.style.border="solid #9C1F2E 1px";
			frm.pw.select();
			frm.pw.focus();
			cont++;
			retorno = false;
			dif_cont = true;
		}
		var er_usu = /^[a-zA-Z0-9_]{5,15}$/;
		if(!er_usu.test(frm.usuario.value)) {
			frm.usuario.style.border="solid #9C1F2E 1px";
			frm.usuario.select();
			frm.usuario.focus();
			cont++;
			retorno = false;
			usu_exp =true;
		}
	}
	if (retorno==false){
		if (usu_exp == true)
		{
			if (idi=="es"){	ret_usuexp = "El nombre de usuario no es correcto, debe estar entre 5 y 15 caracteres.<br />Además solo se aceptan letras (A-Z) y números (0-9), sin acentos ni espacios.";	}else{	ret_usuexp = "El nom d'usuari no és correcte, ha d'estar entre 5 i 15 caràcters.<br />A més sol s'accepten lletres (A-Z) i nombres (0-9), sense accents ni espais";	}
		}
		if (dif_cont == true){
			if (idi=="es"){	ret_cont = "Las contraseñas no son iguales.";	}else{	ret_cont = "Les contrasenyes no son iguals.";	}
		}
		if (dif_mail == "2"){
			if (idi=="es"){	ret_mail = "El e-mail no es correcto.";	}else{	ret_mail = "L'e-mail no es correcte.";	}
		}
		if (dif_mail == "1"){
			if (idi=="es"){	ret_mail = "El e-mail no es correcto.";	}else{	ret_mail = "L'e-mail no es correcte.";	}
		}
		if (dif_mail == "21"){
			if (idi=="es"){	ret_mail = "Els e-mails no son correctos.";	}else{	ret_mail = "Els e-mails no son correctes.";	}
		}
		if (dif_mail == "3"){
			if (idi=="es"){	ret_mail = "Els e-mails no son iguales.";	}else{	ret_mail = "Els e-mails no son iguals.";	}
		}
		if ((dif_mov == "1")||(dif_mov == "12")||(dif_mov == "13")||(dif_mov == "123")){
			if (idi=="es"){	ret_mov = "El móvil no es correcto.";	}else{	ret_mov = "El mòbil no es correcte.";	}
		}
		if ((dif_mov == "2")||(dif_mov == "23")){
			if (idi=="es"){	ret_mov = "El móvil es de 9 dígitos.";	}else{	ret_mov = "El mòbil es de 9 dígits.";	}
		}
		if (dif_mov == "3"){
			if (idi=="es"){	ret_mov = "El número de móvil no es correcto. El formato correcto es el número de teléfono sin espacios, guiones, ni puntos. Ejemplo 666666666";	}else{	ret_mov = "El número de mòbil no es correcte. El format correcte és el nombre de telèfon sense espais, guions, ni punts. Exemple 666666666";	}
		}
		if ((dif_cont == true)||(dif_mail != false)||(dif_mov != false)){
			printResult ("spanResultUsuario", ret_cont + " " + ret_mail + " " + ret_mov);
		}else{
			if (usu_exp==true){
				printResult ("spanResultUsuario", ret_usuexp);
			}else{
				if (idi=="es"){	printResult ("spanResultUsuario", "Informa todos los campos ");	}else{	printResult ("spanResultUsuario", "Informi tots els camps ");	}
			}
		}
		
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	if (frm.privacidad.checked != true)
	{
		if (idi=="es"){	printResult ("spanResultUsuario", "Acepta las condiciones.");	}else{	printResult ("spanResultUsuario", "Accepta les condicions.");	}
		return false;
	}
	if (a==false){
		frm.submit();
	}else{
		return true;
	}
//	envAltaUsuario(frm);
//	return false;
}
function compConfUsuario(frm, idi, a){
	printResult ("spanResultUsuario", "");
	frm.cod_mov.style.border="solid #E8E7DB 1px";
	
	if (isWhitespace(frm.cod_mov.value)){
		frm.cod_mov.style.border="solid #9C1F2E 1px";
		frm.cod_mov.select();
		frm.cod_mov.focus();
		if (idi="es"){
			printResult ("spanResultUsuario", "Informa el código de confirmación.");
		}else{
			printResult ("spanResultUsuario", "Informa el código de confirmación.");
		}
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	if (a==false)
	{
	}else{
		frm.submit();
	}
	
}
function overPregList(obj){
//	obj.style.backgroundColor='#E7E6DA';
	obj.style.backgroundColor='#E8E5CE';
	obj.style.cursor = 'pointer';
}
function outPregList(obj){
	obj.style.backgroundColor='#FAF8EF';
}
function overEditList(obj){
//	obj.style.backgroundColor='#E7E6DA';
	obj.style.cursor = 'pointer';
}
function outEditList(obj){
//	obj.style.backgroundColor='#FAF8EF';
}

function compCambCont(frm, idi, a){
	printResult ("spanCambioContras", "");
	frm.nueva.style.border="solid #E8E7DB 1px";
	frm.nueva2.style.border="solid #E8E7DB 1px";
	var alerta = false;
	var alerta2 = false;
	if (frm.nueva.value!=frm.nueva2.value)
	{
		frm.nueva2.style.border="solid #9C1F2E 1px";
		frm.nueva2.select();
		frm.nueva2.focus();
		alerta2 = true;
	}
	if (isWhitespace(frm.nueva2.value)){
		frm.nueva2.style.border="solid #9C1F2E 1px";
		frm.nueva2.select();
		frm.nueva2.focus();
		alerta = true;
	}
	if (isWhitespace(frm.nueva.value)){
		frm.nueva.style.border="solid #9C1F2E 1px";
		frm.nueva.select();
		frm.nueva.focus();
		alerta = true;
	}
	if (alerta){
		if (idi=="es"){
			printResult ("spanCambioContras", "Informa todos los campos.");
		}else{
			printResult ("spanCambioContras", "Informi tots els camps.");
		}
		if (a==false){
			return;
		}else{
			return false;
		}
	}else{
		if (alerta2){
			if (idi=="es"){
				printResult ("spanCambioContras", "Las contraseñas no son iguales.");
			}else{
				printResult ("spanCambioContras", "Les contrasenyes no son iguals.");
			}
			if (a==false){
				return;
			}else{
				return false;
			}
		}
	}
	cambCont (frm);
}
function compCambEmail(frm, idi, a){
	printResult ("spanCambioEmail", "");
	frm.nueva.style.border="solid #E8E7DB 1px";
	frm.nueva2.style.border="solid #E8E7DB 1px";
	
	if (isWhitespace(frm.nueva.value)){
		frm.nueva.style.border="solid #9C1F2E 1px";
		frm.nueva.select();
		frm.nueva.focus();
		if (idi=="es"){
			printResult ("spanCambioEmail", "Informe del nuevo e-mail.");
		}else{
			printResult ("spanCambioEmail", "Informi del nou e-mail.");
		}
		if (a==false){ return; }else{ return false; }
	}
	if (!validarEmail(frm.nueva.value))
	{
		frm.nueva.style.border="solid #9C1F2E 1px";
		frm.nueva.select();
		frm.nueva.focus();
		if (idi=="es"){
			printResult ("spanCambioEmail", "El e-mail no es correcto.");
		}else{
			printResult ("spanCambioEmail", "L'e-mail no es correcte.");
		}
		if (a==false){ return; }else{ return false; }
	}
	if (isWhitespace(frm.nueva2.value)){
		frm.nueva2.style.border="solid #9C1F2E 1px";
		frm.nueva2.select();
		frm.nueva2.focus();
		if (idi=="es"){
			printResult ("spanCambioEmail", "Repite el e-mail.");
		}else{
			printResult ("spanCambioEmail", "Repeteix l'e-mail.");
		}
		if (a==false){ return; }else{ return false; }
	}
	if (frm.nueva.value!=frm.nueva2.value)
	{
		frm.nueva2.style.border="solid #9C1F2E 1px";
		frm.nueva2.select();
		frm.nueva2.focus();
		if (idi=="es"){
			printResult ("spanCambioEmail", "Los e-mails no son iguales.");
		}else{
			printResult ("spanCambioEmail", "Els e-mails no son iguals.");
		}
		if (a==false){ return; }else{ return false; }
	}
/*	
	var alerta = false;
	var alerta2 = false;
	if (frm.nueva.value!=frm.nueva2.value)
	{
		frm.nueva2.style.border="solid #9C1F2E 1px";
		frm.nueva2.select();
		frm.nueva2.focus();
		alerta2 = true;
	}
	if (isWhitespace(frm.nueva2.value)){
		frm.nueva2.style.border="solid #9C1F2E 1px";
		frm.nueva2.select();
		frm.nueva2.focus();
		alerta = true;
	}
	if (alerta){
		if (idi=="es"){
			printResult ("spanCambioEmail", "Informa todos los campos.");
		}else{
			printResult ("spanCambioEmail", "Informi tots els camps.");
		}
		if (a==false){
			return;
		}else{
			return false;
		}
	}else{
		if (alerta2){
			if (idi=="es"){
				printResult ("spanCambioEmail", "Los e-mails no son iguales.");
			}else{
				printResult ("spanCambioEmail", "Els e-mails no son iguals.");
			}
			if (a==false){
				return;
			}else{
				return false;
			}
		}
	}*/
	cambEmail (frm);
}
function compDatosUsu(frm, idi, a){
	printResult ("spanDatosUsua", "");
	frm.nom.style.border="solid #E8E7DB 1px";
	//frm.ape.style.border="solid #E8E7DB 1px";
	//frm.ape2.style.border="solid #E8E7DB 1px";
	frm.ape3.style.border="solid #E8E7DB 1px";
	frm.mai.style.border="solid #E8E7DB 1px";
	frm.cp.style.border="solid #E8E7DB 1px";
	frm.dir.style.border="solid #E8E7DB 1px";
	frm.pai.style.border="solid #E8E7DB 1px";
	frm.pro.style.border="solid #E8E7DB 1px";
	frm.pob.style.border="solid #E8E7DB 1px";
	if (frm.cp.value!=""){
		if (IsNum(frm.cp.value)==false){
			frm.cp.style.border="solid #9C1F2E 1px";
			if (idi=="es"){
				printResult ("spanDatosUsua", "El Código Postal no es correcto");
			}else{
				printResult ("spanDatosUsua", "El Codi Postal no es correcte");
			}
			if (a==false){
				return;
			}else{
				return false;
			}
		}
	}
	envDatosUsu(frm, idi);
}
function compBlog(frm, idi, a){
	frm.usua.style.border="solid #E8E7DB 1px";
	frm.blog.style.border="solid #E8E7DB 1px";
	frm.urlblog.style.border="solid #E8E7DB 1px";
	if (isWhitespace(frm.usua.value)){
		printResult ("myspanBlog", "");
		frm.usua.style.border="solid #9C1F2E 1px";
		frm.usua.select();
		frm.usua.focus();
		if (idi=="es"){
			printResult ("myspanBlog", "Informe el usuario de Blog.");
		}else{
			printResult ("myspanBlog", "Informi el usuari de Blog.");
		}
		if (a==false){ return; }else{ return false; }
	}
//	alert (document.getElementById('zisponibilityUserBox').innerHTML);
	if (((document.getElementById('zisponibilityUserBox').innerHTML!='<b style="color: rgb(0, 221, 0);">Nom d\'usuari disponible</b>')||(document.getElementById('zisponibilityUserBox').innerHTML!='<b style="color: rgb(0, 221, 0);">Nombre de usuario disponible</b>'))||((document.getElementById('zisponibilityUserBox').innerHTML!='<B style="COLOR: #00dd00;">Nom d\'usuari disponible</B>')||(document.getElementById('zisponibilityUserBox').innerHTML!='<B style="COLOR: #00dd00;">Nombre de usuario disponible</B>')))
	{
	}else{
		alert("Entra 3");
		printResult ("myspanBlog", "");
		frm.usua.style.border="solid #9C1F2E 1px";
		frm.usua.select();
		frm.usua.focus();
		if (idi=="es"){
			printResult ("myspanBlog", '<span class="texto_rojo" style="color: rgb(156, 31, 46);">El nombre de usuario no se encuentra disponible.</span>');
		}else{
			printResult ("myspanBlog", '<span class="texto_rojo" style="color: rgb(156, 31, 46);">El nom d\'usuari no es troba disponible.</span>');
		}
		if (a==false){ return; }else{ return false; }
/*		}else{
			printResult ("myspanBlog", "");
			frm.usua.style.border="solid #9C1F2E 1px";
			frm.usua.select();
			frm.usua.focus();
			if (idi=="es"){
				printResult ("myspanBlog", '<span class="texto_rojo" style="color: rgb(156, 31, 46);">El nombre de usuario no se encuentra disponible.</span>');
			}else{
				printResult ("myspanBlog", '<span class="texto_rojo" style="color: rgb(156, 31, 46);">El nom d\'usuari no es troba disponible.</span>');
			}
			if (a==false){ return; }else{ return false; }
		}*/
	}
	
	if (isWhitespace(frm.blog.value)){
		printResult ("myspanBlog", "");
		frm.blog.style.border="solid #9C1F2E 1px";
		frm.blog.select();
		frm.blog.focus();
		if (idi=="es"){
			printResult ("myspanBlog", "Informe el nombre del Blog.");
		}else{
			printResult ("myspanBlog", "Informi el nom del Blog.");
		}
		if (a==false){ return; }else{ return false; }
	}
	if (isWhitespace(frm.urlblog.value)){
		printResult ("myspanBlog", "");
		frm.blog.style.border="solid #9C1F2E 1px";
		frm.blog.select();
		frm.blog.focus();
		if (idi=="es"){
			printResult ("myspanBlog", "Informe el nombre del Blog.");
		}else{
			printResult ("myspanBlog", "Informi el nom del Blog.");
		}
		if (a==false){ return; }else{ return false; }
	}
	/*if ((document.getElementById('zisponibilityUrlBlog').innerHTML!='<b style="color: rgb(0, 221, 0);">Blog disponible.</b>')&&(document.getElementById('zisponibilityUrlBlog').innerHTML!='<b style="color: rgb(0, 221, 0);">Blog disponible.</b>')||(document.getElementById('zisponibilityUrlBlog').innerHTML!='<b style="color: rgb(0, 221, 0);">Blog disponible.</b>')&&(document.getElementById('zisponibilityUrlBlog').innerHTML!='<b style="color: rgb(0, 221, 0);">Blog disponible.</b>'))
	{
	}else{*/
//	alert (document.getElementById('zisponibilityUrlBlog').innerHTML);
//<b style="color: rgb(0, 221, 0)">Bloc disponible.</b>
	if ((document.getElementById('zisponibilityUrlBlog').innerHTML!='<b style="color: rgb(0, 221, 0)">Blog disponible.</b>')&&(document.getElementById('zisponibilityUrlBlog').innerHTML!='<b style="color: rgb(0, 221, 0)">Bloc disponible.</b>')&&(document.getElementById('zisponibilityUrlBlog').innerHTML!='<B style="COLOR: rgb(0,221,0)">Bloc disponible.</B>')){
//		alert(document.getElementById('zisponibilityUrlBlog').innerHTML);
		printResult ("myspanBlog", "");
		frm.blog.style.border="solid #9C1F2E 1px";
		frm.blog.select();
		frm.blog.focus();
		if (idi=="es"){
			printResult ("myspanBlog", '<span class="texto_rojo" style="color: rgb(156, 31, 46);">Este blog no se encuentra disponible.</span>');
		}else{
			printResult ("myspanBlog", '<span class="texto_rojo" style="color: rgb(156, 31, 46);">Aquest bloc no es troba disponible.</span>');
		}
		if (a==false){ return; }else{ return false; }
	}
	envBlog(frm, idi);
	if (a==false){ return; }else{ return false; }
}
function compPais(pai){
	if (pai=="70"){
		document.getElementById('pro').disabled = false;
	}else{
		document.getElementById('pro').disabled = true;
	}
}
function getLoMas(opt){
//	document.getElementById('myspanLomasCabeUlt').style.display = 'none';
	document.getElementById('myspanLomasCabeCom').style.display = 'none';
	document.getElementById('myspanLomasCabeVis').style.display = 'none';
	document.getElementById('myspanLomasCabeEnv').style.display = 'none';
	
//	document.getElementById('myspanLomasUlt').style.display = 'none';
	document.getElementById('myspanLomasCom').style.display = 'none';
	document.getElementById('myspanLomasVis').style.display = 'none';
	document.getElementById('myspanLomasEnv').style.display = 'none';
/*	if (opt=="ulti"){
		document.getElementById('myspanLomasUlt').style.display = 'inline';
		document.getElementById('myspanLomasCabeUlt').style.display = 'inline';
	}else */if (opt=="come"){
		document.getElementById('myspanLomasCabeCom').style.display = 'inline';
		document.getElementById('myspanLomasCom').style.display = 'inline';
	}else if (opt=="vist"){
		document.getElementById('myspanLomasCabeVis').style.display = 'inline';
		document.getElementById('myspanLomasVis').style.display = 'inline';
	}else if (opt=="envi"){
		document.getElementById('myspanLomasCabeEnv').style.display = 'inline';
		document.getElementById('myspanLomasEnv').style.display = 'inline';
	}
}
function enviar(opt, url_art, idi){
	var url="";
	switch (opt)
	{
		case 'meneame':
			url = "http://meneame.net/login.php?return=/submit.php?url=http://" + url_art;
		break;
		case 'digg':
			url = "http://digg.com/submit?phase=2&url=http://" + url_art;
		break;
		case 'delicious':
			url = "https://secure.del.icio.us/login?url=http://" + url_art;
		break;
		case 'barra':
		case 'barrapunto':
			url = "http://barrapunto.com/submit.pl?story=http://" + url_art;
		break;
		case 'blink':
		case 'blinklist':
			url = "http://es.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://" + url_art;
		break;
		case 'fresqui':
			url = "http://tec.fresqui.com/post?url=http://" + url_art;
		break;
        case 'tafanera':
            url = "http://latafanera.cat/submit.php?url=http://" + url_art;
        break;
        case 'facebook':
            if (idi=="es"){
                url = "http://www.facebook.com/sharer.php?u=http://" + url_art + "&title=e-noticies.es";
            }else{
                url = "http://www.facebook.com/sharer.php?u=http://" + url_art + "&title=e-noticies.cat";
            }
        break;
        case 'twitter':
            if (idi=="es"){
                url = "http://twitter.com/home/?status=http://" + url_art + "&title=e-noticies.es";
            }else{
                url = "http://twitter.com/home/?status=http://" + url_art + "&title=e-noticies.cat";
            }
        break;
	}
	var pop = window.open(url);
	popup.focus();
}
function playMovie(file, urlimagen, w, h) {                                     
	var urltv = "http://www.e-noticies.com/swf/flvplayer.swf";
//	alert (urltv);
//	var urlimagen = file.replace("flv", "jpg");
    //var h_big = 0 + h + 42;
	var h_big = h;
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + w + '" height="' + h_big + '" >');
	document.write('<param name="movie" value="'+urltv+'?file=' + file + '&fileimg=' + urlimagen + '&ancho=' + w + '&alto=' + h + '&urltv=' + urltv + '">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<embed src="'+urltv+'?file=' + file + '&fileimg=' + urlimagen + '&ancho=' + w + '&alto=' + h + '&urltv=' + urltv + '" width="' + w + '" height="' + h_big + '" allowFullScreen="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	document.write('</object>');
/*	var FO = {
		movie:"http://www.e-noticies.com/swf/flvplayer.swf", 
//		movie:"http://www.e-noticies.tv/swf/flvplayer.swf",
		width:w+"px", 
		height:h+"px", 
		majorversion:"8", 
		build:"0", 
		bgcolor:"#FFFFFF",
		flashvars:"file="+file+"&showfsbutton=true"
	};
	
	UFO.create(FO, 'player');*/
};
function changeMovie (id, total, idnoti){
	for (i=0; i<total; i++)
	{
		if (idnoti)
		{
			document.getElementById('spanVid'+i + '' + idnoti).style.display = 'none';
		}else{
			document.getElementById('spanVid'+i).style.display = 'none';
		}
	}
	if (idnoti)
	{
		document.getElementById('spanVid'+id + '' + idnoti).style.display = 'inline';
	}else{
		document.getElementById('spanVid'+id).style.display = 'inline';
	}
}
function overClas(id){
	document.getElementById('div_clasif_'+id).style.backgroundImage = "url(http://www.e-noticies.com/imagenes/comn/varios/aglutinado_over.png)";
	document.getElementById('p_clasif_'+id).style.color = '#FFFFFF';
	document.getElementById('div_clasif_'+id).style.cursor = "pointer";
}
function outClas(id){
	document.getElementById('div_clasif_'+id).style.backgroundImage = "url(http://www.e-noticies.com/imagenes/comn/varios/aglutinado.png)";
	document.getElementById('p_clasif_'+id).style.color = '#757371';
}
function openClasif(id, tot){
	for (i=0; i<tot; i++){
		if (document.getElementById('div_desc_clasif_'+i)){
			document.getElementById('div_desc_clasif_'+i).style.display = 'none';
		}
	}
	if (document.getElementById('div_desc_clasif_'+id)){
		document.getElementById('div_desc_clasif_'+id).style.display = 'inline';
	}
}
function overClas(id, tot){
	for (i=0; i<tot; i++){
		if (document.getElementById('div_clasif_'+i))
		{
			document.getElementById('p_clasif_'+i).style.color = '#757371';
			document.getElementById('div_clasif_'+i).style.background = "url(http://www.e-noticies.com/imagenes/comn/varios/aglutinado.png) no-repeat";
		}
	}
	document.getElementById('p_clasif_'+id).style.color = '#FFFFFF';
	document.getElementById('div_clasif_'+id).style.background = 'url(http://www.e-noticies.com/imagenes/comn/varios/aglutinado_over.png) no-repeat';
}
function nextImg(){
	if (inicioVis==0){
		Slide0.slideOut();
	}
}

function URLEnc(texto){
	var codificado = texto.replace(/\//g, "");
	codificado = codificado.replace(/ /g, "-");
	codificado = codificado.toLowerCase();
	codificado = codificado.replace(/ñ/g, "n");
	codificado = codificado.replace(/ç/g, "c");
	codificado = codificado.replace(/á/g, "a");
	codificado = codificado.replace(/é/g, "e");
	codificado = codificado.replace(/í/g, "i");
	codificado = codificado.replace(/ó/g, "o");
	codificado = codificado.replace(/ú/g, "u");
	codificado = codificado.replace(/à/g, "a");
	codificado = codificado.replace(/è/g, "e");
	codificado = codificado.replace(/ì/g, "i");
	codificado = codificado.replace(/ò/g, "o");
	codificado = codificado.replace(/ù/g, "u");
	codificado = codificado.replace(/ä/g, "a");
	codificado = codificado.replace(/ë/g, "e");
	codificado = codificado.replace(/ï/g, "i");
	codificado = codificado.replace(/ö/g, "o");
	codificado = codificado.replace(/ü/g, "u");
	codificado = codificado.replace(/\'/g, "");
/*	return codificado;*/
	return codificado;
};

function URLEncode (clearString) {
  var output = '';
  var x = 0;
  clearString = clearString.toString();
  var regex = /(^[a-zA-Z0-9_.]*)/;
  while (x < clearString.length) {
    var match = regex.exec(clearString.substr(x));
    if (match != null && match.length > 1 && match[1] != '') {
    	output += match[1];
      x += match[1].length;
    } else {
      if (clearString[x] == ' ')
        output += '+';
      else {
        var charCode = clearString.charCodeAt(x);
        var hexVal = charCode.toString(16);
        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
      }
      x++;
    }
  }
  return output;
}

function cargamapa(url,ancho,alto){
	mapa =  "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH="+ ancho +" HEIGHT="+ alto +">";
	mapa += "<PARAM NAME=\"movie\" VALUE=\""+ url +"/swf/mapa_tiempo.swf?url="+ url +"\">";
	mapa += "<PARAM NAME=\"quality\" VALUE=high>";
	mapa += "<param name=\"scale\" value=\"exactfit\">";
	mapa += "<param name=\"wmode\" value=\"transparent\">";
	mapa += "<EMBED src=\""+ url +"/swf/mapa_tiempo.swf?url="+ url +"\" wmode=\"transparent\" quality=high WIDTH="+ ancho +" HEIGHT="+alto+" NAME=\"mapa\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>";
	mapa += "</OBJECT>";
	document.getElementById("contenedor_mapatiempo").innerHTML = mapa;
	
}

function buscar_tiempo(frm, url){
	if(frm.nombre_via.value==""){
		alert("Por favor, introduzca una ciudad");
		frm.nombre_via.focus();
		return false;
	}
	var ciudad = URLEnc(frm.nombre_via.value);
	if (url){
		document.location = url + ciudad + '.html'
	}else{
		document.location = ciudad + '.html'
	}
}

function busca_empresa(frm,url){
	if(frm.busqueda.value==""){
		alert("Por favor, introduzca el texto a buscar");
		frm.busqueda.focus();
		return false;
	}
//	var busqueda = URLEnc(frm.busqueda.value);
	var busqueda = URLEncode(frm.busqueda.value);
//	var busqueda = frm.busqueda.value;
	document.location="/"+url+"/"+busqueda+".html";
	return false;
}

function busca_empresa2(frm,url){
	if(frm.busqueda.value==""){
		alert("Por favor, introduzca el texto a buscar");
		frm.busqueda.focus();
		return false;
	}
	if(frm.poblaciones.value=="todas"){
		var x = document.getElementById("provincias");
		var ciudad = x.options[x.selectedIndex].text;
		var busqueda = URLEnc(frm.busqueda.value)+"-en-"+URLEnc(ciudad);

	}else{
		var busqueda = URLEnc(frm.busqueda.value)+"-en-"+URLEnc(frm.poblaciones.value);
	}
	
	document.location="/"+url+"/"+busqueda+".html";
	
}

function popup(url) {
	id="popup";
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=750');");
}
function popupHeme(url) {
	id="popup";
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600');");
}
function popupClau(url) {
	id="popup";
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=480');");
}
function popupList(url) {
	id="popup";
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=650,height=480');");
}

function compBuscHead (frm, id){
	if (isWhitespace(frm.p.value)){
		if (id=="es"){
			alert ("Infoma la palabra a buscar");
		}else{
			alert("Informi la paraula a cercar");
		}
		frm.p.select();
		frm.p.focus();
		return false;
	}
}

function actualiza_guia(scommand,frm,nombre,que){
	if(scommand!="" && nombre!="" && que!=""){
		frm.url.value=scommand;
		frm.nombre.value=que;
		frm.ciudad.value=nombre;
//		frm.action=URLEnc(que)+"-en-"+URLEnc(nombre)+".html";
		frm.action=URLEncode(que)+"+en+"+URLEncode(nombre)+".html";
//		alert(URLEnc(que)+"-en-"+URLEnc(nombre)+".html")
		frm.submit();
	}
}

function actualiza_guia2(scommand,frm,nombre,ciudad,que){
	if(scommand!="" && nombre!="" && que!=""){
		frm.url.value=scommand;
		frm.nombre.value=nombre;
		frm.ciudad.value=ciudad;
		if(ciudad==""){
//			frm.action=URLEnc(nombre)+".html";
			frm.action=URLEncode(nombre)+".html";
		}else{
//			frm.action=URLEnc(nombre)+"-en-"+URLEnc(ciudad)+".html";
			frm.action=URLEncode(nombre)+"+en+"+URLEncode(ciudad)+".html";
		}
		frm.submit();
	}
}

function getETV(file, w, h) {
	var urltv = file;
	var h_big = 0 + h + 42;
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + w + '" height="' + h + '" >');
	document.write('<param name="movie" value="' + urltv + '">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<embed src="' + urltv + '" width="' + w + '" height="' + h + '" allowFullScreen="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	document.write('</object>');
};
function getPlay(tam) {
	var urltv = "http://www.e-noticies.com/swf/play_trans.swf";
	if (tam!=""){
		var w = tam;
		var h = tam;
	}else{
		var w = "70";
		var h = "70";
	}
//	var urltv = file;
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + w + '" height="' + h + '" >');
	document.write('<param name="movie" value="' + urltv + '">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="' + urltv + '" width="' + w + '" height="' + h + '" wmode="transparent" allowFullScreen="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	document.write('</object>');
};
function overImg(id){
	document.getElementById('imgCat'+id).src = "http://www.e-noticies.com/imagenes/comn/iconos/desta.gif";
}
function outImg(id){
	document.getElementById('imgCat'+id).src = "http://www.e-noticies.com/imagenes/pxtrans.gif";
}
function compRecoUsuario(frm, idi, a){
	frm.email.style.border="solid #E8E7DB 1px";
	printResult ("spanResultUsuario", '');
	var retorno=false;
	var opt="";
	if (isWhitespace(frm.email.value)){
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		retorno=true;
		opt="1";
	}else{
		if (!validarEmail(frm.email.value))
		{
			frm.email.style.border="solid #9C1F2E 1px";
			frm.email.select();
			frm.email.focus();
			retorno = true;
		}
		opt="2";
	}
	if (retorno==true)
	{
		if (idi=="es"){
			if (opt=="1"){
				printResult ("spanResultUsuario", 'Informe el e-mail.');
			}else{
				printResult ("spanResultUsuario", 'El e-mail no es correcto.');
			}
		}else{
			if (opt=="1"){
				printResult ("spanResultUsuario", 'Informi el e-mail.');
			}else{
				printResult ("spanResultUsuario", "L'e-mail no es correcte.");
			}
		}
	}else{
		envRecoUsuario(frm);
	}
	if (a==false){
		return;
	}else{
		return false;
	}
}
function compAcceso(frm, idi, a){
	frm.cod_acc.style.border="solid #E8E7DB 1px";
	printResult ("myspanResultAcc", '');
	var retorno=false;
	var opt="";
	if (isWhitespace(frm.cod_acc.value)){
		frm.cod_acc.style.border="solid #9C1F2E 1px";
		frm.cod_acc.select();
		frm.cod_acc.focus();
		
		if (idi=="es"){
			printResult ("myspanResultAcc", 'Informe el código de acceso');
		}else{
			printResult ("myspanResultAcc", "Informi la clau d'accés");
		}
		
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	envAcceso (frm, idi, a);
	if (a==false){
		return;
	}else{
		return false;
	}
}
function compBoletin(frm, idi, a){
	envBoletin (frm, idi, a);
	if (a==false){
		return;
	}else{
		return false;
	}
}
/*	PAGINACION	*/
function paginadoOver(obj){
	obj.style.cursor='pointer';
//	obj.style.backgroundColor="#313139";
}

function paginadoOut(obj){
//	obj.style.backgroundColor="#595961";
}
/*function augLet(){
	if (letra_max!=letra){
		letra = letra + inter_letra;
		document.getElementById('txt_cuerpo').style.fontSize = letra+"px";
		document.getElementById('txt_cuerpo').style.lineHeight = letra+(inter_letra*3)+"px";
	}
}*/
function augLet(opt){
	if (opt){
		if (document.getElementById('letra'+opt))
		{
			if (letra_max!=document.getElementById('letra'+opt).innerHTML){
				document.getElementById('letra'+opt).innerHTML = parseInt(document.getElementById('letra'+opt).innerHTML) + inter_letra;
				document.getElementById('txt_cuerpo'+opt).style.fontSize = (parseInt(document.getElementById('letra'+opt).innerHTML))+"px";
				document.getElementById('txt_cuerpo'+opt).style.lineHeight = ((parseInt(document.getElementById('letra'+opt).innerHTML))+(inter_letra*3))+"px";
			}
		}
	}else{
		if (letra_max!=letra){
			letra = letra + inter_letra;
			document.getElementById('txt_cuerpo').style.fontSize = letra+"px";
			document.getElementById('txt_cuerpo').style.lineHeight = letra+(inter_letra*3)+"px";
		}
	}
}

/*function disLet(){
	if (letra_min!=letra){
		letra = letra - inter_letra;
		document.getElementById('txt_cuerpo').style.fontSize = letra+"px";
		document.getElementById('txt_cuerpo').style.lineHeight = letra+(inter_letra*3)+"px";
	}
}*/
function disLet(opt){
	if (opt){
		if (document.getElementById('letra'+opt))
		{
			if (letra_min!=document.getElementById('letra'+opt).innerHTML){
				document.getElementById('letra'+opt).innerHTML = parseInt(document.getElementById('letra'+opt).innerHTML) - inter_letra;
				document.getElementById('txt_cuerpo'+opt).style.fontSize = (parseInt(document.getElementById('letra'+opt).innerHTML))+"px";
				document.getElementById('txt_cuerpo'+opt).style.lineHeight = ((parseInt(document.getElementById('letra'+opt).innerHTML))+(inter_letra*3))+"px";
			}
		}
	}else{
		if (letra_min!=letra){
			letra = letra - inter_letra;
			document.getElementById('txt_cuerpo').style.fontSize = letra+"px";
			document.getElementById('txt_cuerpo').style.lineHeight = letra+(inter_letra*3)+"px";
		}
	}
}

function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}
function compTraductor(frm, idi, a){
	if (isWhitespace(frm.txt.value)){
		if (idi=="es"){
			alert ("Introduce el texto a traducir.");
		}else{
			alert ("Introdueix el text a traduir.");
		}
		frm.txt.select();
		frm.txt.focus();
		
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	if (a==false){
		frm.submit();
	}else{
		return true;
	}
}
function cargaPromo(url, w, h, nompar1, par1, nompar2, par2){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + w + '" height="' + h + '" >');
	document.write('<param name="movie" value="' + url + '">');
	document.write('<param name="quality" value="high" />');
//	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="menu" value="false">');
	if (nompar1!=""){
		document.write('<param name="'+nompar1+'" value="'+par1+'" />');
		url = url + "?" + nompar1 + "=" + par1;
	}
	if (nompar2!=""){
		url = url + "&" + nompar2 + "=" + par2;
	}
	document.write('<embed src="' + url + '" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" scale="exactfit" swliveconnect="true" menu="false" ></embed>');
	document.write('</object>');
}
function carga_la_tv_enoticies(url, w, h){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + w + '" height="' + h + '" >');
	document.write('<param name="movie" value="' + url + '">');
	document.write('<param name="quality" value="high" />');
//	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<param name="menu" value="false">');
	document.write('<embed src="' + url + '" width="' + w + '" height="' + h + '" quality="high"  allowFullScreen="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ></embed>');
	document.write('</object>');
}

function cargaPromoTrans(url, w, h, nompar1, par1, nompar2, par2){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + w + '" height="' + h + '" >');
	if (nompar1!=""){
		document.write('<param name="'+nompar1+'" value="'+par1+'" />');
		url = url + "?" + nompar1 + "=" + par1;
	}
	if (nompar2!=""){
		document.write('<param name="'+nompar2+'" value="'+par2+'" />');
		url = url + "&" + nompar2 + "=" + par2;
	}
	document.write('<param name="movie" value="' + url + '">');
	document.write('<param name="quality" value=high />');
	document.write('<param name="scale" value="exactfit">');
	document.write('<param name="wmode" value="transparent">');
//	document.write('<param name="menu" value="false">');
	document.write('<embed src="' + url + '" wmode="transparent" quality=high width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" scale="exactfit" swliveconnect="true" menu="false" ></embed>');
	document.write('</object>');
}
function compGuias(frm, idi, a){
	if (isWhitespace(frm.busqueda.value)){
		if (idi=="es"){
			alert ("Introduce el texto a buscar.");
		}else{
			alert ("Introdueix el text a cercar.");
		}
		frm.busqueda.select();
		frm.busqueda.focus();
		
		if (a==false){
			return;
		}else{
			return false;
		}
	}
		var busqueda = URLEncode(frm.busqueda.value);
		if (idi=="es"){
			document.location="http://servicios.e-noticies.es/guia-empresas/"+busqueda+".html";
		}else{
			document.location="http://serveis.e-noticies.cat/guia-empreses/"+busqueda+".html";
		}
	if (a==false){
//		frm.submit();
	}else{
		return false;
//		return true;
	}
}

function paginado_guia(frm,scommand,num_pagina,url){
	var action = url+"-"+num_pagina+".html";
	frm.action = action;
	frm.scommand.value=scommand;
	frm.pagina.value=num_pagina;
	frm.submit();
}
function compContacto(frm, idi, a){
	printResult ("spanResultContacto", "");
	frm.mot.style.border="solid #E8E7DB 1px";
	frm.tel.style.border="solid #E8E7DB 1px";
	frm.mai.style.border="solid #E8E7DB 1px";
	frm.nom.style.border="solid #E8E7DB 1px";
	var msgMot = "";
	var msgTel = "";
	var msgEma = "";
	var msgEma2 = "";
	var msgNom = "";
	var result = "";
	var retorno = true;
	var cont = 0;
	if (isWhitespace(frm.mot.value)){
		if (idi=="es"){	msgMot = " motivo"	}else{	msgMot = " motiu"	}
		frm.mot.style.border="solid #9C1F2E 1px";
		frm.mot.select();
		frm.mot.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.tel.value)){
		if (idi=="es"){	msgTel = " teléfono"	}else{	msgTel = " teléfon"	}
		frm.tel.style.border="solid #9C1F2E 1px";
		frm.tel.select();
		frm.tel.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.mai.value)){
		if (idi=="es"){	msgEma = " e-mail";	}else{	msgEma = " e-mail";	}
		frm.mai.style.border="solid #9C1F2E 1px";
		frm.mai.select();
		frm.mai.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.nom.value)){
		if (idi=="es"){	msgNom = " nombre";	}else{	msgNom = " nom";	}
		frm.nom.style.border="solid #9C1F2E 1px";
		frm.nom.select();
		frm.nom.focus();
		cont++;
		retorno = false;
	}
	if ((!validarEmail(frm.mai.value))&&(msgEma==""))
	{
		if (idi=="es"){	msgEma2 = " e-mail";	}else{	msgEma2 = " e-mail";	}
		frm.mai.style.border="solid #9C1F2E 1px";
		frm.mai.select();
		frm.mai.focus();
		cont++;
		retorno = false;
	}

	if (retorno==false)
	{
		if ((msgNom!="")||(msgEma!="")||(msgTel!="")||(msgMot!="")){
			if (idi=="es"){
				if (cont==1){	result = "Informa el campo";	}else{	result = "Informa los campos";	}
			}else{
				if (cont==1){	result = "Informi el camp";	}else{	result = "Informi els camps";	}
			}
			result = result + msgNom;
			if ((msgNom!="")&&(msgEma!="")){	result = result + ",";	}
			result = result + msgEma;
			if (((msgNom!="")||(msgEma!=""))&&(msgTel!="")){	result = result + ",";	}
			result = result + msgTel;
			if (((msgNom!="")||(msgEma!="")||(msgTel!=""))&&(msgMot!="")){	result = result + ",";	}
			result = result + msgMot;
			result = result + ".<br />";
		}
		if (msgEma2!=""){
			if (idi=="es"){	result = result + "El e-mail informado  no es correcto.";	}else{	result = result + "L'e-mail informat no es correcte.";	}
		}
		printResult ("spanResultContacto", result);
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	envContacto(frm);
		if (a==false){
			return;
		}else{
			return false;
		}
}
function imprimir(iddoc, idi){
    width = 502; 
    height = 450; 
    leftPosition = 0;
    topPosition = 0;
    leftPosition = (screen.width) ? (screen.width-width)/2 : 0;
    if (screen.height && (screen.height <= 600)) {
        topPosition = 0;
    } else {
        topPosition = (screen.height) ? (screen.height-height)/2 : 0;
    }
    var settings='width='+width+', height='+height+', left='+leftPosition+', top='+topPosition+', toolbar=0, location=0, directories=0, menubar=0, scrollbars=1, resizable=0, status=0';
    var popup=window.open("http://www.e-noticies.com/popup/imprimir/?iddoc="+iddoc+"&idi="+idi, '', settings);
    popup.focus();
}
function imprimirCine(iddoc, idi){
    width = 502; 
    height = 450; 
    leftPosition = 0;
    topPosition = 0;
    leftPosition = (screen.width) ? (screen.width-width)/2 : 0;
    if (screen.height && (screen.height <= 600)) {
        topPosition = 0;
    } else {
        topPosition = (screen.height) ? (screen.height-height)/2 : 0;
    }
    var settings='width='+width+', height='+height+', left='+leftPosition+', top='+topPosition+', toolbar=0, location=0, directories=0, menubar=0, scrollbars=1, resizable=0, status=0';
    var popup=window.open("http://www.e-noticies.com/popup/imprimir-cine/?iddoc="+iddoc+"&idi="+idi, '', settings);
    popup.focus();
}

function compEnviarTxt(frm, idi, a){
	printResult ("spanResultContacto", "");
	frm.mot.style.border="solid #E8E7DB 1px";
	frm.tel.style.border="solid #E8E7DB 1px";
	frm.mai.style.border="solid #E8E7DB 1px";
	frm.nom.style.border="solid #E8E7DB 1px";
	var msgMot = "";
	var msgTel = "";
	var msgEma = "";
	var msgEma2 = "";
	var msgNom = "";
	var result = "";
	var retorno = true;
	var cont = 0;
	if (isWhitespace(frm.mot.value)){
		if (idi=="es"){	msgMot = " motivo"	}else{	msgMot = " motiu"	}
		frm.mot.style.border="solid #9C1F2E 1px";
		frm.mot.select();
		frm.mot.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.tel.value)){
		if (idi=="es"){	msgTel = " teléfono"	}else{	msgTel = " teléfon"	}
		frm.tel.style.border="solid #9C1F2E 1px";
		frm.tel.select();
		frm.tel.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.mai.value)){
		if (idi=="es"){	msgEma = " e-mail";	}else{	msgEma = " e-mail";	}
		frm.mai.style.border="solid #9C1F2E 1px";
		frm.mai.select();
		frm.mai.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.nom.value)){
		if (idi=="es"){	msgNom = " nombre";	}else{	msgNom = " nom";	}
		frm.nom.style.border="solid #9C1F2E 1px";
		frm.nom.select();
		frm.nom.focus();
		cont++;
		retorno = false;
	}
	if ((!validarEmail(frm.mai.value))&&(msgEma==""))
	{
		if (idi=="es"){	msgEma2 = " e-mail";	}else{	msgEma2 = " e-mail";	}
		frm.mai.style.border="solid #9C1F2E 1px";
		frm.mai.select();
		frm.mai.focus();
		cont++;
		retorno = false;
	}

	if (retorno==false)
	{
		if ((msgNom!="")||(msgEma!="")||(msgTel!="")||(msgMot!="")){
			if (idi=="es"){
				if (cont==1){	result = "Informa el campo";	}else{	result = "Informa los campos";	}
			}else{
				if (cont==1){	result = "Informi el camp";	}else{	result = "Informi els camps";	}
			}
			result = result + msgNom;
			if ((msgNom!="")&&(msgEma!="")){	result = result + ",";	}
			result = result + msgEma;
			if (((msgNom!="")||(msgEma!=""))&&(msgTel!="")){	result = result + ",";	}
			result = result + msgTel;
			if (((msgNom!="")||(msgEma!="")||(msgTel!=""))&&(msgMot!="")){	result = result + ",";	}
			result = result + msgMot;
			result = result + ".<br />";
		}
		if (msgEma2!=""){
			if (idi=="es"){	result = result + "El e-mail informado  no es correcto.";	}else{	result = result + "L'e-mail informat no es correcte.";	}
		}
		if (result!=""){
			printResult ("spanResultContacto", result);
			if (a!=false){
				return false;
			}
		}
	}else{
		if (a==false){
			frm.submit();
		}
	}
}
function compFrmConf(frm, idi, a){
	var today=new Date();
	
	var d=today.getUTCDate();
	var m=today.getMonth();
	m = m + 1;
	var y=today.getFullYear();
	if (d<10){
		d = "0" + d;
	}
	if (m<10){
		m = "0" + m;
	}
	var fec = y + "" + m + "" + d;
	fec = parseInt(fec);
	var retorno = true;
	if (isWhitespace(frm.p.value)){
		if (idi=="es"){
			alert ("Escribe la palabra que quieras buscar");
		}else{
			alert ("Escriu la paraula que vols cercar");
		}
		retorno = false;
	}
	if (retorno){
		if (!isWhitespace(frm.bfi.value)){
			var var_bfi = frm.bfi.value;
			var_bfi = var_bfi.replace('-', '');
			var_bfi = var_bfi.replace('-', '');
			if (var_bfi>fec){
				if (idi=="es"){
					alert ("La fecha inicio no puede ser posterior a hoy.");
				}else{
					alert ("La data d'inici no pot ser posterior a avui.");
				}
				retorno = false;
			}
		}
	}
	if (retorno){
		if (!isWhitespace(frm.bff.value)){
			var var_bff = frm.bff.value;
			var_bff = var_bff.replace('-', '');
			var_bff = var_bff.replace('-', '');
			if (var_bff>fec){
				if (idi=="es"){
					alert ("La fecha inicio no puede ser posterior a hoy.");
				}else{
					alert ("La data d'inici no pot ser posterior a avui.");
				}
				retorno = false;
			}
		}
	}
	if (retorno){
		if ((!isWhitespace(frm.bfi.value))&&(!isWhitespace(frm.bff.value))){
			var var_bfi = frm.bfi.value;
			var_bfi = var_bfi.replace('-', '');
			var_bfi = var_bfi.replace('-', '');
			var var_bff = frm.bff.value;
			var_bff = var_bff.replace('-', '');
			var_bff = var_bff.replace('-', '');
			if (var_bfi > var_bff){
				if (idi=="es"){
					alert ("La fecha inicio no puede ser posterior a la final.");
				}else{
					alert ("La data d'inici no pot ser posterior a la final.");
				}
				retorno = false;
			}
		}
	}
	if (retorno)
	{
		if (a==false){
			frm.submit();
		}else{
			return true;
		}
	}else{
		if (a!=false){
			return false;
		}
	}
}
function mouseOver(obj, bc, tc){
	obj.style.backgroundColor=bc;
	obj.style.color=tc;
}
function mouseOut(obj, bc, tc){
	obj.style.backgroundColor=bc;
	obj.style.color=tc;
}
function bajaUsu(id, idi){
	if (idi=="es"){
		var msg = '¿ Estás seguro que quieres darte de baja ?';
	}else{
		var msg = 'Estàs segur que vols donar-te de baixa ?';
	}
	if (confirm(msg)){
		bajaUsuario(id, idi);
	}
}
// Parseador de textos normarles a url
function parseToURL(str){
	str=str.replace(/á/ig,'a');
	str=str.replace(/à/ig,'a');
	str=str.replace(/â/ig,'a');
	str=str.replace(/é/ig,'e');
	str=str.replace(/è/ig,'e');
	str=str.replace(/ê/ig,'e');
	str=str.replace(/ë/ig,'e');
	str=str.replace(/ç/ig,'c');
	str=str.replace(/í/ig,'i');
	str=str.replace(/ì/ig,'i');
	str=str.replace(/î/ig,'i');
	str=str.replace(/ï/ig,'i');
	str=str.replace(/ó/ig,'o');
	str=str.replace(/ò/ig,'o');
	str=str.replace(/ö/ig,'o');
	str=str.replace(/ô/ig,'o');
	str=str.replace(/ú/ig,'u');
	str=str.replace(/ù/ig,'u');
	str=str.replace(/ü/ig,'u');
	str=str.replace(/û/ig,'u');
	str=str.replace(/&/ig,'and');
	str=str.replace(/ñ/ig,'n');
	str=str.replace(/ /ig,'-');
	str=str.replace(/·/ig,'-');
	var noChar = new Array('\'','/','?','¿','!','¡',':','"','(',')','[',']','=','%','$','#','@','|','{','}','¬','~','*',';',',','.',',','[',']','^','´','`','¨','+',';','<','>','~','\\','ª','º');
	for(i=0;i<noChar.length;i++){
		for (j=0;j<str.length;j++)
		{
			str=str.replace(noChar[i],'');
		}
	}
	str=str.replace(/--/ig,'-');
	str=str.toLowerCase();
	return str;
}
function cambiarVidSin(opt){
    if (opt=='V'){
        document.getElementById('id_icon_vid').style.display = 'none';
        document.getElementById('id_span_sinopsis').style.display = 'none';
        //document.getElementById('id_div_cartel').style.display = 'none';
        document.getElementById('id_icon_sin').style.display = '';
    }else{
        document.getElementById('id_icon_sin').style.display = 'none';
        document.getElementById('id_icon_vid').style.display = '';
        document.getElementById('id_span_sinopsis').style.display = '';
        //document.getElementById('id_div_cartel').style.display = '';
    }
}

function cargaLogo(idi){
    if (idi=="es"){
        var t = 0;
    }else{
        var t = 1;
    }
    var url = 'http://e-noticies.com/swf/logo_nav.swf';
    var w = '380';
    var h = '80';
    var nompar1 = "tipo";
    var par1 = t;
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="logoswf" align="middle" width="' + w + '" height="' + h + '" >');
    document.write('<param name="movie" value="' + url + '?tipo='+t+'">');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="allowscriptaccess" value="always" />');
    document.write('<param name="allowdomain" value="always" />');
    document.write('<param name="wmode" value="opaque">');
    //document.write('<param name="menu" value="false">');
    document.write('<param name="bgcolor" value="FFFFFF" />');
    //if (nompar1!=""){
      //  document.write('<param name="'+nompar1+'" value="'+par1+'" />');
        //url = url + "?" + nompar1 + "=" + par1;
    //}
    document.write('<embed src="' + url + '?tipo='+t+'" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" scale="exactfit" wmode="opaque" allowscriptaccess="always" allowdomain="always" swliveconnect="true" menu="false" ></embed>');
    document.write('</object>');
}

function cerrarInterestitial(opt){
	if (opt==1){
		//document.getElementById('video_inte').innerHTML = '';
		if (document.getElementById('uploader_flashinte'))
		{
		var el = document.getElementById('uploader_flashinte');
		var padre = el.parentNode;
		padre.removeChild(el);
		}
		clearJorBox(true);
	}else{
		document.getElementById('cerrarInte').style.display = '';
	}
}
function abrirComenN(id, idbtn, idi, iddoc, idcin, idcom){
	cargarComen(id, idbtn, idi, iddoc, idcin, idcom);
	document.getElementById(id).style.display = '';
	document.getElementById(idbtn).style.display = 'none';
}
function closeComenN(id, idbtn){
	if (document.getElementById(idbtn)){
		document.getElementById(idbtn).style.display = '';
	}
	document.getElementById(id).innerHTML = '';
	document.getElementById(id).style.display = 'none';
}
function compComentarioN(frm, idi, a, btn){
	printResult ("spanResultComen", "");
	frm.comen.style.border="solid #E8E7DB 1px";
	frm.ciudad.style.border="solid #E8E7DB 1px";
	frm.email.style.border="solid #E8E7DB 1px";
	frm.nombre.style.border="solid #E8E7DB 1px";
	if (frm.codconf){
		frm.codconf.style.border="solid #E8E7DB 1px";
	}
	var msgCod = "";
	var msgCom = "";
	var msgCiu = "";
	var msgEma = "";
	var msgEma2 = "";
	var msgNom = "";
	var result = "";
	var retorno = true;
	var cont = 0;
	if (frm.codconf){
		if (isWhitespace(frm.codconf.value)){
			if (idi=="es"){	msgCod = " código de seguridad";	}else{	msgCod = " codi de seguretat";	}
			frm.codconf.style.border="solid #9C1F2E 1px";
			frm.codconf.select();
			frm.codconf.focus();
			cont++;
			retorno = false;
		}
	}
	if (isWhitespace(frm.comen.value) || (idi=="es" && frm.comen.value=="Comentario") || (idi=="cat" && frm.comen.value=="Comentari")){
		if (idi=="es"){	msgCom = " comentario"	}else{	msgCom = " comentari"	}
		frm.comen.style.border="solid #9C1F2E 1px";
		frm.comen.select();
		frm.comen.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.ciudad.value) || (idi=="es" && frm.ciudad.value=="Ciudad") || (idi=="cat" && frm.ciudad.value=="Ciutat")){
		if (idi=="es"){	msgCiu = " ciudad"	}else{	msgCiu = " ciutat"	}
		frm.ciudad.style.border="solid #9C1F2E 1px";
		frm.ciudad.select();
		frm.ciudad.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.email.value) || (idi=="es" && frm.email.value=="E-mail") || (idi=="cat" && frm.email.value=="E-mail")){
		if (idi=="es"){	msgEma = " e-mail";	}else{	msgEma = " e-mail";	}
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.nombre.value) || (idi=="es" && frm.nombre.value=="Nombre") || (idi=="cat" && frm.nombre.value=="Nom")){
		if (idi=="es"){	msgNom = " nombre";	}else{	msgNom = " nom";	}
		frm.nombre.style.border="solid #9C1F2E 1px";
		frm.nombre.select();
		frm.nombre.focus();
		cont++;
		retorno = false;
	}
	if ((!validarEmail(frm.email.value))&&(msgEma==""))
	{
		if (idi=="es"){	msgEma2 = " e-mail";	}else{	msgEma2 = " e-mail";	}
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		cont++;
		retorno = false;
	}
	if (retorno==false){
		if ((msgNom!="")||(msgEma!="")||(msgCiu!="")||(msgCom!="")||(msgCod!="")){
			if (idi=="es"){
				if (cont==1){	result = "Informa el campo";	}else{	result = "Informa los campos";	}
			}else{
				if (cont==1){	result = "Informi el camp";	}else{	result = "Informi els camps";	}
			}
			result = result + msgNom;
			if ((msgNom!="")&&(msgEma!="")){	result = result + ",";	}
			result = result + msgEma;
			if (((msgNom!="")||(msgEma!=""))&&(msgCiu!="")){	result = result + ",";	}
			result = result + msgCiu;
			if (((msgNom!="")||(msgEma!="")||(msgCiu!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgCom;
			if (((msgNom!="")||(msgEma!="")||(msgCiu!="")||(msgCom!=""))&&(msgCod!="")){	result = result + ",";	}
			result = result + msgCod;
			result = result + ".<br />";
		}
		if (msgEma2!=""){
			if (idi=="es"){	result = result + "El e-mail informado  no es correcto.";	}else{	result = result + "L'e-mail informat no es correcte.";	}
		}
		printResult ("spanResultComen", result);
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	envComentarioN(frm, btn);
}
function compInp(obj, val){
	if (obj.value==val){
		obj.value = '';
	}
	obj.focus();
}
function compInp2(obj, val){
	if (obj.value==''){
		obj.value = val;
	}
}
function clickMail(obj, idi){
	if (idi=='es'){
		alert ("Esta opción solo está disponible para usuarios registrados.");
	}else{
		alert ("Aquesta opció només està disponible per a usuaris registrats.");
	}
	obj.checked = false;
}
function compFirma(frm, idi, a){
	printResult ("spanResultFirma", "");
	frm.comen.style.border="solid #E8E7DB 1px";
	frm.ciudad.style.border="solid #E8E7DB 1px";
	frm.email.style.border="solid #E8E7DB 1px";
	frm.nombre.style.border="solid #E8E7DB 1px";
	var msgCod = "";
	var msgCom = "";
	var msgCiu = "";
	var msgEma = "";
	var msgEma2 = "";
	var msgSpan = "";
	var msgNom = "";
	var result = "";
	var retorno = true;
	var cont = 0;
	if (isWhitespace(frm.comen.value) || (idi=="es" && frm.comen.value=="Comentario") || (idi=="cat" && frm.comen.value=="Comentari")){
		if (idi=="es"){	msgCom = " comentario"	}else{	msgCom = " comentari"	}
		frm.comen.style.border="solid #9C1F2E 1px";
		frm.comen.select();
		frm.comen.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.ciudad.value) || (idi=="es" && frm.ciudad.value=="CP") || (idi=="cat" && frm.ciudad.value=="CP")){
		if (idi=="es"){	msgCiu = " cp"	}else{	msgCiu = " cp"	}
		frm.ciudad.style.border="solid #9C1F2E 1px";
		frm.ciudad.select();
		frm.ciudad.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.email.value) || (idi=="es" && frm.email.value=="E-mail") || (idi=="cat" && frm.email.value=="E-mail")){
		if (idi=="es"){	msgEma = " e-mail";	}else{	msgEma = " e-mail";	}
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.nombre.value) || (idi=="es" && frm.nombre.value=="Nombre") || (idi=="cat" && frm.nombre.value=="Nom")){
		if (idi=="es"){	msgNom = " nombre";	}else{	msgNom = " nom";	}
		frm.nombre.style.border="solid #9C1F2E 1px";
		frm.nombre.select();
		frm.nombre.focus();
		cont++;
		retorno = false;
	}
	if ((!validarEmail(frm.email.value))&&(msgEma==""))
	{
		if (idi=="es"){	msgEma2 = " e-mail";	}else{	msgEma2 = " e-mail";	}
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		cont++;
		retorno = false;
	}
	if (retorno==false){
		if ((msgNom!="")||(msgEma!="")||(msgCom!="")){
			if (idi=="es"){
				if (cont==1){	result = "Informa el campo";	}else{	result = "Informa los campos";	}
			}else{
				if (cont==1){	result = "Informi el camp";	}else{	result = "Informi els camps";	}
			}
			result = result + msgNom;
			if ((msgNom!="")&&(msgEma!="")){	result = result + ",";	}
			result = result + msgEma;
			if (((msgNom!="")||(msgEma!=""))&&(msgCiu!="")){	result = result + ",";	}
			result = result + msgCiu;
			if (((msgNom!="")||(msgEma!="")||(msgCiu!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgCom;
			if (((msgNom!="")||(msgEma!="")||(msgCiu!="")||(msgCom!=""))&&(msgCod!="")){	result = result + ",";	}
			result = result + msgCod;
			result = result + ".<br />";
		}
		if (msgEma2!=""){
			if (idi=="es"){	result = result + "El e-mail informado  no es correcto.";	}else{	result = result + "L'e-mail informat no es correcte.";	}
		}
		printResult ("spanResultFirma", result);
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	envFirma(frm, btn);
}
function compEnviarMani(frm, idi, a){
	/*var nom = frm.nombre.value;
	var mai = frm.email.value;
	var nom2 = frm.nombre2.value;
	var mai2 = frm.email2.value;*/
	var msgEma = "";
	var msgEma2 = "";
	var msgNom = "";
	var msgNom2 = "";
	var result = "";
	printResult ("spanResultEnviar", "");
	frm.mens.style.border="solid #E8E7DB 1px";
	frm.email2.style.border="solid #E8E7DB 1px";
	frm.nombre2.style.border="solid #E8E7DB 1px";
	frm.email.style.border="solid #E8E7DB 1px";
	frm.nombre.style.border="solid #E8E7DB 1px";
	var msgEma4 = "", msgEma3 = "", msgCom = "", msgEma2 = "", msgNom2 = "", msgEma = "", msgNom = "", result = "";
	var retorno = true;
	var cont = 0;
	if (isWhitespace(frm.email2.value) || (idi=="es" && frm.email2.value=="E-mail de tu amigo") || (idi=="cat" && frm.email2.value=="E-mail del teu amic")){
		if (idi=="es"){	msgEma2 = " e-mail de tu amigo";	}else{	msgEma2 = " e-mail del teu amic";	}
		frm.email2.style.border="solid #9C1F2E 1px";
		frm.email2.select();
		frm.email2.focus();
		cont++;
		retorno = false;
	}
	var str = frm.email2.value;
	var x;
	var arr;
	arr = str.split(",");
	if (msgEma2=="")
	{
		if (arr[1])
		{
			for (x in arr)
			{
				if (!validarEmail(arr[x]))
				{
					if (idi=="es"){	msgEma4 = " e-mail";	}else{	msgEma4 = " e-mail";	}
					frm.email2.style.border="solid #9C1F2E 1px";
					frm.email2.select();
					frm.email2.focus();
					cont++;
					retorno = false;
				}
			}
		}
	}
	if (isWhitespace(frm.nombre2.value) || (idi=="es" && frm.nombre2.value=="Nombre de tu amigo") || (idi=="cat" && frm.nombre2.value=="Nom del teu amic")){
		if (idi=="es"){	msgNom2 = " nombre de tu amigo";	}else{	msgNom2 = " nom del teu amic";	}
		frm.nombre2.style.border="solid #9C1F2E 1px";
		frm.nombre2.select();
		frm.nombre2.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.email.value) || (idi=="es" && frm.email.value=="Tu e-mail") || (idi=="cat" && frm.email.value=="El teu e-mail")){
		if (idi=="es"){	msgEma = " tu e-mail";	}else{	msgEma = " el teu e-mail";	}
		frm.email.style.border="solid #9C1F2E 1px";
		frm.email.select();
		frm.email.focus();
		cont++;
		retorno = false;
	}
	if (isWhitespace(frm.nombre.value) || (idi=="es" && frm.nombre.value=="Tu nombre") || (idi=="cat" && frm.nombre.value=="El teu nom")){
		if (idi=="es"){	msgNom = " tu nombre";	}else{	msgNom = " el teu nom";	}
		frm.nombre.style.border="solid #9C1F2E 1px";
		frm.nombre.select();
		frm.nombre.focus();
		cont++;
		retorno = false;
	}
	if (retorno==false){
		if ((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!="")||(msgCom!="")){
			if (idi=="es"){
				if (cont==1){	result = "Informa el campo";	}else{	result = "Informa los campos";	}
			}else{
				if (cont==1){	result = "Informi el camp";	}else{	result = "Informi els camps";	}
			}
			result = result + msgNom;
			if ((msgNom!="")&&(msgEma!="")){	result = result + ",";	}
			result = result + msgEma;
			if (((msgNom!="")||(msgEma!=""))&&(msgNom2!="")){	result = result + ",";	}
			result = result + msgNom2;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!=""))&&(msgEma2!="")){	result = result + ",";	}
			result = result + msgEma2;
			if (((msgNom!="")||(msgEma!="")||(msgNom2!="")||(msgEma2!=""))&&(msgCom!="")){	result = result + ",";	}
			result = result + msgCom;
			result = result + ".";
		}
		if (msgEma3!=""){
			result = result + "<br />";
			if (idi=="es"){	result = result + "Tu e-mail no es correcto.";	}else{	result = result + "El teu e-mail no es correcte.";	}
		}
		if (msgEma4!=""){
			result = result + "<br />";
			if (idi=="es"){	result = result + "El e-mail de tu amigo no es correcto.";	}else{	result = result + "L'e-mail del teu amic no es correcte.";	}
		}
		printResult ("spanResultEnviar", result);
		if (a==false){
			return;
		}else{
			return false;
		}
	}
	envAmigoMani(frm);
}
function actCaptcha(nom_id, id_sess){
	document.getElementById(nom_id).src = 'http://www.e-noticies.com/imagenes/captcha/captcha.php?ids='+id_sess+'&rand='+Math.random();
}

var ComentTodos = 1;
function cargarComentTodos(v1,v2,v3,v4){
	
	if(ComentMvalorados==2){
		ComentMvalorados=1;
		//cargarListComen(v1, v2, v3, v4);


		ComentTodos=1;

	}
	if(tesmentan==2){
		tesmentan = 1;
		ComentTodos=1;
		//cargarListComen(v1, v2, v3, v4);	
	}

	if(ComentTodos==1){
		cargarListComen(v1, v2, v3, v4);
		ComentTodos=2;
		//document.getElementById('cont_comment1').style.display='none';
		document.getElementById('cont_comment2').style.display='';
		document.getElementById('btn_comenN_1').style.color='#B62C3C';
		document.getElementById('btn_comenN_2').style.color='#868583';

	}else if(ComentTodos==2){
		cargarListComen(v1, v2, v3, v4);
		ComentTodos=1;
		document.getElementById('cont_comment1').style.display='';
		document.getElementById('cont_comment2').style.display='none';
		document.getElementById('btn_comenN_1').style.color='#868583';
	}
}

var ComentMvalorados = 1;
function cargarComentMValorados(v1,v2,v3,v4){
	tesmentan = 1;
	if(ComentMvalorados==1){
		ComentMvalorados=2;
		//ocultamos el listado de TODOS Sin paginado
		document.getElementById('cont_comment2').style.display='none';
		ComentTodos = 1;
		
		cargarListComen2(v1, v2, v3, v4);
		document.getElementById('btn_comenN_2').style.color='#B62C3C';
		//document.getElementById('btn_comenN_1').style.color='#868583';

	}else if(ComentMvalorados==2){
		ComentTodos = 1;
		ComentMvalorados=1;
		cargarListComen(v1, v2, v3, v4);

		/*
		document.getElementById('cont_comment1').style.display='';
		document.getElementById('cont_comment2').style.display='none';*/
		document.getElementById('btn_comenN_2').style.color='#868583';
	}
}
var tesmentan = 1;
function cargarTesmentan(v1,v2,v3,v4){
	if(tesmentan==1){
		document.getElementById('cont_comment2').style.display='none';
		ComentTodos=1;
		ComentMvalorados=1;
		tesmentan = 2;
		cargarTeMencionan(v1, v2, v3, v4);
	}else{
		tesmentan = 1;
		cargarListComen(v1, v2, v3, v4);
	}
}



function acabaSlider(num){
if(document.getElementById('play_'+num)){
	if(document.getElementById('play_'+num).style.display=="inline"){
		//document.getElementById('play_'+num).style.display = 'none';
	}else{
		if(sliderhacia=="abajo"){
			document.getElementById('play_'+num).style.display = 'inline';
		}
	}
}
}
