// (c) 2009 Expandable Banners.com
// Visit  www.expandablebanners.com to learn how to make your own.
// Check out our other website FreeMediaVideos.com - Watch and Learn how to use Multimedia Software for free

if (document.getElementById && document.createElement) {
ba = document.createElement("div");
ba.innerHTML = '<object id="bigad_obj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="320" height="600">'+
'<param name="movie" value="http://www.barbadoshotels.co.uk/images/banners/rollover_banner_source/SS-10490-barbadoshotels.co.uk/Roll_2.swf" />'+
'<param name="quality" value="high" />'+
'<param name="wmode" value="transparent" />'+
'<embed src="http://www.barbadoshotels.co.uk/images/banners/rollover_banner_source/SS-10490-barbadoshotels.co.uk/Roll_2.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="320" height="600"></embed>'+
'</object>';
ba.style.position = 'absolute';
ba.style.left = '0px';
ba.style.top = '-500px';
ba.style.width = '320px';
ba.style.height = '600px';
ba.style.visibility = 'hidden';

window.onload = function () {
	bn = document.getElementById('banner');

	document.body.appendChild(ba);

	if (document.all) {
		bn.onmouseover = bn.onclick = openAd;
		ba.onmouseout = closeAd;
		ba.onmouseover = cancelClose;
	}
	else {
		bn.addEventListener("mouseover",openAd,true);
		bn.addEventListener("click",openAd,true);
		ba.addEventListener("mouseout",closeAd,true);
		ba.addEventListener("mouseover",cancelClose,true);
	}
};

}

function cancelClose() {
	clearTimeout(adtimer);
}
adtimer = 0;
function openAd() {
	var bnp = getElementPosition(bn);
	ba.style.left = (bnp["x"]-ba.offsetWidth+bn.offsetWidth)+"px";
	ba.style.top = bnp["y"]+"px";
	ba.style.visibility="visible";
}


// The Number in Red is the ammount of time before closes. 1000 is one second

function closeAd() {
	adtimer = setTimeout('ba.style.visibility="hidden"; adtimer=0',280);
}
function getElementPosition(e){
	var x=y=0;
	while (e!=null) {
		x += e.offsetLeft;
		y += e.offsetTop;
		e = e.offsetParent;
	}
	return {x:x,y:y};
}

