var ID='es';


var peticion = false; 
if (window.ActiveXObject) {
  try{
    peticion = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e1) {
    try{
      peticion = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e2){ }
  }
}
else if (window.XMLHttpRequest) {
  peticion = new XMLHttpRequest();
}

var peticion2 = false; 
if (window.ActiveXObject) {
  try{
    peticion2 = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e1) {
    try{
      peticion2 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e2){ }
  }
}
else if (window.XMLHttpRequest) {
  peticion2 = new XMLHttpRequest();
}

var peticion3 = false; 
if (window.ActiveXObject) {
  try{
    peticion3 = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e1) {
    try{
      peticion3 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e2){ }
  }
}
else if (window.XMLHttpRequest) {
  peticion3 = new XMLHttpRequest();
}

var peticion4 = false; 
if (window.ActiveXObject) {
  try{
    peticion4 = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e1) {
    try{
      peticion4 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e2){ }
  }
}
else if (window.XMLHttpRequest) {
  peticion4 = new XMLHttpRequest();
}

var peticion5 = false; 
if (window.ActiveXObject) {
  try{
    peticion5 = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e1) {
    try{
      peticion5 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e2){ }
  }
}
else if (window.XMLHttpRequest) {
  peticion5 = new XMLHttpRequest();
}

var peticion6 = false; 
if (window.ActiveXObject) {
  try{
    peticion6 = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e1) {
    try{
      peticion6 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e2){ }
  }
}
else if (window.XMLHttpRequest) {
  peticion6 = new XMLHttpRequest();
}

var peticion7 = false; 
if (window.ActiveXObject) {
  try{
    peticion7 = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e1) {
    try{
      peticion7 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e2){ }
  }
}
else if (window.XMLHttpRequest) {
  peticion7 = new XMLHttpRequest();
}

var peticion8 = false; 
if (window.ActiveXObject) {
  try{
    peticion8 = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e1) {
    try{
      peticion8 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e2){ }
  }
}
else if (window.XMLHttpRequest) {
  peticion8 = new XMLHttpRequest();
}



function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = [];
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];      
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }   
    }
    return (arrReturnElements);
}


///////////
function changeID(ID){
	//MENU
	if(init!=true){
		var newMenu='data/interfaz/menu/menu_'+ID+'.htm';
		
		if(peticion) {
			 var obj = document.getElementById('Cmenu');
			 peticion.open("GET", newMenu); 
			 peticion.onreadystatechange = function()  { 
				  if (peticion.readyState == 4) {  
					   obj.innerHTML = peticion.responseText;
				  } 
			 } ;
			 peticion.send(null); 		
		}
	}
	
	
	var newCreditos='data/interfaz/creditos/creditos_'+ID+'.htm';
	var newReservas='data/reservas/reservas_'+ID+'_P.htm';
	var newTlfo='data/interfaz/tlfo/tlfo_'+ID+'.htm';
	var newVenta='data/interfaz/venta/venta_'+ID+'.htm';
	
	if(peticion) {	 
		 //cred2itos
		 var obj2 = document.getElementById('Ccreditos');
		 peticion2.open("GET", newCreditos);
		 peticion2.onreadystatechange = function()  { 
			  if (peticion2.readyState == 4) { 
				   obj2.innerHTML = peticion2.responseText;
			  } 
		 }; 
		 peticion2.send(null);
		 
		 //Reservas
		 var obj3 = document.getElementById('Creservas_in');
		 peticion3.open("GET", newReservas);
                 peticion3.onreadystatechange = function()  {
			  if (peticion3.readyState == 4) {
				   obj3.innerHTML = peticion3.responseText;
                                   carga_cal();
				   $j("a[rel^='FRML']").prettyPhoto();
			  }
		 } ;
		 peticion3.send(null);
		 
		 //Tlfo
		 var obj4 = document.getElementById('Ctlfo_in');
		 peticion4.open("GET", newTlfo);
		 peticion4.onreadystatechange = function()  { 
			  if (peticion4.readyState == 4) { 
				   obj4.innerHTML = peticion4.responseText;
			  } 
		 } ;
		 peticion4.send(null);
		 
		 //puntos_venta
		 var obj5 = document.getElementById('Cventa_in');
		 peticion5.open("GET", newVenta);
		 peticion5.onreadystatechange = function()  { 
			  if (peticion5.readyState == 4) { 
				   obj5.innerHTML = peticion5.responseText;
			  } 
		 } ;
		 peticion5.send(null);
	}
}




