function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480,left = 112,top = 64');");
}


function shd(url){
	$("#home6").css('display', 'none');	
	$("#home5").css('display', 'none');		
	$("#menuibiza").css('display', 'none');
	if (url=="home.php") {
	$("#menusx").css('height', '546px');
	} else if (url.indexOf("id_hotel=6")!=-1) {
	$("#menusx").css('height', '747px');
	$("div#principal-right").css('height', '390px');
	} else {
	$("#menusx").css('height', '723px');
	$("#principal-right").css('height', '367px');	
	}	
	$("#contentArea").html("<img src=\"img/loading.gif\" width=\"32\" height=\"32\" style=\"position:relative;top:180px;left:280px;\">");
	$("#contentArea").load(url);
//	return confirm(url);	
  }

function loadContent(url) {
	//chiudo menu ibiza se è aperto
	$("#home6").css('display', 'none');	
	$("#home5").css('display', 'none');		
	$("#menuibiza").css('display', 'none');
	
	if (url=="home.php") {
	$("#menusx").css('height', '550px');
	} else if (url.indexOf("id_hotel=6")!=-1) {
	$("#menusx").css('height', '756px'); /*750*/
	$("div#principal-right").css('height', '397px'); /*390*/
	} else {
	$("#menusx").css('height', '730px'); /*723*/
	$("#principal-right").css('height', '374px');	/*367*/
	}
	
	$("#contentArea").html("<img src=\"img/loading.gif\" width=\"32\" height=\"32\" style=\"position:relative;top:180px;left:280px;\">");
	$("#contentArea").load(url);
  }
function loadContentIbiza(url) {
	$("#home6").css('display', 'none');	
	$("#home5").css('display', 'none');		
	if (url=="home.php") {
		$("#menusx").css('height', '550px');
	} 
	else if (url.indexOf("id_hotel=6")!=-1) {
			/*$("#menusx").css('height', '750px');*/
			$("div#principal-right").css('height', '390px');	
		} else {
				/*$("#menusx").css('height', '723px');*/
				$("#principal-right").css('height', '367px');	
			}	
			$("#contentArea").html("<img src=\"img/loading.gif\" width=\"32\" height=\"32\" style=\"position:relative;top:180px;left:280px;\">");
			$("#contentArea").load(url);

//return confirm(url);
 }  

function showibizamenu(visibile)  {
	//controllo se mostreare o meno il menu dx
	if (visibile==0) {
		$("#home6").css('display', 'none');	
		$("#home5").css('display', 'none');				
		$("#menuibiza").css('display', 'none');
	} else {
		//mostro il menu ibiza
		$("#menuibiza").css('display', 'block');
		//ricarico il menu sx x azzerarlo
		$("#menusx").css('height', '680px'); /*750*/
		$("#menusx").load("menusx.php");
		//carico ajax la prima pagina di Ibiza
	$("#contentArea").html("<img src=\"img/loading.gif\" width=\"32\" height=\"32\" style=\"position:relative;top:180px;left:280px;\">");
		$("#contentArea").load("ibiza-01.php");
	}

}
function submitforisur() {
$("#reservar").submit();
} 

function cambiahotel(hotel_id) {
		($('#htl')[0]).selectedIndex = hotel_id;
}

function newsletter_send () {
	news_mail=$('#newlettermail').val();
	if (news_mail!="" && news_mail!="email" && news_mail.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/)) {
		loadContent('azuline_03_newsletter.php?newlettermail='+news_mail)
	} else {
	  alert ("Veuillez ecrire votre e-mail correctement. Merci.");
	  }
}

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

