function cerrarsesion ()
{
	if (confirm("¿Desea cerrar la sesión actual del Administrador?"))
	{
		location.href="cerrarsesion.php";
	}
}

function noticias_alta()
{
	if (document.datos.titulo.value=="")
	{
		alert ("Debe cumplimentar el Titulo de la Noticia");
	}

	else
	{
		document.datos.submit();
	}
}

function usuarios_prensa_alta()
{
	if (document.datos.usuario.value=="")
	{
		alert ("Debe introducir el Usuario");
	}
	else if (document.datos.password.value=="")
	{
		alert ("Debe introducir la Password");
	}
	else
	{
		document.datos.submit();
	}
}
function datos_contacto()
{
	if (document.datos.cif.value=="")
	{
		alert ("Debe introducir el CIF");
	}
	else if (document.datos.calle.value=="")
	{
		alert ("Debe introducir la Calle");
	}
	else if (document.datos.numero.value=="")
	{
		alert ("Debe introducir el Numero");
	}
	else if (document.datos.cod_postal.value=="")
	{
		alert ("Debe introducir el Codigo Postal");
	}
	else if (document.datos.poblacion.value=="")
	{
		alert ("Debe introducir la Poblacion");
	}
	else if (document.datos.provincia.value=="")
	{
		alert ("Debe introducir la Provincia");
	}
	else if (document.datos.telefono.value=="")
	{
		alert ("Debe introducir el Telefono");
	}
	else if (document.datos.fax.value=="")
	{
		alert ("Debe introducir el Fax");
	}
	else
	{
		document.datos.submit();
	}
}

function musicales_alta()
{
	if (document.datos.nombre.value=="")
	{
		alert ("Debe cumplimentar el Nombre");
	}
	else if (document.datos.tipo.value=="0")
	{
		alert ("Debe seleccionar el Tipo");
	}
	else if (document.datos.logo.value=="")
	{
		alert ("Debe seleccionar la Imagen de Logotipo");
	}
	else if (document.datos.cabecera.value=="")
	{
		alert ("Debe seleccionar la Imagen de Cabecera");
	}
	else
	{
		document.datos.submit();
	}
}

function musicales_musica()
{
	if (document.datos.descripcion.value=="")
	{
		alert ("Debe cumplimentar la Descripcion del Fichero");
	}
	else if (document.datos.fichero.value=="")
	{
		alert ("Debe seleccionar el Fichero");
	}
	else
	{
		document.datos.submit();
	}
}

function musicales_videos()
{
	if (document.datos.descripcion.value=="")
	{
		alert ("Debe cumplimentar la Descripcion del Fichero");
	}
	else if (document.datos.fichero.value=="")
	{
		alert ("Debe seleccionar el Fichero");
	}
	else
	{
		/*document.datos.fichero.value=document.datos.fichero.value.replace (/"/g,"\"");
		document.datos.fichero.value=document.datos.fichero.value.replace (/</g,"////");
		document.datos.fichero.value=document.datos.fichero.value.replace (/>/g,"****");*/
		//alert ("ya");
		document.datos.submit();
	}
}

function usuarios_prensa_borrar(nombre, codigo, musical)
{
	if (confirm("¿Desea borrar el Usuario '"+nombre+"'?"))
	{
	location.href="usuarios_prensa_baja.php?id="+codigo+"&id_musical="+musical;
	}
}

function musica_borrar(nombre, codigo, musical)
{
	if (confirm("¿Desea borrar el Fichero '"+nombre+"'?"))
	{
	location.href="musicales_musica_baja.php?id="+codigo+"&id_musical="+musical;
	}
}

function eliseo_musica_borrar(nombre, codigo)
{
	if (confirm("¿Desea borrar el Fichero '"+nombre+"'?"))
	{
	location.href="eliseo_musica_baja.php?id="+codigo;
	}
}


function videos_borrar(nombre, codigo, musical)
{
	if (confirm("¿Desea borrar el Videos '"+nombre+"'?"))
	{
	location.href="musicales_videos_baja.php?id="+codigo+"&id_musical="+musical;
	}
}

function imagen_borrar(nombre, codigo, musical)
{
	if (confirm("¿Desea borrar la Imagen '"+nombre+"'?"))
	{
	location.href="musicales_galeria_baja.php?id="+codigo+"&id_musical="+musical;
	}
}

function quienes_imagen_borrar(nombre, codigo)
{
	if (confirm("¿Desea borrar la Imagen '"+nombre+"'?"))
	{
	location.href="quienessomos_imagenes_baja.php?id="+codigo;
	}
}

function eliseo_imagen_borrar(nombre, codigo)
{
	if (confirm("¿Desea borrar la Imagen '"+nombre+"'?"))
	{
	location.href="eliseo_imagenes_baja.php?id="+codigo;
	}
}

