function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function controlUser(myform)
{
	var theForm = myform.name;
 	
		switch(theForm)
		{
			case "frmHeadercontact":
				if(myform.txtrecherche.value == "Recherche Hotel" || trim(myform.txtrecherche.value) == "")
				{
					alert("Veuillez entrer un mot ou une phrase pour la recherche.");
					return false;
					
				}
				return true;
			break;
			case "frmFootercontact":
				if(trim(myform.txtrecherche.value) == "" || myform.txtrecherche.value == "Tapez ici le nom de l'hôtel que vous recherchez")
				{
					alert("Veuillez entrer un mot ou une phrase pour la recherche.");
					return false;
					
				}
				return true;
			break;
			case "frmTel":
				if(trim(myform.txttel.value) == "")
				{
					alert("Veuillez renseigner un numero de telephone pour valider!");
					return false;
					
				}
				return true;
			break;
			case "frmContentSearch":
				if(trim(myform.txtrecherche.value) == "")
				{
					alert("Veuillez entrer un mot ou une phrase pour la recherche.");
					return false;
					
				}
				return true;
			break;
		}
}

function checksearch(){
if(document.getElementById('txtrecherche').value == '--------- hotel ---------'){
	document.getElementById('txtrecherche').value = "";
}
}
function checksearchvalue(){
if(document.getElementById('txtrecherche').value == ""){
	document.getElementById('txtrecherche').value = "--------- hotel ---------";
}
}

function checksearch2(){
if(document.frmFootercontact.txtrecherche.value == "Tapez ici le nom de l'hôtel que vous recherchez"){
	document.frmFootercontact.txtrecherche.value = "";
}
}
function checksearchvalue2(){
if(document.frmFootercontact.txtrecherche.value == ""){
	document.frmFootercontact.txtrecherche.value = "Tapez ici le nom de l'hôtel que vous recherchez";
}
}

function checksearchmenu(){
	if(document.getElementById('txtrecherche').value == 'Recherche Hotel'){
		document.getElementById('txtrecherche').value = "";
		document.getElementById('txtrecherche').className = "searchbox";
	}
}

