 function cma_CambiarOpt (Aux) {
	switch (Aux){
		case "opt01": // Opt01
			document.getElementById("CeldaA").style.backgroundImage='url(graphics/img1.gif)';
			document.getElementById("CeldaB").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaC").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaD").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaE").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaF").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaG").style.backgroundImage='url(graphics/img1a.gif)';
			break;
		case "opt02": // Opt02
			document.getElementById("CeldaA").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaB").style.backgroundImage='url(graphics/img1.gif)';
			document.getElementById("CeldaC").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaD").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaE").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaF").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaG").style.backgroundImage='url(graphics/img1a.gif)';
			break;
		case "opt03": // Demo
			document.getElementById("CeldaA").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaB").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaC").style.backgroundImage='url(graphics/img1.gif)';
			document.getElementById("CeldaD").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaE").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaF").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaG").style.backgroundImage='url(graphics/img1a.gif)';
			break;
		case "opt04": // Ejemplos
			document.getElementById("CeldaA").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaB").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaC").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaD").style.backgroundImage='url(graphics/img1.gif)';
			document.getElementById("CeldaE").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaF").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaG").style.backgroundImage='url(graphics/img1a.gif)';
			break;
		case "opt05": // Guia COmercial
			document.getElementById("CeldaA").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaB").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaC").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaD").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaE").style.backgroundImage='url(graphics/img1.gif)';
			document.getElementById("CeldaF").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaG").style.backgroundImage='url(graphics/img1a.gif)';
			break;
		case "opt06": // Contacto
			document.getElementById("CeldaA").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaB").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaC").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaD").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaE").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaF").style.backgroundImage='url(graphics/img1.gif)';
			document.getElementById("CeldaG").style.backgroundImage='url(graphics/img1a.gif)';
			break;
		case "opt06": // Registro
			document.getElementById("CeldaA").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaB").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaC").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaD").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaE").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaF").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaG").style.backgroundImage='url(graphics/img1.gif)';
			break;
		case "opt01m": // Opt1 Estilo Web
			document.getElementById("CeldaAm").style.backgroundImage='url(graphics/img1.gif)';
			document.getElementById("CeldaBm").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaCm").style.backgroundImage='url(graphics/img1a.gif)';
			break;
		case "opt02m": // Opt2 Datos Boda
			document.getElementById("CeldaAm").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaBm").style.backgroundImage='url(graphics/img1.gif)';
			document.getElementById("CeldaCm").style.backgroundImage='url(graphics/img1a.gif)';
			break;
		case "opt03m": // Opt3 Cuestionario
			document.getElementById("CeldaAm").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaBm").style.backgroundImage='url(graphics/img1a.gif)';
			document.getElementById("CeldaCm").style.backgroundImage='url(graphics/img1.gif)';
			break;


	}
}

//--------------------------------------------------------------------------------
function cma_cambioURL(){
	var _url;
	for(i=0;i<document.getElementsByTagName("input").length;i++){
		if(document.getElementsByTagName("input")[i].type == "radio"){
			if(document.getElementsByTagName("input")[i].checked == true){
				_url = document.getElementsByTagName("input")[i].value; 
			}
		}
	}

   switch (_url)
   {

	 //CONFIGURACION DE LOS ESTILOS DE LA PAGINA WEB
   case "PagWeb":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/PagWeb.asp?m=" + document.getElementById("NombreWeb").value;
	  break;
   case "ImgFondo":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/ImgFondo.asp?m=" + document.getElementById("IdFondoPag").value;;
	  break;
   case "CFondo":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/CFondo.asp";
	  break;
   case "CMarco":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/CMarco.asp";
	  break;
   case "CAreaUtil":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/CAreaUtil.asp";
	  break;
   case "Cabecera":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/Cabecera.asp";
	  break;
   case "Titulos":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/Titulos.asp";
	  break;
   case "Texto":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/Texto.asp";
	  break;
   case "Menus":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/Enlaces.asp";
	  break;
   case "CFondoMenu":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/CFondoEnlaces.asp";
	  break;
   case "MenuCambia":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/EnlacesCambia.asp";
	  break;
   case "MenusAdicionales":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/MenusSeguridad.asp";
	  break;
   case "PrevisualizarConf":
	   top.Contenido.location = "inc/ConfiguracionEstiloWeb/Previsualiza.html";
	  break;
	 //CONFIGURACION DE LOS DATOS DE LA BODA
   case "DatosGenerales":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/DatosGenerales.asp";
	  break;
   case "Ceremonia":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/Ceremonia.asp";
	  break;
   case "Banquete":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/Banquete.asp";
	  break;
   case "Lista de bodas":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/ListaBodas.asp";
	  break;	  
   case "Viaje de novios":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/ViajeNovios.asp";
	  break;	  
   case "Las despedidas":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/Despedidas.asp";
	  break;	  
   case "La fiesta":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/FiestaDespues.asp";
	  break;	  
   case "Invitados":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/Invitados.asp";
	  break;	  
   case "Libro de visitas":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/LibroVisitas.asp";
	  break;	  
   case "Encuestas":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/Crearencuesta.html";
	  break;	
   case "Chat":
	   top.Contenido.location = "inc/ConfiguracionInfoBoda/Chat.html";
	  break;	
  }
}