function ctrlNave_ID(Bslct) {
	var elementosMenu = getElementsByClassName(document, "li", "ID_on");
	for (k = 0; k< elementosMenu.length; k++) {
		elementosMenu[k].className = "ID_off";
	}
	var identity=document.getElementById(Bslct);
	identity.className="ID_on";
}


//////////CTRL NAVE
/////MENU SECCIONES
function ctrlNave_ML(Bslct_L) {
	var elementosMenu = getElementsByClassName(document, "li", "ML_on");
	for (k = 0; k< elementosMenu.length; k++) {
		elementosMenu[k].className = "ML_off";
	}
	var ML_slct=document.getElementById(Bslct_L);
	ML_slct.className="ML_on";
	
	var elemSLCT = getElementsByClassName(document, "li", "MR_on");
	for (k = 0; k< elemSLCT.length; k++) {
		elemSLCT[k].className = "MR_off";
	}
}

function ctrlNave_MR(Bslct_R) {
	var elementosMenu = getElementsByClassName(document, "li", "MR_on");
	for (k = 0; k< elementosMenu.length; k++) {
		elementosMenu[k].className = "MR_off";
	}
	var identity=document.getElementById(Bslct_R);
	identity.className="MR_on";
	
	var elemSLCT = getElementsByClassName(document, "li", "ML_on");
	for (k = 0; k< elemSLCT.length; k++) {
		elemSLCT[k].className = "ML_off";
	}
}


function Mseccion_reset(){
	var elemSLCT_L = getElementsByClassName(document, "li", "ML_on");
	for (k = 0; k< elemSLCT_L.length; k++) {
		elemSLCT_L[k].className = "ML_off";
	}
	
	var elemSLCT_R = getElementsByClassName(document, "li", "MR_on");
	for (k = 0; k< elemSLCT_R.length; k++) {
		elemSLCT_R[k].className = "MR_off";
	}
}

/////MENU SUBSECCIONES
function ctrlNave_Msub(Bslct_Msub) {
	var Msub_elem = getElementsByClassName(document, "li", "sub_on");
	for (k = 0; k< Msub_elem.length; k++) {
		Msub_elem[k].className = "sub_off";
	}
	var Msub_slct=document.getElementById(Bslct_Msub);
	Msub_slct.className="sub_on";
}


/////MENU APARATADOS
function ctrlNave_Map(Bslct_Map) {
	var Map_elem = getElementsByClassName(document, "li", "ap_on");
	for (k = 0; k< Map_elem.length; k++) {
		Map_elem[k].className = "ap_off";
	}
	var Map_slct=document.getElementById(Bslct_Map);
	Map_slct.className="ap_on";
}


///////// RESERVAS 
function showBarcos(){
	document.getElementById('Cbarcos').style.display='block';
	document.getElementById('Calojamiento').style.display='none';
	if (document.getElementById('Cbarco_priv')) document.getElementById('Cbarco_priv').style.display='none';
	document.getElementById('Sreservas2').style.display='none';
	//check_seccionH();
}


function showAlojamiento(){
	document.getElementById('Calojamiento').style.display='block';
	document.getElementById('Cbarcos').style.display='none';
	if (document.getElementById('Cbarco_priv')) document.getElementById('Cbarco_priv').style.display='none';
	document.getElementById('Sreservas2').style.display='none';
	//check_seccionH();
}

function showBarco_priv(){
	document.getElementById('Cbarco_priv').style.display='block';
	document.getElementById('Calojamiento').style.display='none';
	document.getElementById('Cbarcos').style.display='none';
	document.getElementById('Sreservas2').style.display='block';
	//setTimeout(check_contH,500);
}