function checksearchvaluemenu(){
	if(trim(document.getElementById('txtrecherche').value) == ""){
		document.getElementById('txtrecherche').className = "searchbox";
		document.getElementById('txtrecherche').value = "Recherche Hotel";
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}



// Scrolling Menu

function cachePage()
{
	MM_preloadImages(
	'../css/design.css',
	'../css/textes.css',
	'../resaplanet-images/logo.gif',
	'../resaplanet-images/tel.gif',
	'../resaplanet-images/go_button.jpg',
	'../resaplanet-images/contact/go-button.png',
	'../resaplanet-images/accueil/empty_space_block.gif',
	'../resaplanet-images/accueil/spot_pub.png',
	'../resaplanet-images/accueil/icone-dix-bonnes-raisons.png',
	'../resaplanet-images/boutons_nav_main/devisNav.gif',
	'../resaplanet-images/boutons_nav_main/homeNav.gif',
	'../resaplanet-images/boutons_nav_main/standardNav.gif',
	'../resaplanet-images/logo-inter-iles/resaplanet-signature.gif',
	'../resaplanet-images/logo-inter-iles/resaseychelles-signature.gif',
	'../resaplanet-images/logo-inter-iles/resamaurice-signature.gif',
	'../resaplanet-images/logo-inter-iles/resareunion-signature.gif',
	'../resaplanet-images/logo-inter-iles/logo-voyage-de-luxe.gif',
	'../resaplanet-images/fonds/fond-nuage-header-general.jpg',
	'../resaplanet-images/boutons_nav_main/recherchez.gif',
	'../resaplanet-images/fonds/fond_horizon_sous_menu.gif',
	'../resaplanet-images/fonds/fond_main_accueil.jpg',
	'../resaplanet-images/accueil/set1/boite_blue_resaplanet_plain.gif',
	'../resaplanet-images/accueil/set1/boite_pink_resamaurice_plain.png',
	'../resaplanet-images/accueil/set1/boite_orange_resareunion_custom.png',
	'../resaplanet-images/accueil/set1/boite_blue_resaplanet_newsletter.png',
	'../resaplanet-images/accueil/set1/boite_verte_seychelles_plain.png',
	'../resaplanet-images/fonds/fond_coup-de-coeur_accueil.png',
	'../resaplanet-images/fonds/Footer_accueil.jpg',
	'../resaplanet-images/fonds/fond-contact-foot.jpg',
	'../resaplanet-images/accueil/valider_btn.png',
	'../resaplanet-images/meteo/thermo.png',
	'../resaplanet-images/accueil/fond_meteo.jpg',
	'../resaplanet-images/meteo/ESE.png',
	'../resaplanet-images/check.png',
	'../resaplanet-images/error.png'
	);
}
<!--
// -----------------------------------------------------------------------------
// Globals
var d = new Date();
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 124;

var box = {};
// -----------------------------------------------------------------------------
// -->
/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

function makeDefaultSlideShow(regionId, stopperId)
{
	var slideShowInterface;
	var alternateContent;

		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	
		if(hasRightVersion) {
		
		slideShowInterface = AC_FL_RunContent2( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0','name','slideShowPlayer','width','520','height','452','align','middle','id','slideShowPlayer','src','../swf/slideShowPlayer?p='+regionId+'c='+stopperId+'','loop','false','menu','false','quality','best','scale','noscale','allowscriptaccess','sameDomain','allowfullscreen','false','defer','defer','wmode','opaque','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','../swf/slideShowPlayer?p='+regionId+'&c='+stopperId+'' ); //end AC code
		
		document.getElementById("SLIDESHOWBASE").innerHTML=slideShowInterface;
		
		} else {
		
		alternateContent = '<div id="noFlash"><div id="noFlashContent"><table cellpadding="0" cellspacing="0" border="0"><tr><td align="center">Vous devez avoir <a href="http://www.adobe.com/go/getflashplayer/" target="_blank" title="Télécharger Flash" class="noflashLink">Adobe Flash Player</a>'
		+ ' pour visionner correctement cette page.'
		+ '<a href="http://www.adobe.com/go/getflashplayer/" target="_blank" title="Télécharger Flash" class="noflashLink">Télécharger Flash</a></td><td><a href="http://www.adobe.com/go/getflashplayer/" target="_blank"><img src="../resaplanet-images/accueil/flashplayer_noflash.png" alt="Télécharger Flash" border="0" /></a></td></tr></table></div></div>';
		
		document.getElementById("SLIDESHOWBASE").innerHTML=alternateContent;

		}
		
}

function update(idKey, stopperId) {

	var slideShowInterface;
	var alternateContent;
	
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	
		if(hasRightVersion) {
		
		slideShowInterface = AC_FL_RunContent2( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0','name','slideShowPlayer','width','520','height','452','align','middle','id','slideShowPlayer','src','../swf/slideShowPlayer?p='+idKey+'c='+stopperId+'','loop','false','menu','false','quality','best','scale','noscale','allowscriptaccess','sameDomain','allowfullscreen','false','defer','defer','wmode','opaque','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','../swf/slideShowPlayer?p='+idKey+'&c='+stopperId+'' ); //end AC code
		
		document.getElementById("SLIDESHOWBASE").innerHTML=slideShowInterface;
		
		} else {
		
		alternateContent = '<div id="noFlash"><div id="noFlashContent"><table cellpadding="0" cellspacing="0" border="0"><tr><td align="center">Vous devez avoir <a href="http://www.adobe.com/go/getflashplayer/" target="_blank" title="Télécharger Flash" class="noflashLink">Adobe Flash Player</a>'
		+ ' pour visionner correctement cette page.'
		+ '<a href="http://www.adobe.com/go/getflashplayer/" target="_blank" title="Télécharger Flash" class="noflashLink">Télécharger Flash</a></td><td><a href="http://www.adobe.com/go/getflashplayer/" target="_blank"><img src="../resaplanet-images/accueil/flashplayer_noflash.png" alt="Télécharger Flash" border="0" /></a></td></tr></table></div></div>';
		
		document.getElementById("SLIDESHOWBASE").innerHTML=alternateContent;

		}
}


	 function goToByScroll(id){
		$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
	 }
$(document).ready(function() {
	$().UItoTop({ easingType: 'easeOutQuart' });
	 $('html').click(function() {
	 	$('#suggestions').fadeOut();
	 });
	 
});
