/**
 * open system
 */
function hhotelResaDist(cname, lg, codeprice, codetrack, firstroom, firstdate, CurrencyLabel)
{
	var waction = "http://www.fastbookings.biz/DIRECTORY/preresa.phtml?Hotelnames="+cname;
	if (lg != "") waction += "&langue="+lg;
	waction += "&style=DIRECT";
	waction += "&clustername=NO";	// no cross-selling
	if (codeprice != "") waction += "&FSTBKNGCode="+codeprice;
	else waction += "&FSTBKNGCode=FB-DISTRIB";
	waction += "&FSTBKNGTrackLink="+codetrack;
	if (firstroom != "") waction += "&FirstRoomName="+firstroom;
	if (firstdate != "") waction += "&FirstDate="+firstdate;
	if (CurrencyLabel != "") waction+= "&CurrencyLabel="+CurrencyLabel;
	waction += "&so=7";
	window.open(waction,"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

/**
 * open explanation for the popularity index
 */
function popupPopularityExplanation(lg)
{
	// info -> virtual dir
	window.open("/info/"+lg+"/popularity.php?dir="+directory, 'popularityWindow','toolbar=no,width=500,height=350,menubar=no,scrollbars=no,resizable=yes,alwaysRaised=yes');
}

function showGoogleMap(showmap)
{
	document.getElementById('google_map').style.display = 'block';
	
    google_array = document.getElementsByName('google_icon');
	
	for (var i = 0; i < google_array.length; ++i)
	{
		google_array[i].style.display = 'inline';
	}
	document.getElementById('search').style.display = 'none';
	if(showmap)
	{
		document.forms['GoogleMapsForm'].submit();
	}
	
}

/**
 * open google map
 */
function mapG(distnum)
{
	var url = "http://map.fastbooking.com/viewhotelG.phtml?distnum="+distnum+"&zoom=14";
	//alert(url);
	window.open(url, 'map', 'width=600,height=500,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
}

/**
 * open sales conditions
 */
function salescondition(url)
{
	var domaine = "http://portal.fastbooking-sa.fr/fiche/conditions.phtml?";
	domaine += url + "&RecomHotel=17";
	window.open(domaine, 'salescond', 'status=no,location=no,toolbar=no,width=600,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes');
	//return false;
}

/**
 * search avalaibility on a given zone
 */
function searchAvailability(zone)
{
	document.searchForm.zone.value=zone;
	document.searchForm.submit();
}

/**
 * open HD movie
 */
function popupMovie(domain, distnum, hoteltitle, nbstar, city, videotime)
{
	var w = 840;
	var h = 550;
	var swf_w = 725;
	var swf_h = 470;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	
	var url = domain+"/"+directory+"/player_HD.swf";
	url+= "?hoteltitle=" + hoteltitle + "&nbstar=" + nbstar + "&city=" + city;
	url+= "&videotime=" + videotime + "&distNum=" + distnum;

	w = window.open("", "movie", "width="+w+",height="+h+",directories=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,top="+wint+",left="+winl+"");
	w.document.write('<html><title>'+hoteltitle+'</title><head></head><body>');
	w.document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='100%' height='100%'>");
    w.document.write('<param name="movie" value="'+url+'">');
    w.document.write("<param name='quality' value='high'>");
    w.document.write("<param name='scale' value='noborder'>");
    w.document.write('<embed src="'+url+'" quality="high" WMODE="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="100%"></embed>');
    w.document.write("</object>");
    w.document.write("</body></html>");
}

function goHotelSheet(domain, distnum, hoteltitle, lg, sess)
{
	var url = domain+"/"+lg+"/"+directory+"/hotel/"+distnum+"_"+hoteltitle+".html?idx=1";
	if(sess != "")
	{
		url+= "&PHPSESSID="+sess;
	}
	location.href=url;
}

function WindowCancel()
{
	waction = "http://portal.fastbooking-sa.fr/fiche/cancel.phtml";
	window.open(waction,"cancel","toolbar=no,width=650,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
	//return false;
}
function WindowDetails()
{
	waction = "http://portal.fastbooking-sa.fr/fiche/history.phtml";
	window.open(waction,"history","toolbar=no,width=600,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
	//return false;
}

function hhistory(url) {
	window.open(url, 'history', 'status=no,location=no,toolbar=no,width=600,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes');
	//return false;
}

function openPrintPage(lg)
{
	window.open('', 'print', 'status=no,location=no,toolbar=no,width=695,height=660,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes');
	document.printpage.submit();
}

function openSendMovie(lg, hoteltitle)
{
	// info : virtual dir
	var url = "/info/"+lg+"/sendmovie.php?hoteltitle="+hoteltitle+"&dir="+directory;
	window.open(url, 'print', 'status=no,location=no,toolbar=no,width=475,height=660,menubar=no,scrollbars=yes,resizable=no,alwaysRaised=yes');
}

function moveHTML()
{
	if(document.getElementById)
	{
		document.getElementById("col_menu").innerHTML = document.getElementById("col_comments").innerHTML;
		document.getElementById("col_comments").innerHTML = "";
	}
	else if(document.all)
	{
		document.all["col_menu"].innerHTML = document.all["col_comments"].innerHTML;
		document.all["col_comments"].innerHTML = "";
	}
}