////////// SECCIONES
// CIES
function show_cies(){
	/*BANNER*/
	var flashvars = {};
	var params = {menu: "false", wmode: "transparent" };
	var attributes = {};
	swfobject.embedSWF("data/contenido/cies/anim/cies_es.swf", "anim", "616", "268", "9.0.0", "expressInstall.swf",flashvars, params, attributes);

	ctrlNave_Msub('Msub_B1');
	check_seccionH();
	newSubseccion('cies','isla');
}

// ONS
function show_ons(){
	/*BANNER*/
	var flashvars = {};
	var params = {menu: "false", wmode: "transparent" };
	var attributes = {};
	swfobject.embedSWF("data/contenido/ons/anim/ons_es.swf", "anim", "616", "268", "9.0.0", "expressInstall.swf",flashvars, params, attributes);

	ctrlNave_Msub('Msub_B1');
	check_seccionH();
	
	newSubseccion('ons','isla');
}

// FLOTA
function show_flota(){
	/*BANNER*/
	var flashvars = {};
	var params = {menu: "false", wmode: "transparent" };
	var attributes = {};
	swfobject.embedSWF("data/contenido/flota/anim/flota_es.swf", "anim", "616", "268", "9.0.0", "expressInstall.swf",flashvars, params, attributes);

	ctrlNave_Msub('Msub_B1');
	check_seccionH();
	
	newSubseccion('flota','catamaranes');
}

function show_horarios(){
	ctrlNave_Msub('Msub_B1');
	check_seccionH();
	
	//newSubseccionp('horarios','ons');
         newSubseccion('horarios','ons');
}

function show_contacto(){
	check_seccionH();	
}

function show_nabia(){
	check_seccionH();		
}

function show_morrazo(){
	newSubseccion('morrazo','moanha');
	ctrlNave_Msub('Msub_B1');
	
	check_seccionH();
}



////////// SUBSECCIONES
////////// ONS
///// ONS_isla
function show_ons_isla(){
	check_subH();
	newApartado('ons','isla','intro');
}

function show_ons_isla_intro(){
	var flashvars2 = {};
	var params2 = {menu: "false", wmode: "transparent", allowScriptAccess: "always"};
	var attributes2 = {};
	swfobject.embedSWF("data/contenido/ons/isla/Misla_ons.swf", "Misla", "454", "139", "9.0.0", "expressInstall.swf",flashvars2, params2, attributes2);
	 check_apH();
}

function show_ons_isla_fotos(){
  $j("a[rel^='Random']").prettyPhoto();
  check_apH();
}

function show_ons_isla_rutas(){
	$j("a[rel^='Random']").prettyPhoto();
  check_apH();
}

function show_ons_isla_localizacion(){
	$j("a[rel^='Random']").prettyPhoto();
	check_apH();
}



///// ONS_alojamiento
function show_ons_alojamiento(){
	ctrlNave_Map('Map_B1');
	newApartado('ons','alojamiento','alojamientos');
	check_subH();
}

function show_ons_alojamiento_alojamientos(){
	$j("a[rel^='Random']").prettyPhoto();
	check_apH();
}

function show_ons_alojamiento_acampada(){
	$j("a[rel^='Random']").prettyPhoto();
	check_apH();
}

///// ONS_gastronomia
function show_ons_gastronomia(){
	$j("a[rel^='Random']").prettyPhoto();
	check_subH();
}


function show_ons_horarios(){
	check_subH();
}

function show_ons_normas(){
	check_subH();
}

////////// CIES
/////CIES_isla
function show_cies_isla(){
	check_subH();
	newApartado('cies','isla','intro');
}

function show_cies_isla_intro(){
	var flashvars2 = {};
	var params2 = {menu: "false", wmode: "transparent", allowScriptAccess: "always"};
	var attributes2 = {};
	swfobject.embedSWF("data/contenido/cies/isla/Misla_cies.swf", "Misla", "454", "139", "9.0.0", "expressInstall.swf",flashvars2, params2, attributes2);
	check_apH();
}

function show_cies_isla_fotos(){
	$j("a[rel^='Random']").prettyPhoto();
	check_apH();
}

