var strFoco="";
//****************************************
function fCambiarImg(istrNombre,istrImagen)
{	document[istrNombre].src = istrImagen;
}
//****************************************
function fCambiarImgFile(strNombre,strImagen,strActual){
	strImagen = eval('document.'+strImagen+'.value');
	if (strImagen == ""){
		strImagen = strActual;
	}
	fCambiarImg(strNombre,strImagen);
}
//****************************************
function ventana(vurl,valto,vancho,strScroll,Nombre)
{
	if (window.screen) {
		var ah=screen.width-(vancho/2);
		var aw=screen.height-(valto/2);
		var xc = (aw - vancho) / 2;
		var yc = (ah - valto) / 2;
	}
	window.open(vurl,Nombre,'left=' + xc + ',left='+xc+',top='+yc+',screenX='+xc+',height='+valto+',width='+vancho+',scrollbars='+strScroll+'').focus();
}
//****************************************
function fImprimirYCerrar (){
	top.focus(); 
	window.print();
	self.close();
}
//****************************************
function fCambiarFilaColor (intCual,intCuantos,strColor){
	i=1;
	while (i<=intCuantos){
		eval("fila"+i+"_"+intCual+".bgColor='"+strColor+"'");
		i++;
	}
}
//****************************************
function fNoEscribir(intAlert) 
{
	if (((window.event.keyCode>=0) && (window.event.keyCode<=47))||((window.event.keyCode>=58)&& (window.event.keyCode<=64)) || ((window.event.keyCode>=91)&& (window.event.keyCode<95)) || (window.event.keyCode==96) || (window.event.keyCode>122) ) {  
		window.event.keyCode=""; 
		if (intAlert==1){alert(fM("NoCaracteresRaros"));return;}
		else{return;}
	}
}
//****************************************
function fSoloNumero(intAlert) 
{
	if (((window.event.keyCode<48)||(window.event.keyCode>57))&& (window.event.keyCode!=8)) {  
		window.event.keyCode=""; 
		if (intAlert==1){alert(fM("SoloNumeros"));return false;}
		else{return false;}
	}
}
//****************************************
function fSoloDecimal(intAlert,iintNumerico,elemento) 
{	if (((window.event.keyCode<48)||(window.event.keyCode>57))&& (window.event.keyCode!=8)&& (window.event.keyCode!=46))
	{	window.event.keyCode=""; 
		if (intAlert==1)
		{	alert(fM("SoloDecimales"));return false;
		}
		else
		{	return false;
		}
	}
	if (typeof iintNumerico != 'undefined')
	{	if (iintNumerico==1 && window.event.keyCode==46 && elemento.value.lastIndexOf(".")!=-1)
		{	window.event.keyCode="";
			if (intAlert==1)
			{	alert(fM("Numerico"));return false;
			}
			else
			{	return false;
			}
		}
	}
}
//****************************************
function fIntro(intAlert) 
{
	if (window.event.keyCode!=13){
		if (((window.event.keyCode>=0) && (window.event.keyCode<=47))||((window.event.keyCode>=58)&& (window.event.keyCode<=64)) || ((window.event.keyCode>=91)&& (window.event.keyCode<95)) || (window.event.keyCode==96) || (window.event.keyCode>122) ) {  
			window.event.keyCode=""; 
			if (intAlert==1){alert(fM("LetraRarorikEz"));return;}
			else{return;}
		}
	}else{fValidarUserPass();}
}
//****************************************
function fValidarUserPass (){
	if (document.frmLogin.txtUser.value==""){	
		alert(fM("IntroduzcaUsuario"));
		document.frmLogin.txtUser.focus();
		return false;
	}else{	
		if (document.frmLogin.txtUser.value.lastIndexOf("'")!=-1 || document.frmLogin.txtUser.value.lastIndexOf("=")!=-1 || document.frmLogin.txtUser.value.lastIndexOf("/")!=-1 || document.frmLogin.txtUser.value.lastIndexOf("%")!=-1 || document.frmLogin.txtUser.value.lastIndexOf(".")!=-1 || document.frmLogin.txtUser.value.lastIndexOf(",")!=-1){
			alert(fM("LetraRarorikEz"));
			document.frmLogin.txtUser.focus();
			return false;
		}
	}
	if (document.frmLogin.txtPass.value==""){	
		alert(fM("IntroduzcaContrasenna"));
		document.frmLogin.txtPass.focus();
		return false;
	}else{	
		if (document.frmLogin.txtPass.value.lastIndexOf("'")!=-1 || document.frmLogin.txtPass.value.lastIndexOf("=")!=-1 || document.frmLogin.txtPass.value.lastIndexOf("/")!=-1 || document.frmLogin.txtPass.value.lastIndexOf("%")!=-1 || document.frmLogin.txtPass.value.lastIndexOf(".")!=-1 || document.frmLogin.txtPass.value.lastIndexOf(",")!=-1){	
			alert(fM("NoCaracteresExtrannos"));
			document.frmLogin.txtPass.focus();
			return false;
		}
	}
	//document.frmLogin.submit();
	return true;
}