function musicales_aspecto()
{
	if (document.datos.hexvalue.value=="")
	{
		alert ("Debe seleccionar un color de Fuente");
	}
	else if (document.datos.hexvalue_back.value=="")
	{
		alert ("Debe seleccionar un color de Fondo");
	}
	else
	{
		document.datos.submit();
	}
}

function musicales_detalle()
{
	if (document.datos.nombre.value=="")
	{
		alert ("Debe cumplimentar el Nombre");
	}
	else if (document.datos.tipo.value=="0")
	{
		alert ("Debe seleccionar el Tipo");
	}
	else
	{
		document.datos.submit();
	}
}

function noticias_borrar(nombre, codigo)
{
	if (confirm("¿Desea borrar la Noticia '"+nombre+"'?"))
	{
	location.href="noticias_baja.php?id="+codigo;
	}
}


function musicales_borrar(nombre, codigo)
{
	if (confirm("¿Desea borrar el Musical/Artista '"+nombre+"'?"))
	{
	location.href="musicales_baja.php?id="+codigo;
	}
}



function popUpLoc()
{
	var winattributes="width=700px,height=300px,resizable=no,top=200px,left=150px";
	window.open("localizacion.php","", winattributes)	
}



function addBookmark() {
titulo="Elite - Producciones Artisticas";
url="http://www.eliteproducciones.com/";
if (window.sidebar) { // Mozilla Firefox 
window.sidebar.addPanel(titulo, url,"");
} else if( window.external ) { // IE 
window.external.AddFavorite( url, titulo); }
else if(window.opera && window.print) { // Opera
/**alert("Para agregar a tu pagina a sus favoritos presione control + D") }**/
window.external.AddFavorite( url, titulo); }
}



function valida_contacto()
{
	if (document.datos.nombre.value=="")
	{
		alert ("Debe cumplimentar su Nombre.");
	}
	else if (document.datos.apellidos.value=="")
	{
		alert ("Debe cumplimentar sus Apellidos.");
	}
	else if (document.datos.telefono.value=="")
	{
		alert ("Debe cumplimentar su Telefono de Contacto.");
	}
	else if (document.datos.consulta.value=="")
	{
		alert ("Debe cumplimentar su Consulta.");
	}
	else
	{
		document.datos.submit();
	}
	
	
}

function nueva_imagen()
{
	contador=parseInt(document.datos.contador_imagenes.value);
	contador_new=contador+1;
	var capa=document.getElementById("div_imagenes_"+contador);
	capa.innerHTML="Descripcion Imagen&nbsp;&nbsp;<input type='text' name='descripcion_"+contador+"' size='50'><br>Nueva Imagen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='file' name='imagen_"+contador+"' size='40'  onChange='javascript:nueva_imagen();'><br><br><div id='div_imagenes_"+contador_new+"'></div>";
	document.datos.contador_imagenes.value=contador_new;
}


function valida_modificacionpassword()
{
	if (document.datos.password_act.value=="")
	{
		alert ("Debe introducir la CONTRASEÑA ACTUAL");
	}
	else if (document.datos.password_new.value=="")
	{
		alert ("Debe introducir la NUEVA CONTRASEÑA");
	}
	else if (document.datos.password_new2.value=="")
	{
		alert ("Debe REPETIR la NUEVA CONTRASEÑA");
	}
	else if (document.datos.password_new2.value!=document.datos.password_new.value)
	{
		alert ("Las NUEVAS CONTRASEÑAS no coinciden");
	}
	else
	{
		document.datos.submit();
	}
}

function shouldset(passon){
if(document.datos.hexvalue.value.length == 7){setcolor(passon)}
}

function setcolor(elem){
document.datos.hexvalue.value=elem
     document.datos.selcolor.style.backgroundColor=elem
}

function setcolor_pop(elem){
opener.document.datos.hexvalue.value=elem
     opener.document.datos.selcolor.style.backgroundColor=elem;
	 window.close();
}

function abre_paleta()
{
	var winattributes="width=330px,height=320px,resizable=no,top=200px,left=150px";
	window.open("colores_fuente.php","", winattributes)	
}

function shouldset_back(passon){
if(document.datos.hexvalue_back.value.length == 7){setcolor_back(passon)}
}

function setcolor_back(elem){
document.datos.hexvalue_back.value=elem
     document.datos.selcolor_back.style.backgroundColor=elem
}

function setcolor_pop_back(elem){
	opener.document.datos.hexvalue_back.value=elem
    opener.document.datos.selcolor_back.style.backgroundColor=elem;
	window.close();
}

function abre_paleta_back()
{
	var winattributes="width=330px,height=320px,resizable=no,top=200px,left=150px";
	window.open("colores_fuente_back.php","", winattributes)	
}

function fechacambia()
{
	document.datos.fecha2.value=document.datos.fecha.value;
}