function show_cies_isla_rutas(){
	$j("a[rel^='Random']").prettyPhoto();
	check_apH();
}

function show_cies_isla_localizacion(){
	$j("a[rel^='Random']").prettyPhoto();
	check_apH();
}

function show_cies_normas(){
	check_subH();
}


////////// FLOTA
///// FLOTA _ catamaranes
function show_flota_catamaranes(){
	$j("a[rel^='Random']").prettyPhoto();
	check_subH();
}

function show_flota_privado(){
	$j("a[rel^='Random']").prettyPhoto();
	check_subH();
}

///////// HORARIOS
//// ONS
function show_horarios_ons(){
	check_subH();
}


function show_horarios_moanha(){
	check_subH();
}

function show_horarios_cangas(){
	check_subH();
}


//////// OFERTAS
function show_ofertas(){
	var flashvars = {};
	var params = {menu: "false", wmode: "transparent", allowScriptAccess: "always"};
	var attributes = {};
	swfobject.embedSWF("data/contenido/ofertas/ofertas_es.swf", "anim", "616", "268", "9.0.0", "expressInstall.swf",flashvars, params, attributes);
	check_seccionH();
}

//////// PUNTOS VENTA
function show_venta(){
	var flashvars = {};
	var params = {menu: "false", wmode: "transparent", allowScriptAccess: "always"};
	var attributes = {};
	swfobject.embedSWF("data/contenido/venta/bueu.swf", "Pventa_map1", "367", "238", "9.0.0", "expressInstall.swf",flashvars, params, attributes);
	
	var flashvars2 = {};
	var params2 = {menu: "false", wmode: "transparent", allowScriptAccess: "always"};
	var attributes2 = {};
	swfobject.embedSWF("data/contenido/venta/portonovo.swf", "Pventa_map2", "367", "238", "9.0.0", "expressInstall.swf",flashvars2, params2, attributes2);
	
	var flashvars3 = {};
	var params3 = {menu: "false", wmode: "transparent", allowScriptAccess: "always"};
	var attributes3 = {};
	swfobject.embedSWF("data/contenido/venta/vigo.swf", "Pventa_map3", "367", "238", "9.0.0", "expressInstall.swf",flashvars3, params3, attributes3);
	
	check_ventaH();
}


function show_horarios_morrazo(){
	check_subH();
}

/////// INFO LEGAL
function show_info_legal(){
	check_infoH();
}


//MORRAZO
function show_morrazo_moanha(){
	check_morrazoH();
}

function show_morrazo_cangas(){
	check_morrazoH();
}

//////////////////////////////////
function show_cont(newSeccion_ID){
	init=false;
	this['show_'+newSeccion_ID]();
}

function show_subseccion(newSeccion_ID,newSubseccion_ID){
     //   alert('show_'+newSeccion_ID+'_'+newSubseccion_ID);
	this['show_'+newSeccion_ID+'_'+newSubseccion_ID]();
}

function show_apartado(newSeccion_ID,newSubseccion_ID,newApartado_ID){
	this['show_'+newSeccion_ID+'_'+newSubseccion_ID+'_'+newApartado_ID]();
}

// NEW SECCION
function newSeccion(newSeccion_ID) {

	var newCont='data/contenido/'+newSeccion_ID+'/'+newSeccion_ID+'_'+ID+'.htm';

	if(peticion6){
		 var obj6 = document.getElementById('Ccont_IN');
		 peticion6.open("GET", newCont);
		 peticion6.onreadystatechange = function()  { 
			  if (peticion6.readyState == 4) { 
				  obj6.innerHTML = peticion6.responseText;
				  show_cont(newSeccion_ID);
			  } 
		 } ;
		 peticion6.send(null);
	}
}

//NEW SUBSECCION
function newSubseccion(newSeccion_ID, newSubseccion_ID) {
	var newSub_html='data/contenido/'+newSeccion_ID+'/'+newSeccion_ID+'_'+newSubseccion_ID+'_'+ID+'.htm';
	if(peticion7){
		 var obj7 = document.getElementById('Scont_med');
		 peticion7.open("GET", newSub_html);
		 peticion7.onreadystatechange = function()  { 
			  if (peticion7.readyState == 4) { 
				   obj7.innerHTML = peticion7.responseText;
				  show_subseccion(newSeccion_ID,newSubseccion_ID);
			  } 
		 } ;
		 peticion7.send(null);
	}
}

