﻿	var X, Y, t, move, title, offX, offY, winH, winW;
	var tt=document.createElement('DIV');
	tt.style.whiteSpace="nowrap";
	tt.id='tt';
	window.onload = function () {
		document.body.appendChild(tt);
	}
	document.onmouseover = function (e) {
		t = gt(e);
		if (t.title) {
			t.setAttribute("tooltip", t.title);
			t.title='';
		}
		var tooltip=t.getAttribute("tooltip");
		if (tooltip) {
			move=true;
			tt.innerHTML=tooltip;
			tt.style.display='block';
		}
		tip(e);
	}
	document.onmouseout = function (e) {
		t = gt(e);
		tt.style.display='none';
		move=false;
	}
	document.onmousemove = function (e) {
		if (move) tip(e);
	}
	function gt(x) {
		x = x || window.event;
		return x.target || x.srcElement;
	}
	function tip(e) {
			if (e) {
				winW = window.innerWidth + document.documentElement.scrollLeft;
				winH = window.innerHeight + document.documentElement.scrollTop;
				if (e.pageX + tt.offsetWidth + 20 > winW) offX=tt.offsetWidth;
				else offX=0;
				if (e.pageY + tt.offsetHeight + 35 > winH) {
					offY=tt.offsetHeight + 25;
				}
				else offY=0;
				X = e.pageX;
				Y = e.pageY;
			}
			else {
				winW = document.documentElement.clientWidth + document.documentElement.scrollLeft;
				winH = document.documentElement.clientHeight + document.documentElement.scrollTop;
				if (event.clientX + document.documentElement.scrollLeft + tt.offsetWidth > winW) offX=tt.offsetWidth;
				else offX=0;
				if (event.clientY + document.documentElement.scrollTop + tt.offsetHeight + 20 > winH) {
					offY=tt.offsetHeight + 25;
				}
				else offY=0;
				X = event.clientX + document.documentElement.scrollLeft;
				Y = event.clientY + document.documentElement.scrollTop;
			}			
			//X = e? e.pageX:event.clientX + document.documentElement.scrollLeft;
			//Y = e? e.pageY:event.clientY + document.documentElement.scrollTop;
			tt.style.left=X-offX+'px';
			tt.style.top=Y+20-offY+'px';
	}

	function hide(e) {
		if (!e.style) e = document.getElementById(e);
		e.style.display="none";
	}
	function show(e) {
		if (!e.style) e = document.getElementById(e);
		e.style.display="block";
	}
	function show_i(e) {
		if (!e.style) e = document.getElementById(e);
		e.style.display="inline";
	}
	function showhide(e) {
		if (!e.style) e = document.getElementById(e);
		if (e.style.display == "none" || e.style.display == "undefined") {
			e.style.display="block";
		}
		else {
			e.style.display="none";
		}
	}

    /*
	var X, Y, t, move, title;
	var tt=document.createElement('DIV');
	tt.id='tt';
	
	window.onload = function () {
		var a = document.getElementsByTagName("*");
		for(var i=0;i<a.length;i++)
		{
			if (a[i].title && typeof a[i].title != 'object') 
			{
				a[i].setAttribute("rtitle", a[i].title);
				a[i].title='';
			}
		}
		document.body.appendChild(tt);
	}
	
	document.onmouseover = function (e) 
	{
		t = gt(e);
		var rtitle=t.getAttribute("rtitle");
		if (rtitle) 
		{
			move=true;
			tt.innerHTML=rtitle;
			tt.style.display='block';
		}
	}
	document.onmouseout = function (e) 
	{
		t = gt(e);
		tt.style.display='none';
		move=false; 
	}
	document.onmousemove = function (e) 
	{
		if (move) tip(e);
	}
	function gt(x) 
	{
		x = x || window.event;
		return x.target || x.srcElement;
	}
	function tip(e) 
	{
			X = e? e.pageX:event.clientX + document.body.scrollLeft;
			Y = e? e.pageY:event.clientY + document.body.scrollTop;
			tt.style.left=X+'px';
			tt.style.top=Y+20+'px';
	}

	function hide(e) 
	{
		if (!e.style) e = document.getElementById(e);
		e.style.display="none";
	}
	function show(e) 
	{
		if (!e.style) e = document.getElementById(e);
		e.style.display="block";
	}
	function show_i(e) 
	{
		if (!e.style) e = document.getElementById(e);
		e.style.display="inline";
	}
    */
	function openBooking(url)
    {
        window.location.href = url;
    }
