//common.js
window.console = { log: function() {} }

// ldeals
function displayhint(ob_airport){
	hint('Help: ','Price is from ' + ob_airport,event,0,false, 0, 'latedeals');
}

//Flash plugin detect
var flash = new Object();	
flash.installed = false;
if (navigator.plugins && navigator.plugins.length) {
	for (x=0; x < navigator.plugins.length; x++) {	
		if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {		
			flash.installed = true;					
			flash.version = eval(navigator.plugins[x].description.split('Shockwave Flash ')[1].split('.')[0]);					
			break;
		}
	}
} else if (window.ActiveXObject) {
	for (x = 2; x <= 20; x++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
			if(oFlash) {		
				flash.installed = true;	
				flash.version = x;
			}
		}
		catch(e) {}
	}
}

flash.insertBOJ = function() {
	if(flash.installed && (flash.version >= 8)) {
 		flashObject = '<embed src="/flash/homepage.swf" menu="false" quality="high" FlashVars="sXmlPath=%2Fflash%2Fxml%2Fhomepage%2Exml" width="380px" height="188px" type="application/x-shockwave-flash" salign="T" bgcolor="#4299F0" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		document.write(flashObject);
		document.getElementById("noFlashContent").style.display = "none";
	} else {
		document.getElementById("noFlashContent").style.display = "block";
		document.getElementById("flashContent").style.display = "block";
	}	
}

flash.insertRotBanner = function() {
	if(flash.installed && (flash.version >= 8)) {
 		flashObject = '<embed src="/flash/Rotating_Banners.swf" wmode="transparent" menu="false" quality="high" FlashVars="sXmlPath=%2Fflash%2Fxml%2Fhomepage%2Exml" width="380px" height="188px" type="application/x-shockwave-flash" salign="T" bgcolor="#4299F0" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		document.write(flashObject);
		document.getElementById("noFlashContent").style.display = "none";
	} else {
		document.getElementById("noFlashContent").style.display = "block";
		document.getElementById("flashContent").style.display = "block";
	}	
}

flash.insertRotBannerIE = function() {
	if(flash.installed && (flash.version >= 8)) {
 		flashObject = '<embed src="/flash/Rotating_BannersIE.swf" wmode="transparent" menu="false" quality="high" FlashVars="sXmlPath=%2Fflash%2Fxml%2Fhomepage%2Exml" width="380px" height="188px" type="application/x-shockwave-flash" salign="T" bgcolor="#4299F0" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		document.write(flashObject);
		document.getElementById("noFlashContent").style.display = "none";
	} else {
		document.getElementById("noFlashContent").style.display = "block";
		document.getElementById("flashContent").style.display = "block";
	}	
}