//NEW APARTADO
function newApartado(newSeccion_ID, newSubseccion_ID, newApartado_ID) {
	var newAp_html='data/contenido/'+newSeccion_ID+'/'+newSeccion_ID+'_'+newSubseccion_ID+'_'+newApartado_ID+'_'+ID+'.htm';
	
	if(peticion8){
		 var obj8 = document.getElementById('Cap');
		 peticion8.open("GET", newAp_html);
		 peticion8.onreadystatechange = function()  { 
			  if (peticion8.readyState == 4) { 
				   obj8.innerHTML = peticion8.responseText;
				  show_apartado(newSeccion_ID,newSubseccion_ID,newApartado_ID);
			  } 
		 } ;
		 peticion8.send(null);
	}
}




//PORTADA
function loadSwf_home(){
	var flashvars = {};
	var params = {menu: "false", wmode: "transparent" };
	var attributes = {};
	swfobject.embedSWF("data/contenido/portada/swf/portada_anim_ons_es.swf", "anim", "616", "318", "9.0.0", "expressInstall.swf",flashvars, params, attributes);
	
	var flashvars2 = {};
	var params2 = {menu: "false"};
	var attributes2 = {};
	swfobject.embedSWF("data/contenido/portada/swf/portada_vid_ons.swf", "portada_vid", "317", "265", "9.0.0", "expressInstall.swf",flashvars2, params2, attributes2);	
}


function showPortada(){
	
	if(init==false){
		var newCont='data/contenido/portada/portada_'+ID+'.htm';
	
		if(peticion6){
		 	var obj6 = document.getElementById('Ccont_IN');
		 	peticion6.open("GET", newCont);
		 	peticion6.onreadystatechange = function()  { 
			if (peticion6.readyState == 4) { 
				obj6.innerHTML = peticion6.responseText;
				loadSwf_home();
			} 
		};
		 peticion6.send(null);
		}
	}
	else{
		loadSwf_home();
	}
}

// BACK HOME
function backHome(){
	init=false;
	var elemL = getElementsByClassName(document, "li", "ML_on");
	for (k = 0; k< elemL.length; k++) {
		elemL[k].className = "ML_off";
	}
	var elemR = getElementsByClassName(document, "li", "MR_on");
	for (k = 0; k< elemR.length; k++) {
		elemR[k].className = "MR_off";
	}
	
	showPortada();
}

function backHome_ons(){
	showPortada_ons();
	var elemL = getElementsByClassName(document, "li", "ML_on");
	for (k = 0; k< elemL.length; k++) {
		elemL[k].className = "ML_off";
	}
	var elemR = getElementsByClassName(document, "li", "MR_on");
	for (k = 0; k< elemR.length; k++) {
		elemR[k].className = "MR_off";
	}
}

/////////
function Launch(){
	init=true;
	changeID('es');
	ctrlNave_ID('ID_B2');
	showPortada('es');
}

//PAGINAS INDIVIDUALES 
//ONS
function load_swfHome_ons(){
	var flashvars = {};
	var params = {menu: "false", wmode: "transparent", allowScriptAccess: "always"};
	var attributes = {};
	swfobject.embedSWF("data/contenido/portada/swf/portada_anim_ons_es.swf", "anim", "616", "318", "9.0.0", "expressInstall.swf",flashvars, params, attributes);
	
	var flashvars2 = {};
	var params2 = {menu: "false"};
	var attributes2 = {};
	swfobject.embedSWF("data/contenido/portada/swf/portada_vid_ons.swf", "portada_vid", "317", "265", "9.0.0", "expressInstall.swf",flashvars2, params2, attributes2);
	
	check_ventaH();
}


