// Use in hotelrecommended_line.tpl
function changeSwapImgHotelRcmd(hotelid,id,n)
{
	for (i=1; i<=n; i++)
	{
		document.getElementById(hotelid+"-image-"+i).style.display = "none";
		document.getElementById(hotelid+"-thumb-"+i).className = "off";
	} 

	document.getElementById(hotelid + "-image-" + id).style.display = "block";
	document.getElementById(hotelid + "-thumb-" + id).className = "on";
}

// Function used in hotel_full view
function blockdisplay(i) {
    if (document.getElementById){
        if (document.getElementById("blockdisplay"+i)) {
            for ( j = 1; j < 1000; j++ ) {
                if (document.getElementById('blockdisplay' + j)) {document.getElementById('blockdisplay' + j).style.display = 'none';}
                else {j = 1000;}
            }
        if (i) {document.getElementById("blockdisplay"+i).style.display = 'block';}
        }
    }
	// corrige le bug de centrage de la carte des fiches hotels sous IE 6 et 7
	pointInterval();
}

// Function used in hotel_full view
function showPhoto (imgSrc, imgCont){
    if (document.getElementById){
        var c = document.getElementById(imgCont);
        if (c.style.display != "block"){
            c.innerHTML = '<img src="' + imgSrc + '">';
        }
        else {
            c.innerHTML = '<img src="' + tr.icons + '/transparent.gif">';
            c.style.display="none";
        }
    }
}


// Display server time
function currentDateDisplay (objectId,serverGmt)
{
	clientDate = new Date();
	clientGmt = clientDate.getTimezoneOffset()*60*1000;
	unixClientTime = clientDate.getTime();
	unixSeverTime=unixClientTime+(serverGmt*1000)+clientGmt;
	
	myDate = new Date(unixSeverTime);
	
	theDate=myDate.getDate();
	if (theDate<10) theDate="0"+theDate;
	theMonth=myDate.getMonth()+1;
	if (theMonth<10) theMonth="0"+theMonth;
	theYear=myDate.getFullYear();
	theHour = myDate.getHours(unixSeverTime);
	if (theHour<10) theHour="0"+theHour;
	theMinute = myDate.getMinutes();
	if (theMinute<10) theMinute="0"+theMinute;

	dateTagContent = document.getElementById(objectId);
	dateTagContent.innerHTML = theDate+'/'+theMonth+'/'+theYear+'  '+theHour+':'+theMinute;
}