flash.insertMap = function (country_id, boj, width, height) {
	if (flash.installed && (flash.version >= 8)) {
		var xmlfilename = "countries" + country_id;
		if (boj) {
			xmlfilename = "countries" + boj + country_id;
		}
		document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab##version=8,0,0,0\" width=\"" + width + "\" height=\"" + height + "\" id=\"map\" align=\"middle\">");
		document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
		if(country_id == 22){
			document.write("<param name=\"movie\" value=\"/flash/map_de.swf\" />");
		}
		else{
			document.write("<param name=\"movie\" value=\"/flash/map.swf\" />");
		}
		document.write("<param name=\"quality\" value=\"high\" />");
		document.write("<param name=\"bgcolor\" value=\"#fcffee\" />");
		document.write("<param name=\"FlashVars\" value=\"sXmlPath=%2Fflash%2Fxml%2F" + xmlfilename + "%2Exml\" />");
		document.write("<embed src=\"/flash/map.swf\" quality=\"high\" FlashVars=\"sXmlPath=%2Fflash%2Fxml%2F" + xmlfilename + "%2Exml\" bgcolor=\"#fcffee\" width=\"" + width + "\" height=\"" + height + "\" name=\"map\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
		document.write("</object>");
	}
	else {
			//if flash is undetected and the BOJ page, write in the image map
			if (boj) {
		
		document.write("<img src=\"/images/misc/Web-Non-Flash-Map-BOJ.jpg\" width=\"710\" height=\"300\" border=\"0\" usemap=\"#MapBoj\" /><map name=\"MapBoj\" id=\"MapBoj\"><area shape=\"poly\" coords=\"70,138,83,138,93,140,106,142,111,152,149,155,157,158,155,165,121,166,114,178,106,186,71,144\" href=\"/q_search.cfm?search_mode=low_mid_high&region_id=8&boj=1\" alt=\"Florida\" /><area shape=\"poly\" coords=\"229,247,285,247,284,262,242,266,227,255\" href=\"/q_search.cfm?search_mode=low_mid_high&region_id=59&boj=1\" alt=\"Barbados\" /><area shape=\"poly\" coords=\"317,213,396,215,392,233,340,253,333,256\" href=\"/q_search.cfm?search_mode=low_mid_high&region_group_id=4&boj=1\" alt=\"Canary Islands\" /><area shape=\"poly\" coords=\"383,143,386,147,392,145,395,145,394,150,394,152,393,154,393,159,391,163,388,166,391,169,391,175,388,176,388,179,380,180,329,170,327,152\" href=\"/q_search.cfm?search_mode=low_mid_high&country_id=3&boj=1\" alt=\"Portugal\" /><area shape=\"poly\" coords=\"381,142,380,138,352,139,349,123,377,121,386,130,421,133,450,143,436,169,421,182,398,189,390,179\" href=\"/q_search.cfm?search_mode=low_mid_high&country_id=5&boj=1\" alt=\"Spain\" /><area shape=\"poly\" coords=\"468,154,468,172,502,177,510,177,510,184,436,188,433,177,448,153\" href=\"/q_search.cfm?search_mode=low_mid_high&region_group_id=3&boj=1\" alt=\"Balearic Islands\" /><area shape=\"poly\" coords=\"495,190,523,188,562,197,563,208,496,212,490,198\" href=\"/q_search.cfm?search_mode=low_mid_high&country_id=7&boj=1\" alt=\"Malta &amp; Gozo\" /><area shape=\"poly\" coords=\"479,129,477,124,472,118,475,111,485,106,492,107,497,101,506,101,509,104,516,105,515,110,508,114,508,124,510,128,515,130,519,140,529,147,544,156,539,164,538,172,529,176,526,163,518,170,505,174,485,170,481,148,490,148,495,144,495,137,492,133,492,129\" href=\"/q_search.cfm?search_mode=low_mid_high&country_id=15&boj=1\" alt=\"Italy\" /><area shape=\"poly\" coords=\"512,96,550,95,550,118,537,118,537,132,525,129,515,119\" href=\"/q_search.cfm?search_mode=low_mid_high&country_id=24&boj=1\" alt=\"Croatia\" /><area shape=\"poly\" coords=\"553,136,590,139,593,151,591,162,592,174,593,181,593,193,592,200,584,204,565,192,550,173\" href=\"/q_search.cfm?search_mode=low_mid_high&country_id=14&boj=1\" alt=\"Greece\" /><area shape=\"poly\" coords=\"596,156,600,133,623,125,692,146,697,153,701,157,701,161,701,165,703,170,703,177,703,182,652,188,630,189,609,189,599,191,595,163\" href=\"/q_search.cfm?search_mode=low_mid_high&region_id=40&boj=1\" alt=\"Turkey\" /><area shape=\"poly\" coords=\"592,195,594,206,641,206,649,191\" href=\"/q_search.cfm?search_mode=low_mid_high&country_id=6&boj=1\" alt=\"Cyprus\" /><area shape=\"poly\" coords=\"591,214,624,211,641,231,642,243,634,248,650,280,639,289,584,288,584,219\" href=\"/q_search.cfm?search_mode=low_mid_high&region_id=51&boj=1\" alt=\"Egypt\" /></map>");
			}
			//flash is undetected but not a best of james page, so write in an alternative image map
			else{
				document.write("<img src=\"/images/misc/Web-Non-Flash-Map.jpg\" border=\"0\" usemap=\"#Map\" /><map name=\"Map\" id=\"Map\"><area shape=\"poly\" coords=\"70,138,87,139,108,141,154,155,155,171,125,167,117,172,115,183,106,188,69,145\" href=\"/regions/Florida.cfm\" alt=\"Florida\" /><area shape=\"poly\" coords=\"385,144,391,145,396,145,395,150,391,161,391,166,392,172,391,177,384,183,379,179,328,170,327,155\" href=\"/regions/algarve/\" alt=\"Portugal\" /><area shape=\"poly\" coords=\"381,144,346,137,347,119,421,133,451,142,451,148,437,156,431,163,432,169,429,178,418,183,399,190,390,180\" href=\"/spain-holidays.cfm\" alt=\"Spain\" /><area shape=\"poly\" coords=\"424,130,427,112,384,115,377,98,407,89,423,80,445,66,480,83,476,97,473,112,478,127,472,133,452,132,452,143,426,135\" href=\"/france-holidays.cfm\" alt=\"France\" /><area shape=\"poly\" coords=\"432,190,513,190,511,176,471,170,468,155,454,155,440,163,435,177,430,183\" href=\"/regions/TheBalearicIslands.cfm\" alt=\"Balearic Islands\" /><area shape=\"poly\" coords=\"231,248,283,246,282,259,246,266,229,261,223,251\" href=\"/regions/barbados/\" alt=\"Barbados\" /><area shape=\"poly\" coords=\"493,190,493,206,562,209,566,196,521,187\" href=\"/regions/malta/\" alt=\"Malta &amp; Gozo\" /><area shape=\"poly\" coords=\"376,60,370,56,364,54,335,54,332,40,372,37,377,31,384,31,395,32,398,39,396,51,390,58\" href=\"/regions/ireland/\" alt=\"Ireland\" /><area shape=\"poly\"coords=\"479,127,484,125,487,123,493,128,497,133,499,138,499,141,499,144,495,148,488,149,478,151,480,160,483,166,492,171,510,175,514,181,518,185,523,186,529,185,538,183,544,174,550,166,549,155,534,142,523,127,517,113,514,105,505,103,492,103,484,107,480,112,476,112,475,116,476,121\" href=\"/italy-holidays.cfm\" alt=\"Italy\" /><area shape=\"poly\" coords=\"512,93,550,95,551,117,537,119,532,120,537,128,538,136,525,127,512,103\" href=\"/regions/croatia/\" alt=\"Croatia\" /><area shape=\"poly\" coords=\"584,222,582,227,581,232,582,239,584,240,584,250,584,264,584,275,584,287,588,289,615,289,631,289,640,289,645,284,651,282,651,278,650,272,645,265,643,257,639,249,643,236,643,231,635,223,623,215,608,212,593,214,587,217\" href=\"/regions/egypt/\" alt=\"Egypt\" /><area shape=\"poly\" coords=\"394,214,317,212,316,235,336,257,375,246,392,230,398,222\" href=\"/regions/TheCanaryIslands.cfm\" alt=\"Canary Islands\" /><area shape=\"poly\" coords=\"551,137,595,137,593,153,592,156,593,165,594,168,595,174,595,184,592,200,583,201,575,197,568,192,561,186,554,180,551,166\" href=\"/greece-holidays.cfm\" alt=\"Greece\" /><area shape=\"poly\" coords=\"608,195,595,195,593,206,629,209,642,203,646,191,602,193\" href=\"/regions/cyprus/\" alt=\"Cyprus\" /><area shape=\"poly\" coords=\"596,156,612,151,605,140,603,129,623,128,641,128,658,128,680,136,695,149,702,157,702,172,706,178,703,185,694,188,675,188,664,188,654,187,651,187,644,185,633,187,632,189,625,189,616,189,609,189,606,189,599,180,596,164\" href=\"./regions/turkey/\" alt=\"Turkey\" /></map>");
				
			}
	}
}

flash.insertMiniOrlando = function() {
	if(flash.installed && (flash.version >= 8)) {
 		flashObject = '<embed src="http://www.ivc4.com/jamesvillas/jvnewbutton.swf" quality="high" wmode="transparent" flashvars="flv=http://www.ivc4.com/jamesvillas/orlando230x130.flv&video_duration=12&bufferSecs=6&linkTo=http://www.jamesvillas.co.uk/regions/florida/index.cfm?orlandovideo=yes" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="230" height="130"></embed>';
		document.write(flashObject);
	}	
}

flash.insertMiniGulfCoast = function() {
	if(flash.installed && (flash.version >= 8)) {
 		flashObject = '<embed src="http://www.ivc4.com/jamesvillas/jvnewbutton.swf" quality="high" wmode="transparent" flashvars="flv=http://www.ivc4.com/jamesvillas/gulf230x130.flv&video_duration=10&bufferSecs=6&linkTo=http://www.jamesvillas.co.uk/regions/florida/index.cfm?gulfcoastvideo=yes" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="230" height="130"></embed>';
		document.write(flashObject);
	}	
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

function trim(stringToTrim){
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function animatePleaseWait(id) {	// Booking summary pages
	if (id == undefined) id = 'imgPleaseWait';
	if (document.getElementById(id)) document.getElementById(id).src = "/images/misc/progress.gif";
}						

function paste_handle()	{
	window.clipboardData.clearData();
}

function show_full_image(image) {
	document.getElementById('full_image').src = image;
}

function popup(url) {
	var popup = window.open(url,'jvhwindow','height=450,width=450,resizable=yes,scrollbars=yes');
	if (window.focus) {popup.focus()}
}

function roll(element) {
	if (element) {
		var len = element.src.length;
		var state = element.src.substring(len-5,len-4);
		var new_state = (state == "a") ? "b" : "a";
		element.src = element.src.substring(0, len-5) + new_state + element.src.substring(len-4);
	}
}

var tempX = 0, tempY = 0;

function getMouseXY(e) {
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		tempX = e.pageX;
		tempY = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		tempX = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		tempY = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
}


// Rotating banner images
function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

function changeOpac(opacity, id) {
	opac = (opacity == 100)?99:opacity;
	var object = document.getElementById(id).style;
	object.opacity = (opac / 100);
	object.MozOpacity = (opac / 100);
	object.KhtmlOpacity = (opac / 100);
	object.filter = "alpha(opacity=" + opac + ")";
} 

function blendimage(divid, imageid, imagefile, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	orig_src = document.getElementById(imageid).src;
	changeOpac(0, imageid);
	document.getElementById(imageid).src = imagefile;
	document.getElementById(divid).style.backgroundImage = "url(" + orig_src + ")";
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}
}

function submitForm(){
	if(checkDate()) {
		document.quicksearch_daily.region_id.value = document.getElementById("region_select").value;
		document.quicksearch_daily.resort_id.value = document.getElementById("resort_select").value;
		document.quicksearch_daily.duration.value = document.getElementById("duration_select").options[document.getElementById("duration_select").selectedIndex].value;
		document.quicksearch_daily.action = form_action;
		document.quicksearch_daily.submit();
	}
}



/*** Print Preview functions ***/
	function addLoadEvent(func) {
	  var oldonload = window.onload;
	  if (typeof window.onload != 'function') {
		window.onload = func;
	  } else {
		window.onload = function() {
		  if (oldonload) {
			oldonload();
		  }
		  func();
		}
	  }
	}

	addLoadEvent( function(){ add_print_link( 'nav' ) } );

	function add_print_link( id ){
	  if( !document.getElementById ||
		  !document.getElementById( id ) ) return;
	
	  // add extra functions to page tools list
	  var print_page = document.getElementById( id );
	
	  // create print link
	  var print_function = document.createElement('p');
	  print_function.className = 'print-link';
	  print_function.onclick = function(){ print_preview(); return false; };
	  print_function.appendChild( document.createTextNode( 'Print the Page' ) );
	
	}

	function print_preview() {
		// Switch the stylesheet
		setActiveStyleSheet('Print Preview');
		
		// Create preview message
		add_preview_message();
	
		// Print the page
		window.location.hash = "top";
		window.print();
	}

	function add_preview_message(){
		var main_content = document.getElementById('bodyPage');
	
		if (main_content != undefined){
			
			var main_body = main_content.parentNode;
			
			var preview_message = document.createElement('div');
			preview_message.id = 'preview-message';
		
			// Create Heading
			var preview_header = document.createElement('h3');
			var preview_header_text = document.createTextNode(print_message);		// 'This is a print preview of this page'
			preview_header.appendChild(preview_header_text);
			
			// Create paragraph
			var preview_para = document.createElement('p');
			
			var cancel_function_link = document.createElement('a');
				cancel_function_link.onclick = function(){ cancel_print_preview(); return false; };
				cancel_function_link.setAttribute('href', '#');	
			var cancel_function_link_text = document.createTextNode(print_link);	// 'Return to the existing page.'
			cancel_function_link.appendChild(cancel_function_link_text);
			preview_para.appendChild(cancel_function_link);
			
			// Put it all toegether
			preview_message.appendChild(preview_header); 
			preview_message.appendChild(preview_para);
			main_body.insertBefore(preview_message, main_content);
	
		}
	}

	function cancel_print_preview() {
		// Destroy the preview message
		var print_preview = document.getElementById('preview-message');
		var main_body = print_preview.parentNode;
		main_body.removeChild(print_preview);
		
		// Switch back stylesheet
		setActiveStyleSheet('default');
	}

	function setActiveStyleSheet(title) {
	   var i, a, main;
	   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		 if(a.getAttribute("rel").indexOf("style") != -1
			&& a.getAttribute("title")) {
		   a.disabled = true;
		   if(a.getAttribute("title") == title) a.disabled = false;
		 }
	   }
	}
/*** END/Print Preview functions ***/

/*** Menubar functions ***/
	var lastId = "";
	var delayHide = "";
	var actionDelay = "";
	var lastTopBackground = "";
	var defaultMenuItem = "";
	var menubar_country_id = "";
	var patternMenuItems = "";	
					  
	function highlightTab(numb) {
		for (var i=0;i<20;i++) {
			var tab = document.getElementById('top' + i + '_' + menubar_country_id);
			var subline = document.getElementById('sub' + i);		
			if (tab) {
				if (patternMenuItems.indexOf("," + i + ",") > -1) {
					tab.className = (i == numb) ? "topLevelMenuItemDefaultPattern" : "topLevelMenuItemPattern";
				} else {
					tab.className = (i == numb) ? "topLevelMenuItemDefault" : "topLevelMenuItem";
				}
				if (subline) {
					subline.style.display = (i == numb) ? "inline" : "none";			
				}
			} else {
				break;
			}
		}
	}
	
	/*	JRivers 05/10/07
	*	This function either shows or hides a sub list in the menu depending on 2 variables
	*		id =  The sub list ID that is in question (the caller)
	*		hideDelay = whether the list must auto hide after a delay. (This is either TRUE or FALSE)
	*/
	function showHideActions(id, hideDelay) {	
		if(hideDelay == "setup"){
			var defaultElement = document.getElementById(defaultMenuItem);
			defaultElement.style.display = 'inline';
			highlightTab(defaultMenuItem.substr(3));
		}
		
		if(hideDelay == true){
			if(id == defaultMenuItem){
				//do nothing as its already shown
			}
			else{
				//Hide Current
				var element = document.getElementById(id);
				element.style.display = 'none';
				//Show the default Item
				var defaultElement = document.getElementById(defaultMenuItem);
				defaultElement.style.display = 'inline';
				highlightTab(defaultMenuItem.substr(3));
				
			}
		}
		if(hideDelay == false){
			//if the current id is not the default
			if(defaultMenuItem != id){
				//Hide last item
				var lastElement = document.getElementById(lastId);
				lastElement.style.display = 'none';
				//Show current
				var element = document.getElementById(id);
				element.style.display = 'inline';
				highlightTab(id.substr(3));
				//Hide default
				var defaultElement = document.getElementById(defaultMenuItem);
				defaultElement.style.display = 'none';
			}
			else if(id == defaultMenuItem && lastId != id){
				//Show the default item
				var defaultElement = document.getElementById(defaultMenuItem);
				defaultElement.style.display = 'inline';
				highlightTab(defaultMenuItem.substr(3));
				//Hide last item
				var lastElement = document.getElementById(lastId);
				lastElement.style.display = 'none';
			}
		}
		lastId = id;
		
		// This aligns the text to the center of the block.
		var subs = document.getElementById(id);
		if (subs) {
			var lis = subs.getElementsByTagName('li');
			if (lis && lis.length) {
				var width = 0;
				for(var i=0;i<lis.length;i++) {
					width += lis[i].offsetWidth;
				}
				if (lis[0]) lis[0].style.marginLeft = ((977 - ((lis.length - 1) * 12) - width) / 2) + "px";
			}
		}
		
	}
	
	function showHide(id, hideDelay){
		clearTimeout(delayHide);
		passedId = id;
		passedHideDelay = hideDelay;
		actionDelay = setTimeout("showHideActions(passedId, false);", 400);
	}
	
	// This function allows a sub list to be hidden after a time lapse
	function hideDelay(id){
		passedId = id;
		clearTimeout(actionDelay);
		delayHide = setTimeout("showHideActions(passedId, true);", 175);
	}
/*** END/Menubar functions ***/

/*** JCMS Block functions ***/
	function switchLateDealBlock(nights) {		
		if(document.getElementById('latedeals_7')) {
			var ld7 = document.getElementById('latedeals_7');
			var ld14 = document.getElementById('latedeals_14');
			var ldt7 = document.getElementById('latedeals_tab_7');
			var ldt14 = document.getElementById('latedeals_tab_14');			
			ldt7.className = (nights == 7) ? "ldtabon" : "ldtab";
			ldt14.className = (nights == 14) ? "ldtabon" : "ldtab";			
			ld7.style.display = (nights == 7) ? "block" : "none";
			ld14.style.display = (nights == 14) ? "block" : "none";			
		}
	}
/*** END/JCMS Block functions ***/

/*** Rotating Banner ***/
	
	var rotating_banner_start = new Array();
	var rotating_banner_index = new Array();
	var rotating_banner_timeout = new Array();
	var rotating_banner_trans_time = new Array();
	var rotating_banner_pics = new Array();
	var rotating_banner_div = new Array();
	var rotating_banner_stopped = new Array();
	
	function jump_to_banner (id, pic) {		
		if(rotating_banner_index[id] != pic){
			var previousIndx = rotating_banner_index[id];	
			rotating_banner_index[id] = pic;
			blendimageout_rotating_banner(id,rotating_banner_div[id]+rotating_banner_index[id],rotating_banner_div[id]+previousIndx,600);
		}		
		rotating_banner_stopped[id] = true;	
		//rotating_banner_tab_highlight(id);
	}

	
	function init_rotating_banner (id, div, total_pics, timeout, trans_time) {
		
		rotating_banner_start[id] = new Date();
		rotating_banner_index[id] = 0;
		rotating_banner_timeout[id] = timeout;
		rotating_banner_trans_time[id] = trans_time;
		rotating_banner_pics[id] = total_pics;
		rotating_banner_div[id] = div;
		rotating_banner_stopped[id] = false;
				
		for(var i = 1; i < total_pics; i++) {
			var e = document.getElementsByName(div+i);
			for(var j=0;j!=e.length;j++) { e[j].style.display = "none"; }
		}
		
		setTimeout("change_pic_rotating_banner(" + id + ")",rotating_banner_timeout[id]);
	}
	
	function change_pic_rotating_banner (id) {
		if (!rotating_banner_stopped[id]) {
			var previousIndx = rotating_banner_index[id];	
			if (rotating_banner_index[id] < rotating_banner_pics[id]-1) {
				rotating_banner_index[id]++;
			}
			else {
				rotating_banner_index[id] = 0;
			}
		blendimageout_rotating_banner(id,rotating_banner_div[id]+rotating_banner_index[id],rotating_banner_div[id]+previousIndx,rotating_banner_trans_time[id]);
			//rotating_banner_tab_highlight(id);
		}
	}	
	
	function rotating_banner_tab_highlight(id){
		for(var i = 0; i < rotating_banner_pics[id];i++){
			if(document.getElementById(rotating_banner_div[id]+ '_tab'+i)){
				var tab = document.getElementById(rotating_banner_div[id]+ '_tab'+i);
				if(i == rotating_banner_index[id]){
					tab.style.backgroundColor = 'gray';
				}
				else{
					tab.style.backgroundColor = '';
				}
			}
		}
	}
	
	function blendimageout_rotating_banner (id, newdivid, olddivid, millisec) {
		var speed = Math.round(millisec / 100);
		var i = 0;
		
		rotating_banner_start[id] = new Date();

		do {
			setTimeout("changeOpac2_rotating_banner(" + id + "," + i + ",'" + newdivid + "', '" + olddivid + "'," + speed + ")",(i * speed));
			i=i+7;
		} while (i < 100);
		setTimeout("changeOpac2_rotating_banner(" + id + ",100,'" + newdivid + "', '" + olddivid + "'," + speed + ")",(100 * speed));
	}	
	
	function changeOpac2_rotating_banner (id, opacity, newid, oldid, speed) {
		var start_time = new Date();
		opac = (start_time-rotating_banner_start[id])/speed;
		var objects = document.getElementsByName(newid);
		
		for(var j=0;j!=objects.length;j++) {
			if (objects[j].style.display != "block") { objects[j].style.display = "block"; }
			objects[j].style.opacity = (opac / 100);
			objects[j].style.MozOpacity = (opac / 100);
			objects[j].style.KhtmlOpacity = (opac / 100);
			objects[j].style.filter = "alpha(opacity=" + opac + ")";
		}
		
		if(opacity == 100) {
			var oldobjects = document.getElementsByName(oldid);	
			for(var j=0;j!=oldobjects.length;j++) { oldobjects[j].style.display = "none"; oldobjects[j].style.zIndex = 50; objects[j].style.zIndex = 0; }
			setTimeout("change_pic_rotating_banner(" + id + ")",rotating_banner_timeout[id]);
			
		}
	}
	
/*** END/Rotating Banner ***/

/*** Rotating Regions ***/
	function rg(name,url_name) {
		this.name = name;
		this.url_name = url_name;
	}
	function setRegion() {
		var startPos = curReg + 1;
	
		for (j=1;j<=rgList.length;j++) {
			if (!document.getElementById("reg"+j)) {
				break;
			}
			document.getElementById("reg"+j).innerHTML = "";
		}		
	
		for (i=1;i<=rgList.length;i++) {
			if (!document.getElementById("reg"+i)) {
				break;
			}
			document.getElementById("reg"+i).innerHTML = '<div style="margin:0;padding:0;clear:both;float:left;width:17px;padding-right:10px;text-align:right">' + (curReg+1) + '</div><a style="float:left" href="/regions/' + rgList[curReg].url_name + '/' + rotate_regions_url_ext + '">' + rgList[curReg].name + '</a>';
			curReg++;
			if (curReg >= rgList.length) {
				curReg = 0;
				break;
			} 
		}
		
		endPos = (startPos > curReg) ? rgList.length : curReg;
		document.getElementById("pageno").innerHTML = startPos + " - " + endPos + " " + rotate_regions_of_text + " " + rgList.length;
		
		if (curReg < 0) {
			curReg = rgList.length + curReg;
		} 
		window.setTimeout("setRegion()",5000);
	}
/*** END/Rotating Regions ***/

/*** Late Deals functions ***/
	function rotate(numb) {
		if (numb == 1) {
			img1 = document.getElementById('image1');
			img2 = document.getElementById('image2');
		} else {
			img1 = document.getElementById('image2');
			img2 = document.getElementById('image1');
		}
		cur = img2.style.opacity;
		if (cur > 0) {
			img2.style.filter = "alpha(opacity=" + ((cur-0.05)*100) + ");";
			img2.style.opacity = (cur-0.05);
			window.setTimeout("rotate(" + numb + ")", 40);
		} else {
			img2.style.zIndex = 1;
			img1.style.zIndex = 2;
			img2.style.filter = "alpha(opacity=100);";
			img2.style.opacity = 1;
			newImage = (numb == 2) ? 1 : 2;
			window.setTimeout("rotate(" + newImage + ")", 5000);
		}
	}
	
	function refreshForm() {
		document.frmResults.action = 'late-deals.cfm';
		document.frmResults.method = 'POST';
		document.frmResults.submit();					
	}
	
	function setPage(num) {
		document.frmResults.page.value = num;
		refreshForm();
	}
	
	function changeLateDealsPax() {
		document.frmResults.dep_air_id.value = document.frmTailor.dep_air_id.value;
		document.frmResults.paxa.value = document.frmTailor.paxa.value;		
		document.frmResults.paxc.value = document.frmTailor.paxc.value;		
		document.frmResults.paxi.value = document.frmTailor.paxi.value;
		refreshForm();
	}
	
	function setOrderBy() {
		setPage(1);
	}
	
	function switchLateDeal(val) {
		document.frmResults.type.value = val;
		document.frmResults.page.value = 1;
		refreshForm();
	}
	
	function submitToQS() {
		document.frmQSResults.action = '/q_search.cfm';
		document.frmQSResults.method = 'GET';					
		document.frmQSResults.submit();
	}
	
	function checkAll(pos) {
		if (pos == "") {
		var check = document.getElementById('checkall').checked;
		} else {
			var check = document.getElementById('checkall1').checked;
		}
		
		var inputs = document.getElementById('results').getElementsByTagName('input');
		for (var i=0;i<inputs.length;i++) {
			if (inputs[i].type == "checkbox") {
				inputs[i].checked = check;
			}
		}
		
		if (pos == "") {
			document.getElementById('checkall1').checked = check;
		} else {
			document.getElementById('checkall').checked = check;
		}		
	}
/*** END/Late Deals functions ***/

/*** Villa, Resort, Region page functions ***/
	var hand = "hand";
	if (navigator.appName == "Netscape") {
		hand = "pointer";
	}
	
	function galleryImage (pMain, pThumb, pText) {
		this.main = pMain;
		this.thumb = pThumb;
		this.text = pText;
	}
	function imageSet (pimg1, pimg2, pimg3) {
		this.img1 = pimg1;
		this.img2 = pimg2;
		this.img3 = pimg3;
	}
	
	function showHideLinks(){								
		if(document.getElementById("bookmarks")){
			if(document.getElementById("bookmarks").style.display =='block'){
				document.getElementById("bookmarks").style.display ='none';
				document.getElementById("plusminus").src = "/images/jvh08/Plus.jpg";
			}	else {
				document.getElementById("bookmarks").style.display ='block';
				document.getElementById("plusminus").src = "/images/jvh08/minus.jpg";
			}
		}			
	}
	
	function villa (id, name, villa_link, picture, bedrooms, boj, rental_type, sleeps, beds, baths, car, air_con, pool) {
		this.id = id;
		this.name = name;
		this.villa_link = villa_link;
		this.picture = picture;
		this.bedrooms = bedrooms;
		this.boj = boj;
		this.rental_type = rental_type;
		this.sleeps = sleeps;
		this.beds = beds;
		this.baths = baths;
		this.car = car;
		this.air_con = air_con;
		this.pool = pool;
	}
	
	function displayVilla (villaObj) {			
		var isBoj = (villaObj.boj == 1) ? true : false;
		var myhref = "href=";
		var linkStartHTML = '<a '+myhref+'"'+villaObj.villa_link+lblCookieValue+'">';
		var linkEndHTML = "</a>";
		var myimg = "img src";
		
		var imageHTML = '<'+myimg+'="'+lblWebsiteUrl+'images/galleries/'+lblRegionID+lblRegionName+'/Villas/Photos/' + lblRegionID + villaObj.picture + '/' + lblRegionID + villaObj.picture + '_ext_5.jpg" alt="' + villaObj.name + '" style="margin-bottom:10px;" />';
		
		featureIconsEXT = (isBoj) ? "BOJ/" : "STD/";
		var featureIconsHTML = "<"+myimg+"='" + featureIconsPath + featureIconsEXT + "sleeps" + villaObj.sleeps + ".jpg' alt='" + eval("sleeps" + villaObj.sleeps + "ALT") + "' style='margin-right:2px' align='top' /><img src='" + featureIconsPath + featureIconsEXT + "beds" + villaObj.beds + ".jpg' alt='" + eval("beds" + villaObj.beds + "ALT") + "' style='margin-right:2px' align='top' /><img src='" + featureIconsPath + featureIconsEXT + "baths" + villaObj.baths + ".jpg' alt='" + eval("baths" + villaObj.baths + "ALT") + "' style='margin-right:2px' align='top' />";
		if (villaObj.car != 4) {
			var carVal = "car_recommended_" + lblLanguageCode;
			if (villaObj.car == 3) {
				carVal = "car_essential_" + lblLanguageCode;
			}
			else if (villaObj.car == 1) {
				carVal = "car_optional_" + lblLanguageCode;
			}
			featureIconsHTML = featureIconsHTML + "<"+myimg+"='" + featureIconsPath + featureIconsEXT + carVal + ".jpg' alt='" + eval("car" + villaObj.car + "ALT") + "' style='margin-right:2px' align='top' />";
		}
		if (villaObj.air_con == 1) {
			featureIconsHTML = featureIconsHTML + "<"+myimg+"='" + featureIconsPath + featureIconsEXT + "aircon.jpg' alt='" + airconALT + "' style='margin-right:2px' align='top' />";
		}
		if (villaObj.pool == 1) {
			featureIconsHTML = featureIconsHTML + "<"+myimg+"='" + featureIconsPath + featureIconsEXT + "heatedpool_" + lblLanguageCode + ".jpg' alt='" + poolALT + "' style='margin-right:2px' align='top' />";
		}
		
		var HTML = linkStartHTML + imageHTML + linkEndHTML + "<br />" + featureIconsHTML + "<div style='margin-top:5px;'></div>" + linkStartHTML + villaObj.name + linkEndHTML + "<div style='margin-top:10px;'></div>";

		if (isBoj) {
			var bojHTML = '<'+myimg+'="'+lblWebsiteUrl+'images/layout/boj-' + lblLanguageCode + '.gif" alt="' + lblqs_boj + '" style="margin-bottom:5px;" />';
			var bojBorder = "";
		}
		else {
			var bojHTML = (setUpType != 1) ? '<div style="height:27px;"></div>' : '';			
			var bojBorder = "";
		}
		
		HTML = "<table cellspacing='0' cellpadding='0' border='0'><tr><td width='230' align='center' style='" + bojBorder + "padding-top:10px;'>" + "<table cellspacing='0' cellpadding='0' border='0'><tr><td width='220' align='left'>" + bojHTML + HTML + "</td></tr></table></td></tr></table>";
		return HTML;
	}
	
	var currentBedroomSelection = 0;
	var currentDisplayAmount = 12;
	var villaList;
	var startNumber;
	var endNumber;
	
	function displayPage (bedrooms, page, setting) {
		if (setting == 1) {
			currentDisplayAmount = 12;
		}
		if (setUpType == 3 || setUpType == 4) {
			var setValue = false;
			for (var i = 0; i < document.frmDisplayAmount.displayDropDown.length - 1; i++) {
				if (document.frmDisplayAmount.displayDropDown[i].value == currentDisplayAmount) {
					document.frmDisplayAmount.displayDropDown.selectedIndex = i;
					document.frmDisplayAmount_footer.displayDropDown.selectedIndex = i;
					setValue = true;
					break;
				}
			}
			if (!setValue) {
				document.frmDisplayAmount.displayDropDown.selectedIndex = document.frmDisplayAmount.displayDropDown.length - 1;
				document.frmDisplayAmount_footer.displayDropDown.selectedIndex = document.frmDisplayAmount_footer.displayDropDown.length - 1;
			}
		}
		
		if (setUpType == 4) {
			displayLinks(bedrooms);
		}
		displayVillas(bedrooms, page);
		if (setUpType == 3 || setUpType == 4) {
			displayResults(bedrooms, page);
			displayPageNumbers(bedrooms, page);
		}
		currentBedroomSelection = bedrooms;
		if (document.getElementById('saveOptions')) {
			document.getElementById('saveOptions').value = bedrooms+','+page+','+setting;
		}
	}
	
	function displayLinks (bedrooms) {
		var text = "";		
		for (var i = 0; i < bedroomList.length; i++) {
			if (bedroomList[i] == bedrooms) {
				if (bedroomList[i] == 0) {
					text = text + lblviewall;
				}
				else if (bedroomList[i] == -1) {
					text = text + "Best of James" + "&nbsp;" + lblBedroomListDivider + "&nbsp;";
				}
				else if (bedroomList[i] == 1) {
					text = text + bedroomList[i] + " " + bedroomText + "&nbsp;" + lblBedroomListDivider + "&nbsp;";
				}
				else {
					text = text + bedroomList[i] + " " + bedroomsText + "&nbsp;" + lblBedroomListDivider + "&nbsp;";
				}
			}
			else {
				if (bedroomList[i] == 0) {
					text = text + "<a href='JavaScript:displayPage(" + bedroomList[i] + ",1,1);'>" + lblviewall + "&nbsp;" + arrowHTML + "</a>";
				}
				else if (bedroomList[i] == -1) {
					text = text + "<a href='JavaScript:displayPage(" + bedroomList[i] + ",1,1);'>Best of James&nbsp;" + arrowHTML + "</a>&nbsp;" + lblBedroomListDivider + "&nbsp;";
				}
				else if (bedroomList[i] == 1) {
					text = text + "<a href='JavaScript:displayPage(" + bedroomList[i] + ",1,1);'>" + bedroomList[i] + " " + bedroomText + "&nbsp;" + arrowHTML + "</a>&nbsp;" + lblBedroomListDivider + "&nbsp;";
				}
				else {
					text = text + "<a href='JavaScript:displayPage(" + bedroomList[i] + ",1,1);'>" + bedroomList[i] + " " + bedroomsText + "&nbsp;" + arrowHTML + "</a>&nbsp;" + lblBedroomListDivider + "&nbsp;";
				}
			}
		}
		
		if (setUpType == 4) {
			document.getElementById("bedrooms_links").innerHTML = text;
		}
	}
	
	function displayResults (bedrooms, page) {
		var text = lblresults + " " + (startNumber + 1) + " - " + endNumber + " " + lblof + " " + villaList.length;
		document.getElementById("results").innerHTML = text;
		document.getElementById("results_footer").innerHTML = text;
	}
	
	function displayPageNumbers (bedrooms, page) {
		var prevPage = page - 1;
		if (prevPage == 0) {
			var prev = lblprevious;
		}
		else {
			var prev = '<a href="Javascript:displayPage(' + bedrooms + ',' + prevPage + ',2);">' + lblprevious + '</a>';
		}
		var nextPage = page + 1;
		if (startNumber + currentDisplayAmount >= villaList.length) {
			var next = lblnext;
		}
		else {
			var next = '<a href="Javascript:displayPage(' + bedrooms + ',' + nextPage + ',2);">' + lblnext + '</a>';
		}
		var pages = parseInt(villaList.length / currentDisplayAmount);
		if (pages != (villaList.length / currentDisplayAmount)) {
			pages++;
		}
		if (pages > 1) {
			var pagesText = "";
			for (var i = 1; i < pages + 1; i++) {
				if (i == page) {
					pagesText = pagesText + page + " ";
				}
				else {
					pagesText = pagesText + "<a href='Javascript:displayPage(" + bedrooms + "," + i + ",2);'>" + i + "</a> ";
				}
			}
			var text = prev + " " + pagesText + next;
			document.getElementById("pages").innerHTML = text;
			document.getElementById("pages_footer").innerHTML = text;
		}
		else {
			document.getElementById("pages").innerHTML = "";
			document.getElementById("pages_footer").innerHTML = "";
		}
	}
	
	function displayVillas (bedrooms, page) {
		villaList = new Array();
		for (var i = 0; i < villas.length; i++) {
			if (bedrooms == 0) {
				villaList[villaList.length] = villas[i];
			}
			else if (bedrooms == -1 && villas[i].boj == 1) {
				villaList[villaList.length] = villas[i];
			}
			else if (villas[i].bedrooms == bedrooms) {
				villaList[villaList.length] = villas[i];
			}
		}
		startNumber = currentDisplayAmount * (page - 1);
		endNumber = startNumber + currentDisplayAmount;
		if (endNumber > villaList.length) {
			endNumber = villaList.length;
		}
		var counter = 0;
		var text = "<table cellspacing='0' cellpadding='0' border='0'>";
		for (var i = startNumber; i < endNumber; i++) {
			if (counter % 3 == 0) {
				text = text + "<tr><td width='230'>" + displayVilla(villaList[i]) + "</td><td width='10'></td>";
			}
			else if (counter % 3 == 1) {
				text = text + "<td width='230'>" + displayVilla(villaList[i]) + "</td><td width='10'></td>";
			}
			else {
				text = text + "<td width='230'>" + displayVilla(villaList[i]) + "</td></td></tr>";
				if (i < endNumber - 1) {
					text = text + "<tr><td colspan='5'><hr></td></tr>";
				}
			}
			counter++;
		}
		if (counter % 3 == 1) {
			text = text + "<td width='230'></td><td width='10'></td><td width='210'></td></tr>";
		}
		else if (counter % 3 == 2) {
			text = text + "<td width='230'></td></td></tr>";
		}
		text = text + "</table>";
		document.getElementById("villasTD").innerHTML = text;
	}
	
	function displayAmount (amount,run_page) {
		if (amount == 0) {
			currentDisplayAmount = parseInt(villas.length);
		}
		else {
			currentDisplayAmount = parseInt(amount);
		}
		if (run_page) {
			displayPage(currentBedroomSelection,1,2);
		}
	}
	
	function leftscrolldown() {
		if (scrollTimer == null) {
			scrollTimer = setInterval('scrolltick(true);', 10);
		}
	}
	
	function scrollup() {
		clearInterval(scrollTimer);
		delete(scrollTimer);
		scrollTimer = null;
	}
	
	function scrolltick(scrollleft) {
		if(scrollleft) {
			leftvalue -= 10;
		}
		else {
			leftvalue += 10;
		}
		
		if(leftvalue < 0) leftvalue=0;
		if( maxleft > 0) {
			if(leftvalue > maxleft) leftvalue=maxleft;
		} else {
			leftvalue=0;
		}
		
		var imagels = document.getElementById('imagejfvk');
		imagels.scrollLeft = leftvalue;
	}
	
	function rightscrolldown() {
		if (scrollTimer == null) {
			scrollTimer = setInterval('scrolltick(false);', 10);
		}
	}
	
	function setThumb_villa (set, num, pos) {
		if ((set >= imageSets.length) || (eval("imageSets[" + set + "].img" + num).thumb == null)) {
			document.getElementById("photoViewer" + pos + "img").src = lbl_villa_website_url + "images/photo_viewer/none.jpg";
			document.getElementById("photoViewer" + pos + "img").alt = "";
			document.getElementById("photoViewer" + pos).onmouseover = "";
			document.getElementById("photoViewer" + pos).onmouseout = "";
			document.getElementById("photoViewer" + pos).onclick = "";
		}
		else {
			document.getElementById("photoViewer" + pos + "img").src = eval("imageSets[" + set + "].img" + num).thumb;
			document.getElementById("photoViewer" + pos + "img").alt = eval("imageSets[" + set + "].img" + num).text;
			document.getElementById("photoViewer" + pos + "img").title = eval("imageSets[" + set + "].img" + num).text;
			document.getElementById("photoViewer" + pos).onmouseover = function () {document.getElementById("photoViewer" + pos).style.cursor = hand; setPhoto_villa(set,num);};
			document.getElementById("photoViewer" + pos).onmouseout = function () {setPhoto_villa(currentImageSet, currentImageNum);};
			document.getElementById("photoViewer" + pos).onclick = function () {currentImageSet = set; currentImageNum = num; setPhoto_villa(set,num);};
		}
	}
	
	function setPhoto_villa (set, num) {
		document.getElementById("photoViewerMain").src = eval("imageSets[" + set + "].img" + num).main;
		document.getElementById("photoViewerMain").alt = eval("imageSets[" + set + "].img" + num).text;
		document.getElementById("photoViewerMain").title = eval("imageSets[" + set + "].img" + num).text;
		//document.getElementById("photoViewerLabel").innerHTML = eval("imageSets[" + set + "].img" + num).text;
	}
	
	function showPhotos_villa (i) {						
		var x = (parseInt(i / 2) * 6) + 1;
		var y = (parseInt(i / 2) * 6) + 6;
		if (y > totalImages) {
			y = totalImages;
		}
		document.getElementById("photoViewerXofY").innerHTML = "Photos " + x + " - " + y + " " + lbl_villa_gallery_of + " " + totalImages;
		
		if (villa_gallery_images_count > 6) {
			var pages = parseInt(totalImages / 6);
			if (pages != (totalImages / 6)) {
				pages++;
			}
			if ((i - 2) < 0) {
				var prev = lbl_villa_gallery_prev;
			}
			else {
				var prev = "<a href='JavaScript:showPhotos_villa(" + (i - 2) + ")'>" + lbl_villa_gallery_prev + "</a>";
			}
			if ((parseInt(i / 2) + 1) >= pages) {
				var next = lbl_villa_gallery_next;
			}
			else {
				var next = "<a href='JavaScript:showPhotos_villa(" + (i + 2) + ")'>" + lbl_villa_gallery_next + "</a>";
			}
			var pagesText = "";
			for (var j = 1; j < pages + 1; j++) {
				var page = (j - 1) * 2;
				if (i == page) {
					pagesText = pagesText + j + " ";
				}
				else {
					pagesText = pagesText + "<a href='Javascript:showPhotos_villa(" + page + ");'>" + j + "</a> ";
				}
				if (j < pages) {
					pagesText = pagesText + "| ";
				}
			}
			document.getElementById("photoViewerPages").innerHTML = prev + " " + pagesText + " " + next;
		}
		
		setThumb_villa(i,1,1);
		setThumb_villa(i,2,2);
		setThumb_villa(i,3,3);
		
		setThumb_villa(i+1,1,4);
		setThumb_villa(i+1,2,5);
		setThumb_villa(i+1,3,6);
	}
/*** END/Villa, Resort, Region page functions ***/

/* Customer reviews */
var expectImg = null;
function miniReview(e, obj, ratings) {
	var minus = '/images/jvh08/minus.jpg';
	var plus = '/images/jvh08/plus.jpg';
	var mini = document.getElementById('mini_review');
	var villa_reviews = document.getElementById('villa_reviews');
	var img = villa_reviews.getElementsByTagName('img');
	
	if (obj.src.indexOf(plus) > -1) {
		if (expectImg) expectImg.src = plus;
		obj.src = minus;
		expectImg = obj;
		
		getMouseXY(e);
		mini.style.left = tempX + "px";
		mini.style.top = tempY + "px";
		mini.style.display = '';			
		var tbl = document.getElementById('mini_review_tbl');
		for (var i=0;i<ratings.length;i++) {
			if (ratings[i] == '') {
				tbl.rows[i].style.display = 'none';
			} else {
				tbl.rows[i].cells[1].innerHTML = ratingIcons(ratings[i], 5, 'small', tbl.rows[i].cells[0].innerText + ' rating ' + ratings[i] + ' out of 5');			
				tbl.rows[i].style.display = '';
			}
		}
	}
}
	
function closeMiniReview() {
	var plus = '/images/jvh08/plus.jpg';
	var mini = document.getElementById('mini_review');
	if (expectImg) expectImg.src = plus;
	expectImg = null;
	if (mini) mini.style.display = 'none';
}

function ratingIcons(rating, total, size, alt) {
	var tickIcon = Math.floor(rating);
	if (rating > Math.floor(rating)) tickIcon += ".5";
	return '<img src="/images/accom_page/tick-' + size + '-' + tickIcon + '.gif" alt="' + alt + '" />';
}