function showPortada_ons(){
	var newCont='data/contenido/portada/portada_ons_'+ID+'.htm';
	
	if(peticion6){
		 var obj6 = document.getElementById('Ccont_IN');
		 peticion6.open("GET", newCont);
		 peticion6.onreadystatechange = function()  { 
			  if (peticion6.readyState == 4) { 
				   obj6.innerHTML = peticion6.responseText;
				   load_swfHome_ons();
			  } 
		 };
		 peticion6.send(null);
	}
}



function changeID_ons(ID){
	var newMenu='data/interfaz/menu/menu_'+ID+'.htm';
	var newCreditos='data/interfaz/creditos/creditos_'+ID+'.htm';
	var newReservas='data/reservas/reservas_'+ID+'.htm';
	var newTlfo='data/interfaz/tlfo/tlfo_'+ID+'.htm';
	var newVenta='data/interfaz/venta/venta_'+ID+'.htm';
	
	if(peticion) {
		//menu
		 var obj = document.getElementById('Cmenu');
		 peticion.open("GET", newMenu); 
		 peticion.onreadystatechange = function()  { 
			  if (peticion.readyState == 4) {  
				   obj.innerHTML = peticion.responseText;
			  } 
		 } ;
		 peticion.send(null); 
		 
		 //creditos
		 var obj2 = document.getElementById('Ccreditos');
		 peticion2.open("GET", newCreditos);
		 peticion2.onreadystatechange = function()  { 
			  if (peticion2.readyState == 4) { 
				   obj2.innerHTML = peticion2.responseText;
			  } 
		 }; 
		 peticion2.send(null);
		 
		 //Reservas
		 var obj3 = document.getElementById('Creservas_in');
		 peticion3.open("GET", newReservas);
		 peticion3.onreadystatechange = function()  { 
			  if (peticion3.readyState == 4) { 
				   obj3.innerHTML = peticion3.responseText;
				   carga_cal();
				   $j("a[rel^='FRML']").prettyPhoto();
			  } 
		 } ;
		 peticion3.send(null);
		 
		 //tlfo
		 var obj4 = document.getElementById('Ctlfo_in');
		 peticion4.open("GET", newTlfo);
		 peticion4.onreadystatechange = function()  { 
			  if (peticion4.readyState == 4) { 
				   obj4.innerHTML = peticion4.responseText;
			  } 
		 } ;
		 peticion4.send(null);
		 
		 //vuelos
		 var obj5 = document.getElementById('Cventa_in');
		 peticion5.open("GET", newVenta);
		 peticion5.onreadystatechange = function()  { 
			  if (peticion5.readyState == 4) { 
				   obj5.innerHTML = peticion5.responseText;
			  } 
		 } ;
		 peticion5.send(null);
		 
	}
}

function Launch_ons(){
	var soloOns=true;
	
	ctrlNave_ID('ID_B2');
	changeID_ons('es');
	showPortada_ons('es');
}




//AJUSTE ALTURA _ EXPLORER
function check_seccionH(){
	var seccionH = document.getElementById('cont').offsetHeight;
	actH=seccionH;
	document.getElementById('Ccont_IN').style.height=seccionH+'px';
}

function check_morrazoH(){
	var seccionH = document.getElementById('listado_horarios').offsetHeight;
	actH=seccionH;
	document.getElementById('Ccont_IN').style.height=seccionH+90+'px';
}


function check_contH(){
	var contH = document.getElementById('cont').offsetHeight;
	var reserveH=document.getElementById('Cright').offsetHeight;
	if(reserveH>contH){
		document.getElementById('Ccont_IN').style.height=reserveH+'px';
	}
	else{
		document.getElementById('Ccont_IN').style.height=contH+'px';
	}
}




function check_subH(){
	var seccionH = document.getElementById('cont').offsetHeight;
	var subH = document.getElementById('Scont_med').offsetHeight;
	actH=seccionH+subH;
	document.getElementById('Ccont_IN').style.height=actH+40+'px';
}

function check_apH(){
	var apH = document.getElementById('Cap').offsetHeight;
	var contH=actH+apH;
	document.getElementById('Ccont_IN').style.height=contH;
}

