
$(document).ready(function(){
//  $.get("http://www.hotelclipper.com/web/offerte_ajax.php",'',function(htmlz){
//	$("#offertediv").hide();
//	$("#offertediv").html(htmlz);
//  });	
//$(".listino_ok").click(function(e) {e.preventDefault(); $(".hotel-residence-bb-formula").show();});
$("#sx-menu-top a.noc").hover(   function() {	$(".hotel-residence-bb-formula").animate({height: 'hide',opacity: 'hide'},'slow');   });

$("#sx-menu-top a.listino_ok").hover(   function() { $(".hotel-residence-bb-formula").animate({height: 'show',opacity: 'show'},'slow');   });
$("a.listino_ok").hover(
   function() { $(".hotel-residence-bb-formula").animate({height: 'show',opacity: 'show'},'slow');   });
$("#sx-menu-text").hover(
   function() {
$(".hotel-residence-bb-formula").animate({height: 'hide',opacity: 'hide'},'slow');
   });

var contatot=0;var linktoget="/offerte_ajax.php";
function refreshNotification( ){
/*	if (lingua == '') linktoget = "/offerte_ajax.php";
	else if (lingua == 'en') linktoget = "/en/offerte_ajax.php";
	else if (lingua == 'de') linktoget = "/de/offerte_ajax.php";
	else if (lingua == 'fr') linktoget = "/fr/offerte_ajax.php";
	else linktoget="/offerte_ajax.php";
*/

var linktoget="/offerte_ajax.php";
	$.get(linktoget, function(htmlz){ 
//	alert(htmlz);
	contatot = parseInt(htmlz);	
	if (contatot > 1) {
//	alert ("ctot"+contatot);
	$('.offerteul a:gt(0)').hide();
	setInterval(function(){$('.offerteul a.hotelofferta:first-child').hide('fast').next('a.hotelofferta').fadeIn('slow').end().appendTo('.offerteul');	}, 10000);
	}	
	else {
	setInterval(function(){$('.offerteul a.hotelofferta:first-child').fadeIn('slow');	}, 10000);
	}

	});
	};

 //        var autoRefresh = setInterval(refreshNotification, 5000);
		 refreshNotification();


$("#workwithus").toggle(function() {
	$(".lavoracon").animate({
			height: 'show',
			opacity: 'show'
		}, 'slow');
	}, function() {
		$(".lavoracon").animate({
			height: 'hide',
			opacity: 'hide'
		}, 'slow');
	});
$("#listinodisplay").toggle(function() {
	$(".listino").animate({
			height: 'hide',
			opacity: 'hide'
		}, 'slow');
	}, function() {
		$(".listino").animate({
			height: 'show',
			opacity: 'show'
		}, 'slow');
	});
$("#listinodisplayR").toggle(function() {
	$(".listinoR").animate({
			height: 'show',
			opacity: 'show'
		}, 'slow');
	}, function() {
		$(".listinoR").animate({
			height: 'hide',
			opacity: 'hide'
		}, 'slow');
	});

});

var flag = 1;
var conta = 0;
 


function toggleX() {
//	alert(flag);
	if (flag == 1){
	flag= 0;
	$("#offertediv").fadeOut('slow');
	$("#offertediv").fadeIn('fast');
 	}
	else {
	flag= 1;
	$("#offertediv").fadeOut('fast');
  	conta = conta+1;
	$("#offertediv").fadeIn('fast');

	}
}


function stampa_flash(percorso, width, height, id)
{
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=\""+id+"\" width=\""+width+"\" height=\""+height+"\">");
document.write("<param name=\"movie\" value=\""+percorso+"\">");
document.write("<param name=\"menu\" value=\"false\">");
document.write("<param name=\"quality\" value=\"high\">");
document.write("<PARAM NAME=\"wmode\" VALUE=\"transparent\">");
document.write("<param name=\"scale\">");
document.write("<param name=\"bgcolor\" value=\"#ffffff\">");
document.write("<embed src=\""+percorso+"\" wmode=\"transparent\" menu=\"false\" quality=\"high\" scale=\"noborder\" bgcolor=\"#ffffff\" width="+width+" height="+height+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">");
document.write("</embed>");
document.write("</object>");
} 
  function Addjscode(title)
  {
      document.write('<object style="float:left;padding-right:8px;padding-bottom:2px;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.0.0"width="390"       height="282" ID="sf" VIEWASTEXT>');  
      document.write('  <param name="movie" value=' + title + ' />'); 
      document.write('  <param name="quality" value="high" />');  
      document.write('  <param name="wmode" value="window" />');  
      document.write('  <param name="allowScriptAccess" value="always" />'); 
	  document.write(' <param name="bgcolor" value="#ffffff">');
      document.write('  <embed src=' + title + ' quality="high" name="sf" allowScriptAccess="always" allowFullScreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="390"       height="282"></embed>');  
      document.write('</object>');  
  }
function AddjscodeWH(title,larg,alt)
  {
      document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.0.0" width="' + larg + '"       height="' + alt + '" ID="sf" VIEWASTEXT>');  
      document.write('  <param name="movie" value=' + title + ' />'); 
      document.write('  <param name="quality" value="high" />');  
      document.write('  <param name="wmode" value="window" />');  
      document.write('  <param name="allowScriptAccess" value="always" />'); 
//	  document.write(' <param name="bgcolor" value="#ffffff">');
	  document.write("<PARAM NAME=\"wmode\" VALUE=\"transparent\">");

      document.write('  <embed src=' + title + ' wmode="transparent" quality="high" name="sf" allowScriptAccess="always" allowFullScreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + larg + '"       height="' + alt + '"></embed>');  
      document.write('</object>');  
  }

