// cuba UK

function right(e) {
	if(navigator.appName=='Netscape'&&(e.which==3||e.which==2))
return false;
	else if(navigator.appName=='Microsoft Internet Explorer'&&(event.button==2||event.button==3)) {
		warning =
		"Copyright © 2008" 
		
var agree = confirm(warning);
if (agree !="0") {
	top.location="mailto:cubahotel@cuba-hotelbooking.co.uk?subject=Cuba Travel Information"; }
	return false; }
return true;}

function keypressed() {
	alert("This function is disabled");
}
document.onkeydown=keypressed;
document.onmousedown=right;
document.onmousemove=right;
   function event_false() {
         window.event.returnValue = false
   }

document.onselectstart = event_false

function jump(menu){
  var loc = menu[menu.selectedIndex].value.split("|");
  if(loc.length == 2)
    window.open(loc[1], loc[0]); }

function detect() {
	// simplify things
	var agent 	= navigator.userAgent.toLowerCase();
	
	// detect platform
	this.isMac		= (agent.indexOf('mac') != -1);
	this.isWin		= (agent.indexOf('win') != -1);
	this.isWin2k	= (this.isWin && (
			agent.indexOf('nt 5') != -1));
	this.isWinSP2	= (this.isWin && (
			agent.indexOf('xp') != -1 || 
			agent.indexOf('sv1') != -1));
	this.isOther	= (
			agent.indexOf('unix') != -1 || 
			agent.indexOf('sunos') != -1 || 
			agent.indexOf('bsd') != -1 ||
			agent.indexOf('x11') != -1 || 
			agent.indexOf('linux') != -1);
	
	// detect browser
	this.isSafari	= (agent.indexOf('safari') != -1);
	this.isSafari2 = (this.isSafari && (parseFloat(agent.substring(agent.indexOf("applewebkit/")+"applewebkit/".length,agent.length).substring(0,agent.substring(agent.indexOf("applewebkit/")+"applewebkit/".length,agent.length).indexOf(' '))) >=  300));
	this.isOpera	= (agent.indexOf('opera') != -1);
	this.isNN		= (agent.indexOf('netscape') != -1);
	this.isIE		= (agent.indexOf('msie') != -1);
	
	
}
var browser = new detect();
function addEventToObject(obj, evt, func) {
	var oldhandler = obj[evt];
	obj[evt] = (typeof obj[evt] != 'function') ? func : function(){oldhandler();func();};
}

function scrollinator() {
	if (!(browser.isIE&&browser.isMac)) {
		if (document.getElementById('scroller')) {
			var scroller = document.getElementById('scroller');
			var imgs = scroller.getElementsByTagName('img');
			var imgsLeft = new Array();
			var leftTemp = 0;
			for (i=0;i<imgs.length;i++) {
				imgsLeft[i] = leftTemp;
				imgs[i].w = (browser.isIE == false) ? parseInt(document.defaultView.getComputedStyle(imgs[i], '').getPropertyValue("width")) : parseInt(imgs[i].width);
				leftTemp += imgs[i].w;
			}
			var isScrollingReady = function() {
				for (i=0;i<imgs.length;i++) { 
					if (document.images[i].complete == false) {
						return false;
						break;
					}
				}
				return true;
			}
			var doScroll = function() {
				for (i=0;i<imgs.length;i++) {
					imgsLeft[i] = imgsLeft[i] - 1;
					if (imgsLeft[i] <= -(imgs[i].w)) {
						leftTemp = 0;
						for (j=0;j<imgs.length;j++){
							if (j != i) {leftTemp = leftTemp + imgs[j].w;}		
						}
						imgsLeft[i] = leftTemp;
					}
					imgs[i].style.left = imgsLeft[i] + "px";
				}
			}
			var startScroll = function() {
				if (isScrollingReady() == true) {	
					for (j=0;j<imgs.length;j++) {
						imgs[j].style.left = imgsLeft[j] + "px";
						imgs[j].style.top = "0px";
						imgs[j].style.position = "absolute";
						if (browser.isIE&&browser.isWin) {
							var src = imgs[j].src;
							var elem = document.createElement('div');
							elem.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizing='scale')";
							elem.style.width = imgs[j].width + "px";
							elem.style.height = imgs[j].height + "px";
							//imgs[j].childNodes[0].replaceNode(elem);						
						}
					}
					window.clearInterval(scrollPause);
					var interval = (scroller.className) ? scroller.className.substring(10,scroller.className.length) : 29;
					var scrollInterval = (browser.isIE == true && browser.isMac == true) ? setInterval(doScroll(),interval) : setInterval(doScroll,interval);
				} 
			}
			var scrollPause = (browser.isIE == true && browser.isMac == true) ? setInterval(startScroll(),100) : setInterval(startScroll,100);
		}
	}
}

addEventToObject(window,'onload', scrollinator);

function hhotelPTC(val, lg, codeprice, codetrack, cluster)
{
var waction = "http://www.fastbookings.biz/DIRECTORY/";
waction += "preresa.phtml?Hotelnames="+val;
if (lg != "") waction += "&langue="+lg;
if (codeprice != "") waction += "&FSTBKNGCode="+codeprice;
if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
if (cluster != "") waction += "&clustername="+cluster;
window.open(waction,"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// begin absolutely positioned scrollable area object scripts 

function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
 
 
var speed=32
 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 
 
function PerformScroll(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised; 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('divContainer') 
    objScroller=new ConstructObject('divContent','divContainer') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 
} 
// end absolutely positioned scrollable area object scripts 
function redirect(form,formName)
{var url=eval('form.'+formName+'.options[form.'+formName+'.selectedIndex].value');if(url!="")location.href=url;return false;}//-->

function jump(menu){
  var loc = menu[menu.selectedIndex].value.split("|");
  if(loc.length == 2)
    window.open(loc[1], loc[0]);}