function check_ventaH(){
	var seccionH = document.getElementById('cont').offsetHeight;
	seccionH=950;
	actH=seccionH;
	document.getElementById('Ccont_IN').style.height=seccionH;
}

function check_infoH(){
	var seccionH = document.getElementById('cont').offsetHeight;
	seccionH=690;
	actH=seccionH;
	document.getElementById('Ccont_IN').style.height=seccionH;
}










/*funciones mod victor para cargar php*/
// NEW SECCION
function newSeccionp(newSeccion_ID) {
	var newCont_php='data/contenido/'+newSeccion_ID+'/'+newSeccion_ID+'_'+ID+'.php';
	
	if(peticion6){
		 var obj6 = document.getElementById('Ccont_IN');
		 peticion6.open("GET", newCont_php);
		 peticion6.onreadystatechange = function()  { 
			  if (peticion6.readyState == 4) { 
				   obj6.innerHTML = peticion6.responseText;
				  show_cont(newSeccion_ID);
			  } 
		 } ;
		 peticion6.send(null);
	}
}

//NEW SUBSECCION
function newSubseccionp(newSeccion_ID, newSubseccion_ID) {
	var newSub_php='data/contenido/'+newSeccion_ID+'/'+newSeccion_ID+'_'+newSubseccion_ID+'_'+ID+'.php';  // ! CON PHP ACTIVADO
	//var newSub_php='data/contenido/'+newSeccion_ID+'/'+newSeccion_ID+'_'+newSubseccion_ID+'_'+ID+'.htm';
	// alert('AKIIIIII!!!!'+newSub_php);

	if(peticion7){
		 var obj7 = document.getElementById('Scont_med');
		 peticion7.open("GET", newSub_php);
		 peticion7.onreadystatechange = function()  {
			  if (peticion7.readyState == 4) {
                                  // alert(peticion7.responseText);
				   obj7.innerHTML = peticion7.responseText;
				  // show_subseccion(newSeccion_ID,newSubseccion_ID);
			  }
		 } ;
		 peticion7.send(null);
	}
}

//NEW APARTADO
function newApartadop(newSeccion_ID, newSubseccion_ID, newApartado_ID) {
	//var newAp_php='data/contenido/'+newSeccion_ID+'/'+newSeccion_ID+'_'+newSubseccion_ID+'_'+newApartado_ID+'_'+ID+'.php'; ! CON PHP ACTIVADO
	var newAp_php='data/contenido/'+newSeccion_ID+'/'+newSeccion_ID+'_'+newSubseccion_ID+'_'+newApartado_ID+'_'+ID+'.htm';
	
	if(peticion8){
		 var obj8 = document.getElementById('Cap');
		 peticion8.open("GET", newAp_php);
		 peticion8.onreadystatechange = function()  { 
			  if (peticion8.readyState == 4) { 
				   obj8.innerHTML = peticion8.responseText;
				   show_apartado(newSeccion_ID,newSubseccion_ID,newApartado_ID);
			  } 
		 } ;
		 peticion8.send(null);
	}
}


function sendRequest() {
		new Ajax.Request("email_form_process.php", {
			   method: 'post',
			   postBody: "nombre="+$F("nombre")+"&correo="+$F("correo")+"&asunto="+$F("asunto")+"&mensaje="+$F("mensaje")+"&tlfo="+$F("tlfo"),
			   onComplete: show_contactReturn

		});
}


function show_contactReturn(req){
	  
		
	   $('respuesta').style.borderStyle= "solid";
	   
	   var res=/message was received/;
	  
	   if(req.responseText.match(res))
	   {
		$('respuesta').style.borderColor= "green";
		$('respuesta').style.color="green";
	   }else{
		$('respuesta').style.borderColor= "red";
		$('respuesta').style.color="red";
	   }
	   
	   $('respuesta').style.borderSize= "1px";
	   $('respuesta').innerHTML=  req.responseText;
	
	   document.getElementById('Csub').style.display='none';
	}

function show_hide_horarios(prefijo,total,cual){

  for (var c=0;c<=total-1;c++){
    document.getElementById(prefijo+c).style.display="none";
  }
  document.getElementById(prefijo+cual).style.display="block";
}
