// JavaScript Document
<!--

//abrir ventana centrada
function ShowPhotoPromos (url,lang,name,foot) {
  var width = 150;
  var height = 150;
  var x=(640 - width)/2
  var y=(480-height)/2

  if(screen) {
	  y=(screen.availHeight - height)/2
	  x=(screen.availWidth - width)/2
  }

  if(screen.availWidht > 1800)
	  x=((screen.availWidth/2) - width)/2
  
  window.width=width
  window.height=height 
  
  window.x=x
  window.y=y

//aqui
  estilo="toolbar=0, status=0, location=0, directories=0, menubar=0, scrollbars=0, resize=0,resizable=0";
  url= url+'&lang='+lang;
  
  url = foot ? url+'&foot='+foot : url ;
  name = name ? name : 'newwin';

  vn = window.open(url, name, estilo + ",width=" + width + "px,height=" + height + "px,top=" + y + "px,left=" + x + "px");
  vn.focus();
}


function getPromoContent(op, lang, promo, tp, cat, nrooms, town, typepr, precio) {
	
	var myConn = new XHConn();
	
	if (!myConn) alert("Navegador sin soporte AJAX. Por favor utilice un navegador más actual.");

	var fnWhenDone = function (oXML) {
		var dv = document.getElementById('area_promos');
		dv.innerHTML = oXML.responseText;			
		//DisparaFlashes(dv);		//aqui no se usa 
		
		
		
		if(op==1 || op==51){//activar la secuencia de imágenes
			
			
				$(document).ready(
					function(){
							
						$('div#secuencia').innerfade({
							animationtype: 'fade',
							speed: 2500,
							timeout: 6000,
							type: 'sequence',
							containerheight: '300px'
						});	
	
				});
			
		}
		
		
	};
	
	params="op=" + op + "&lang=" + lang+ "&idp=" + promo + "&idt=" + tp + "&cat=" + cat;	

	if (nrooms)
		params+= "&nrooms=" + nrooms;
		
	if (town)
		params+= "&town=" + town;		
		
	if (typepr)
		params+= "&typepr=" + typepr;			
	
	if (op==51){	
		hay_precio=(precio=="T") ? precio : 'F';
		params+=" &precio=" + hay_precio;
	}	

	myConn.connect("modules/interfaz_promos_public.php", "POST", params , fnWhenDone);

	refreshmenu(op, lang, promo, tp, cat, nrooms, town,typepr);
}

function refreshmenu(op, lang, promo, tp, cat, nrooms, town,typepr){
	var myConnm = new XHConn();

	if (!myConnm) alert("Navegador sin soporte AJAX. Por favor utilice un navegador más actual.");
	
	var fnWhenDonem = function (oXML) {
		var dvm = document.getElementById('area_menu');		
		dvm.innerHTML = oXML.responseText;		
	};
	
	
	params="op=" + op + "&lang=" + lang+ "&idp=" + promo + "&idt=" + tp + "&cat=" + cat;	
	
	if (nrooms)
		params+= "&nrooms=" + nrooms;
		
	if (town)
		params+= "&town=" + town;	
		
	if (typepr)
		params+= "&typepr=" + typepr;	
	
	myConnm.connect("modules/interfaz_promos_public_menu.php", "POST", params, fnWhenDonem);
}

function ShowHideLayer(ly)
{
	ie = navigator.appName.indexOf('Explorer')>-1;
	
	dm = document.getElementById(ly);
	
	if(dm){
		if (dm.style.display=='none')
		{
			dm.style.display = ie ? 'block' : 'table';
			dm.style.visibility='visible';
		}
		else
		{
			dm.style.display='none';
			dm.style.visibility='hidden';
		}	
	}
}


function GoBackPromotions(filetogo){
	cseccion=document.getElementById('seccion');

	if(cseccion!=null && cseccion.value=='51'){ 

			cop=escape(document.getElementById('op').value);
			clang=escape(document.getElementById('lang').value);
			cpromo=escape(document.getElementById('promo').value);
			ctp=escape(document.getElementById('tp').value);
			ccat=escape(document.getElementById('cat').value);
			
			cnrooms=escape(document.getElementById('nrooms').value);
			ctown=escape(document.getElementById('town').value);
			ctypepr=escape(document.getElementById('typepr').value);			
			
			
			//getPromoContent(op, lang, promo, tp, cat, nrooms, town, typepr, precio)
			getPromoContent(cop, clang, cpromo, ctp, ccat, cnrooms, ctown, ctypepr);

	}
	else window.location=filetogo;
}

-->