//****************************************************
function fValidarCorreo(valor){
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(valor)){return true;} 
	else { alert(fM("EmailIncorrecto")); return false ;}
}
//****************************************************
function trim(cadena){ 
	for(i=0; i<cadena.length; ){
	if(cadena.charAt(i)==" ")
	cadena=cadena.substring(i+1, cadena.length);
	else break; }
	for(i=cadena.length-1; i>=0; i=cadena.length-1){
	if(cadena.charAt(i)==" ") cadena=cadena.substring(0,i);
	else break; }
	return cadena;
}
//*************************************
function textCounter(maxlimit,elemento){	
	if (elemento.value.length > maxlimit){elemento.value = elemento.value.substring(0, maxlimit);}
}
//****************************************************
function fFormatoTextoColor(Tipo,Donde){
	if (Donde!="" && typeof Donde != 'undefined')
	{	Donde=Donde+".";
		if (eval(Donde+"strFoco!=''"))
		{	strTexto = eval(Donde+"document.selection.createRange().text");
			if (strTexto ==""){alert (fM("SeleccionaTexto"));return;}
			if (Tipo == "#F76531"){eval(Donde+'document.selection.createRange().text = "[#F76531#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#FE9664"){eval(Donde+'document.selection.createRange().text = "[#FE9664#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#36A986"){eval(Donde+'document.selection.createRange().text = "[#36A986#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#908E8E"){eval(Donde+'document.selection.createRange().text = "[#908E8E#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#A0BE18"){eval(Donde+'document.selection.createRange().text = "[#A0BE18#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#899DCE"){eval(Donde+'document.selection.createRange().text = "[#899DCE#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#123A9C"){eval(Donde+'document.selection.createRange().text = "[#123A9C#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#000000"){eval(Donde+'document.selection.createRange().text = "[#000000#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#892D30"){eval(Donde+'document.selection.createRange().text = "[#892D30#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#C48665"){eval(Donde+'document.selection.createRange().text = "[#C48665#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#935988"){eval(Donde+'document.selection.createRange().text = "[#935988#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
			if (Tipo == "#D294BB"){eval(Donde+'document.selection.createRange().text = "[#D294BB#]" + ' + Donde + 'document.selection.createRange().text + "[/#]"');}
		}
	}else
	{	if (strFoco!="")
		{	strTexto = document.selection.createRange().text;
			if (strTexto ==""){alert (fM("SeleccionaTexto"));return;}
			if (Tipo == "#F76531"){document.selection.createRange().text = "[#F76531#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#FE9664"){document.selection.createRange().text = "[#FE9664#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#36A986"){document.selection.createRange().text = "[#36A986#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#908E8E"){document.selection.createRange().text = "[#908E8E#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#A0BE18"){document.selection.createRange().text = "[#A0BE18#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#899DCE"){document.selection.createRange().text = "[#899DCE#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#123A9C"){document.selection.createRange().text = "[#123A9C#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#000000"){document.selection.createRange().text = "[#000000#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#892D30"){document.selection.createRange().text = "[#892D30#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#C48665"){document.selection.createRange().text = "[#C48665#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#935988"){document.selection.createRange().text = "[#935988#]" + document.selection.createRange().text + "[/#]";}
			if (Tipo == "#D294BB"){document.selection.createRange().text = "[#D294BB#]" + document.selection.createRange().text + "[/#]";}
		}
	}
}
//****************************************************
function fFormatoTexto(Tipo,Donde){
	if (Donde!="" && typeof Donde != 'undefined')
	{	Donde=Donde+".";
		if (eval(Donde+"strFoco!=''"))
		{	strTexto = eval(Donde+"document.selection.createRange().text");
			if (strTexto ==""){alert (fM("SeleccionaTexto"));return;}
			if (Tipo == "b"){eval(Donde+'document.selection.createRange().text = "[b]" + ' + Donde + 'document.selection.createRange().text + "[/b]"');}
			if (Tipo == "u"){eval(Donde+'document.selection.createRange().text = "[u]" + ' + Donde + 'document.selection.createRange().text + "[/u]"');}
			if (Tipo == "k"){eval(Donde+'document.selection.createRange().text = "[i]" + ' + Donde + 'document.selection.createRange().text + "[/i]"');}
			if (Tipo == "-t"){eval(Donde+'document.selection.createRange().text = "[-t]" + ' + Donde + 'document.selection.createRange().text + "[/-t]"');}
			if (Tipo == "t"){eval(Donde+'document.selection.createRange().text = "[t]" + ' + Donde + 'document.selection.createRange().text + "[/t]"');}
			if (Tipo == "+t"){eval(Donde+'document.selection.createRange().text = "[+t]" + ' + Donde + 'document.selection.createRange().text + "[/+t]"');}
			if (Tipo == "sup"){eval(Donde+'document.selection.createRange().text = "[sup]" + ' + Donde + 'document.selection.createRange().text + "[/sup]"');}
			if (Tipo == "sub"){eval(Donde+'document.selection.createRange().text = "[sub]" + ' + Donde + 'document.selection.createRange().text + "[/sub]"');}
			if (Tipo == "center"){eval(Donde+'document.selection.createRange().text = "[center]" + ' + Donde + 'document.selection.createRange().text + "[/center]"');}
			return;
		}
	}
	else
	{	if (strFoco!="")
		{	strTexto = document.selection.createRange().text;
			if (strTexto ==""){alert (fM("SeleccionaTexto"));return;}
			if (Tipo == "b"){document.selection.createRange().text = "[b]" + document.selection.createRange().text + "[/b]";}
			if (Tipo == "u"){document.selection.createRange().text = "[u]" + document.selection.createRange().text + "[/u]";}
			if (Tipo == "k"){document.selection.createRange().text = "[i]" + document.selection.createRange().text + "[/i]";}
			if (Tipo == "-t"){document.selection.createRange().text = "[-t]" + document.selection.createRange().text + "[/-t]";}
			if (Tipo == "t"){document.selection.createRange().text = "[t]" + document.selection.createRange().text + "[/t]";}
			if (Tipo == "+t"){document.selection.createRange().text = "[+t]" + document.selection.createRange().text + "[/+t]";}
			if (Tipo == "sup"){document.selection.createRange().text = "[sup]" + document.selection.createRange().text + "[/sup]";}
			if (Tipo == "sub"){document.selection.createRange().text = "[sub]" + document.selection.createRange().text + "[/sub]";}
			if (Tipo == "center"){document.selection.createRange().text = "[center]" + document.selection.createRange().text + "[/center]";}
			return;
		}
	}
}
//*************************************************
function fInsertarEnlace(Tipo,Donde){	
	if (strFoco==""){alert(fM("AukeratuNonNahiDuzuLinkaJarri"));return;}
	strEnlace=document.selection.createRange().text;
	var strTexto=prompt(fM("LinkaTextua"),strEnlace);
	if (strTexto!="" && typeof strTexto!='undefined' && strTexto!=null){
		var strUrl=prompt(fM("LinkaURL"),'http://');
	}
	if (strUrl!="" && typeof strUrl!='undefined' && strUrl!=null){
		if(Tipo=="http"){
			strFoco.focus();
			if (strTexto!="" && typeof strTexto!='undefined' && strTexto!=null ){
				if (document.selection.createRange().text!=''){document.selection.createRange().text="[link=" + strUrl +"=link]" + strTexto + "[/link]";}
				else{strFoco.value+="[link=" + strUrl +"=link]" + strTexto + "[/link]";}
			}
			else{
				document.selection.createRange().text="[link=" + strUrl + "=link]" + strUrl + "[/link]";
			}
		}
	}
}
//****************************************************
function fInsertarSimbolo(Tipo,Donde)
{	if (Donde!="" && typeof Donde != 'undefined')
	{	Donde=Donde+".";
		if (eval(Donde+"strFoco==''"))
		{	alert(fM("SeleccionaDondeInsertarSimbolo"));
			return;
		}
		strAux="";
		switch (Tipo)
		{	case "mm":
				strAux="[+-]";
				break;
			case "c":
				strAux="[sq]";
				break;
		}
		eval(Donde+"strFoco.focus()");
		if (eval(Donde+"document.selection"))
		{	eval(Donde+"document.selection.createRange().text= strAux");
		}
		
		
		else
		{	eval(Donde+"strFoco+=strAux");
		}
	}
	else
	{	if (strFoco=="")
		{	alert(fM("SeleccionaDondeInsertarSimbolo"));
			return;
		}
		strAux="";
		switch (Tipo)
		{	case "mm":
				strAux="[+-]";
				break;
			case "c":
				strAux="[sq]";
				break;
		}
		strFoco.focus();
		if (document.selection)
		{	document.selection.createRange().text= strAux;
		}
		else
		{	strFoco.value+=strAux;
		}
	}
}
//****************************************
function fAbrirEscritorio (strRaiz){
	intIzquierda=(screen.width-986)/2;
	intArriba=(screen.height-601)/2;
	window.open(strRaiz+"administracion/index.php","cianco_administracon","screenX="+intIzquierda+",screenY="+intArriba+",left="+intIzquierda+",top="+intArriba+",resizeable=no,directories=no,height=602,menubar=no,scrollbars=no,status=no,titlebar=no,toolbar=no,width=976");
	window.open(strRaiz+"index.php","_parent");
}
//**************************************
function fValidarEnvio (){
	if (document.frmAmigo.txtNombre.value==""){alert(fM("IntroduzcaSuNombre"));return;}
	if (document.frmAmigo.txtEmail.value==""){alert(fM("IntroduzcaSuEmail"));return;}
	else{if(!fValidarCorreo(document.frmAmigo.txtEmail.value)){return;}}
	if (document.frmAmigo.txtNombre2.value==""){alert(fM("IntroduzcaNombreEnvio"));return;}
	if (document.frmAmigo.txtEmail2.value==""){alert(fM("IntroduzcaEmailEnvio"));return;}
	else{if(!fValidarCorreo(document.frmAmigo.txtEmail2.value)){return;}}
	document.frmAmigo.submit();
}
//**************************************
function fEscribirCapa(istrTexto,istrCapa)
{	if (typeof istrCapa== 'undefined')
	{	istrCapa="tip";
	}
	else
	{	if (istrCapa=="")
		{	istrCapa="tip";
		}
	}
	if(document.layers)
	{   strString='document.'+istrCapa+'.document.write("'+istrTexto+'")';
		eval(strString);
	    eval('document.'+istrCapa+'.document.close()');
	}
	if(document.all)
	{   strString='document.all("'+istrCapa+'").innerHTML="';
		strString=strString+istrTexto+'"';
	}
	if(document.getElementById)
	{   strString='document.getElementById("'+istrCapa+'").innerHTML="'+istrTexto+'"';
		eval(strString);
	}
	return;
}
//**************************************
function fQuitarCapa (){
	if(document.layers){document.tip.visibility="hidden";}
	if(document.all){document.all("tip").style.visibility="hidden";}
	if(document.getElementById){document.getElementById("tip").style.visibility="hidden";}
}
//******************************************
function fMostrarPorcentajes (){
	if(document.frmCajitas.rdbTipo[0].checked){
		MM_showHideLayers ('divColumnas','','hidden');
	}else{
		MM_showHideLayers ('divColumnas','','show');
	}
}
//*******************************
function fCalcularOrdenes (){
	intMax1=0;
	intMax2=0;
	for(i=0;i<aOrdenar.length;i++){
		if(aOrdenar[i][2]=="1"){
			if (intMax1<aOrdenar[i][1]){
				intMax1 = aOrdenar[i][1];
			}
		}else{
			if (intMax2<aOrdenar[i][1]){
				intMax2 = aOrdenar[i][1];
			}
		}
	}
	for(i=0;i<aOrdenar.length;i++){
		if(aOrdenar[i][2]=="1"){
			for(c1=0;c1<intMax1;c1++){
				eval('document.frmCajitas.cboOrden'+parseInt(i+1)+'.options[c1]=new Option(c1+1,c1+1)');
			}
		}else{
			for(c2=0;c2<intMax2;c2++){
				eval('document.frmCajitas.cboOrden'+parseInt(i+1)+'.options[c2]=new Option(c2+1,c2+1)');
			}
		}
		eval('document.frmCajitas.cboOrden'+parseInt(i+1)+'.value=aOrdenar[i][1]');
		//eval('document.frmCajitas.cboColumna'+parseInt(i+1)+'.value=aOrdenar[i][2]');
	}	
}
//******************************************
function fMostrarColumnas (){
	intCuantos = document.frmCajitas.Cuantos.value;
	if(document.frmCajitas.rdbTipo[1].checked){
		MM_showHideLayers ('divCont2','','show');
		for(i=1;i<=intCuantos;i++){
			MM_showHideLayers ('divColumna'+i,'','show');
			fEscribirCapa("Este bloque está ubicado en la posición vertical","divPosicion"+i);
		}
	}else{
		MM_showHideLayers ('divCont2','','hidden');
		for(i=1;i<=intCuantos;i++){
			MM_showHideLayers ('divColumna'+i,'','hidden');
			fEscribirCapa("Este bloque está ubicado en la posición vertical:","divPosicion"+i);
		}
	}
}
//*******************************
function fCambiarColumnas ()
{	if(document.frmCajitas.rdbTipo[1].checked)
	{	intColumnas = 2;
	}
	else
	{	intColumnas = 1;
	}
	intMax=0;
	for(i=0;i<aOrdenar.length;i++)
	{	if(aOrdenar[i][1]>intMax && parseInt(aOrdenar[i][2])==parseInt(intColumnas))
		{	intMax=aOrdenar[i][1];
		}
	}
	for(i=0;i<aOrdenar.length;i++)
	{	if(parseInt(aOrdenar[i][2])!=parseInt(intColumnas))
		{	aOrdenar[i][1] = parseInt(intMax)+1;
			intMax++;
		}
		aOrdenar[i][2] = 1;
	}
	fVaciarTodosOrdenes();
	fCalcularOrdenes();
}
//*******************************
function fVaciarTodosOrdenes (){
	for(i=1;i<=aOrdenar.length;i++){
		eval('document.frmCajitas.cboOrden'+i+'.length=0');
	}
}
//************************************
function fValidarDatosOpcion (strOpcion,intBloque){
	if (!fValidarCabecera())
	{	return;
	}	
	//VALIDAMOS QUE LAS POSICIONES DE LOS BLOQUE SEAN TODAS DISTINTAS
	intCuantos = document.frmCajitas.Cuantos.value;
	sw=0;
	for (i=1;i<=intCuantos;i++){
		if (eval('document.frmCajitas.cboColumna'+i+'.value')=="1"){
			for (j=1;j<=intCuantos;j++){
				if (eval('document.frmCajitas.cboColumna'+j+'.value')=="1"){
					if ((i!=j) && (eval('document.frmCajitas.cboOrden'+i+'.value') == eval('document.frmCajitas.cboOrden'+j+'.value'))){
						sw=1;
					}
				}
			}
		}
	}
	for (i=1;i<=intCuantos;i++){
		if (eval('document.frmCajitas.cboColumna'+i+'.value')=="2"){
			for (j=1;j<=intCuantos;j++){
				if (eval('document.frmCajitas.cboColumna'+j+'.value')=="2"){
					if ((i!=j) && (eval('document.frmCajitas.cboOrden'+i+'.value') == eval('document.frmCajitas.cboOrden'+j+'.value'))){
						sw=1;
					}
				}
			}
		}
	}
	if (sw==1){alert(fM("OrdenBloquesDistintios"));return;}
	
	//VALIDAMOS QUE LOS CAMPOS DEL 1ER ESTAN BIEN RELLENADOS
	intPrimero = 0
	for (i=1;i<=intCuantos;i++){
		if(eval('document.frmCajitas.cboOrden'+i+'.value') == 1){intPrimero = i; i=intCuantos;}
		//if(eval('document.frmCajitas.cboOrden'+i+'.value') == 1 && eval('document.frmCajitas.cboColumna'+i+'.value')==1 ){intPrimero = i; i=intCuantos;}
	}
	if (intPrimero == 0){alert(fM("DebeHaberBloque1"));return;}
	if (eval('document.frmCajitas.hdnTipo'+intPrimero+'.value')!="1" && eval('document.frmCajitas.hdnTipo'+intPrimero+'.value')!="2" && eval('document.frmCajitas.hdnTipo'+intPrimero+'.value')!="3"){
		strTexto = eval('document.frmCajitas.txtTexto'+intPrimero+'.value');
		strFoto = eval('document.frmCajitas.txtImagen'+intPrimero+'.value');
		strPie = eval('document.frmCajitas.txtPie'+intPrimero+'.value');
		strFoto2 = eval('document.frmCajitas.Imagen'+intPrimero+'.value');
		strWai = eval('document.frmCajitas.txtWai'+intPrimero+'.value');
		strWaiB = eval('document.frmCajitas.txtWaiB'+intPrimero+'.value');
		if(strPie!="" && strFoto=="" && strFoto2==""){alert(fM("Bloque")+" 1: "+fM("PieDeFotoSinFoto"));return;}
		//if ((strFoto!="" || strFoto2!="") && strWai==""){alert(fM("FotoSinDescCorta"));return}
		if (strWai == "" && strTexto == "" && strFoto == "" && strFoto2 == ""){alert(fM("PrimerBloqueObligatorio"));return;}
	}
	
	//VALIDAMOS QUE TODOS LOS DEMÁS BLOQUES ESTEN BIEN RELLENADOS
	for (i=1;i<=intCuantos;i++){
		if (eval('document.frmCajitas.hdnTipo'+i+'.value')!="1" && eval('document.frmCajitas.hdnTipo'+i+'.value')!="2" && eval('document.frmCajitas.hdnTipo'+i+'.value')!="3"){
			strTexto = eval('document.frmCajitas.txtTexto'+i+'.value');
			strFoto = eval('document.frmCajitas.txtImagen'+i+'.value');
			strPie = eval('document.frmCajitas.txtPie'+i+'.value');
			strFoto2 = eval('document.frmCajitas.Imagen'+i+'.value');
			intOrden = eval('document.frmCajitas.cboOrden'+i+'.value');
			intColumna = eval('document.frmCajitas.cboColumna'+i+'.value');
			strWai = eval('document.frmCajitas.txtWai'+i+'.value');
			if(strPie!="" && strFoto=="" && strFoto2==""){alert(fM("Bloque")+ " " + intOrden + " "+fM("Columna")+ " " + intColumna + " : "+fM("PieDeFotoSinFoto"));return;}
			//if ((strFoto!="" || strFoto2!="") && strWai==""){alert(fM("FotoSinDescCorta"));return}
			if (strWai == "" && strTexto == "" && strFoto == "" && strFoto2 == ""){alert(fM("Bloque")+ " " + intOrden + " "+fM("Columna")+ " " + intColumna + " : "+fM("DebeRellenarAlgunCampoBloque"));return;}
		}
		if (eval('document.frmCajitas.hdnTipo'+i+'.value')=="1")
		{	intCuantas=eval('document.frmCajitas.hdnImagenes'+i+'.value');
			for (j=1;j<=intCuantas;j++)
			{	if (document.getElementById("ImagenBloque"+i+"_"+j).src.lastIndexOf("px_t.gif")==-1 && document.getElementById("txtWai"+i+"_"+j).value=="")
				{	alert(fM("IntroduzcaDescCorta"));
					document.getElementById("txtWai"+i+"_"+j).focus();
					return;
				}
			}
		}
	}
	switch (strOpcion)
	{	case "a":
			document.frmCajitas.Anhadir.value=1;
			break;
		case "i":
			document.frmCajitas.Anhadir.value=2;
			break;
		case "ii":
			document.frmCajitas.Anhadir.value=4;
			document.frmCajitas.Donde.value=intBloque;
			break;
		case "t":
			document.frmCajitas.Anhadir.value=3;
			break;
		case "p":
			document.frmCajitas.Anhadir.value=5;
			break;
		case "e":
			document.frmCajitas.Anhadir.value=6;
			break;
		case "v":
			document.frmCajitas.Anhadir.value=0;
			break;
	}
	document.frmCajitas.submit();
}
//******************************************
function fCambiarColumnasBolque (){
	intColumnas = document.frmDato.cboColumnas.value;
	
	I11.style .backgroundColor = '#ECF2F8';
	I12.style .backgroundColor = '#ECF2F8';
	I13.style .backgroundColor = '#ECF2F8';
	I14.style .backgroundColor = '#ECF2F8';
	I15.style .backgroundColor = '#ECF2F8';
	I21.style .backgroundColor = '#ECF2F8';
	I22.style .backgroundColor = '#ECF2F8';
	I23.style .backgroundColor = '#ECF2F8';
	I24.style .backgroundColor = '#ECF2F8';
	I25.style .backgroundColor = '#ECF2F8';
	
	i=1
	while (i<=intColumnas){
		eval("I1"+i+".style .backgroundColor = '#C6A25A'");
		eval("I2"+i+".style .backgroundColor = '#C6A25A'");
		i++;
	}
}
//**************************************
function fAsegurarBorrarBloque (intBloque,intCodBloque,intCodNoticia,strCodIdioma,intTipo,iintModulo){
	intOrden = eval('document.frmCajitas.cboOrden'+intBloque+'.value');
	if (intOrden==1)
	{	strMensaje = fM("SeguroBorrarBloque1");
	}
	else
	{	strMensaje = fM("SeguroBorrarBloque");
	}
	if(confirm(strMensaje))
	{	switch(iintModulo)
		{	case 5:
				location.href = "index.php?pg=16&Tipo="+intTipo+"&CodNoticia="+intCodNoticia+"&CodBloque="+intCodBloque+"&CodIdioma="+strCodIdioma;
				break;
			case 9:
				location.href = "index.php?pg=16&Tipo="+intTipo+"&CodCorporativo="+intCodNoticia+"&CodBloque="+intCodBloque+"&CodIdioma="+strCodIdioma;
				break;
		}
	}
	else
	{	return;
	}
}
//**************************************
function fAsegurarBorrarImagenBloque (intCodBloque,intModelo,strIdioma,intCodImagen,intModulo){
	if(confirm(fM("SeguroBorrarImagen")))
	{	if (intCodImagen=="0")
		{	switch (intModulo)
			{	case 5:
					location.href="index.php?pg=17&CodBloque="+intCodBloque+"&CodNoticia="+intModelo+"&CodIdioma="+strIdioma;
					break;
				case 9:
					location.href="index.php?pg=17&CodBloque="+intCodBloque+"&CodCorporativo="+intModelo+"&CodIdioma="+strIdioma;
					break;
			}
		}
		else
		{	switch (intModulo)
			{	case 5:
					location.href="index.php?pg=24&CodImagen="+intCodImagen+"&Bloque="+intCodBloque+"&CodNoticia="+intModelo+"&CodIdioma="+strIdioma;
					break;
				case 9:
					location.href="index.php?pg=24&CodImagen="+intCodImagen+"&Bloque="+intCodBloque+"&CodCorporativo="+intModelo+"&CodIdioma="+strIdioma;
					break;
			}
		}
	}
	else
	{	return;
	}
}
//**************************************
function fAsegurarBorrarPdfBloque (intCodBloque,intModelo,strIdioma,intCodPdf,intNBloque,iintModulo)
{	if(confirm(fM("SeguroBorrarPdf")))
	{	switch(iintModulo)
		{	case 5:
				location.href="index.php?pg=27&CodPdf="+intCodPdf+"&Bloque="+intCodBloque+"&CodNoticia="+intModelo+"&CodIdioma="+strIdioma+"&NBloque="+intNBloque;
				break;
			case 9:
				location.href="index.php?pg=27&CodPdf="+intCodPdf+"&Bloque="+intCodBloque+"&CodCorporativo="+intModelo+"&CodIdioma="+strIdioma+"&NBloque="+intNBloque;
				break;
		}
	}else{return;}
}
//**************************************
function fValidarContacto (){
	if (document.frmContacto.txtNombre.value==""){alert(fM("IntroduzcaNombre"));return;}
	if (document.frmContacto.txtApellidos.value==""){alert(fM("IntroduzcaApellidos"));return;}
	if (document.frmContacto.txtEmpresa.value==""){alert(fM("IntroduzcaEmpresa"));return;}
	if (document.frmContacto.txtTelefono.value==""){alert(fM("IntroduzcaTelefono"));return;}
	if (document.frmContacto.txtEmail.value==""){alert(fM("IntroduzcaSuEmail"));return;}
	else{if(!fValidarCorreo(document.frmContacto.txtEmail.value)){return;}}
	if (document.frmContacto.txtSolicitud.value==""){alert(fM("IntroduzcaSolicitud"));return;}
	document.frmContacto.submit();
}
//**************************************
function fVerPosiciones(iintImagenes,iintColumnas)
{	window.open("index.php?pg=28&intI="+iintImagenes+"&intC="+iintColumnas,"loreka_posiciones","resizeable=no,directories=no,height=400,menubar=no,scrollbars=yes,status=no,titlebar=no,toolbar=no,width=400");
}