//--------------------------------------------------------------------------------
function Cma_CambioURL1(_url){
   switch (_url)
   {
     //PAGINA PRINCIPAL
   case "Inicio":
	   top.ContenidoP.location = "inc/Inicio.html";
	  // top.AnunciosG.location = "inc/Anuncio01.html";
	   cma_CambiarOpt('opt01');
	  break;	  
   case "Servicios":
	   top.ContenidoP.location = "inc/Servicios.html";
	   //top.AnunciosG.location = "inc/Anuncio02.html";
	  cma_CambiarOpt('opt02');
	  break;
   case "Demo":
	   top.ContenidoP.location = "inc/Demo.html";
	   //top.AnunciosG.location = "inc/Anuncio03.html";
	  cma_CambiarOpt('opt03');
	  break;
   case "Ejemplos":
	   top.ContenidoP.location = "inc/Ejemplos.html";
	  // top.AnunciosG.location = "inc/Anuncio04.html";
	  cma_CambiarOpt('opt04');
	  break;
   case "GComercial":
	   top.location = "GuiaComercial.asp";
	  cma_CambiarOpt('opt05');
	  break;  
   case "Contacto":
	   top.ContenidoP.location = "inc/Contacto.html";
	   //top.AnunciosG.location = "inc/Anuncio05.html";
	  cma_CambiarOpt('opt06');
	  break;  
   case "Registro":
	   top.ContenidoP.location = "inc/Registro.asp";
	   //top.AnunciosG.location = "inc/Anuncio05.html";
	  cma_CambiarOpt('opt07');
	  break; 
   }
}

//--------------------------------------------------------------------------------

function cma_GrabarBD (){
	top.Contenido.location = "inc/ConfiguracionEstiloWeb/GrabarDatos.asp";
	document.getElementById("PendienteGrabarSW").value = false;

}

//--------------------------------------------------------------------------------

function cma_HayDatosxGrabar (_url){
try{
	if (document.getElementById("PendienteGrabarSW").value == "true"){
		r = confirm("Ha realizado cambios y no ha Salvado la Configuración\nPulse Aceptar para guardar los cambios\no Cancelar para continuar sin guardar");
		if (r==false)
			document.getElementById("PendienteGrabarSW").value = false;
		else{
			cma_GrabarBD ();
			//document.getElementById("PendienteGrabarSW").value = false;
		}
	}
}
catch(err){}

	top.location = _url;


}

// ----------------------------------------------------------------------

//Escribir/Leer Cookies
function EscribirCookie (nombre, valor) {
	document.cookie = nombre + "=" + valor;
}

// ----------------------------------------------------------------------

function LeerCookie (nombre){
 var MiCookie = document.cookie;
 if (!MiCookie)  // Si no hay cookie activo todas las capas
	return "";

 var pos = MiCookie.indexOf(nombre);
 if (pos != -1){ // Existe la cookie 
	var pos1 = MiCookie.indexOf ("=", pos);
	if (pos1 != (pos + nombre.length))	return "";
	var pos2 = MiCookie.indexOf(";", pos);
	if (pos2 == -1)	pos2=MiCookie.length;
	
	return unescape(MiCookie.substring(pos1+1, pos2));
 }
else // No existe
	return "";
}

// ---------------------------------------------------------------------------------

function cma_VerPagina(e){
	if (e.keyCode == 13)
		document.location='http://www.serysol.com/bodasenred/boda.asp?b='+document.getElementById('Pag').value
}

// ---------------------------------------------------------------------------------

function SuenaMusica(_onoff){
	miDiv = document.getElementById('MusicaFondo')
	miDiv1 = document.getElementById('OnOff')
	_c  = "";
	var MiID;
	if (_onoff == "ON") {
		_c = "<Embed Src='http://www.serysol.com/bodasenred/Musica/14_Franz_Joseph_Haydn_Menuetto.mp3' Width='0px' Height='0px' volume='60'></Embed>";
		_c1= "<a href='#' onClick='SuenaMusica(&#39;OFF&#39;)'><img src='graphics/SonidoOn.gif' width='32' height='26' border='0'  TITLE='Desactivar música'></a>"
		MiID = setTimeout("SuenaMusica('OFF')",247000);
	}
	else {
		_c = "<br>";
		_c1= "<a href='#' onClick='SuenaMusica(&#39;ON&#39;)'><img src='graphics/SonidoOff.gif' width='32' height='26' border='0' TITLE='Activar música'></a>"
		clearTimeout(MiID);
	}
	
	miDiv.innerHTML =  _c ;
	miDiv1.innerHTML =  _c1;
}
