function ShowHint(napis, event) {
  var DivRef = document.getElementById('hint');
  var IfrRef = document.getElementById('DivShim');
  //DivRef.style.left = event.clientX + document.body.scrollLeft + 'px';
  //DivRef.style.top = event.clientY + document.body.scrollTop + 'px';
    
    if (navigator.appName != "Microsoft Internet Explorer") {  		      
        DivRef.style.left = event.pageX + document.body.scrollLeft + 'px';
        DivRef.style.top = event.pageY + document.body.scrollTop + 'px';
        }
    else {		
        DivRef.style.left = mouseX(event) + 'px'; 
        DivRef.style.top = mouseY(event) + 'px';
        }
   
    DYMEK_element = [
   	next,//poweravail (next) 
    prev,//poweravail (prevs)
    pax_info,//start (pax)
    promo_code,//start (promotion code)
    change_address,//summary (change address)
    change_payment,//summary (change payment)
    rules,//summary (see rules)
    agree,//summary (agreement)
    change_pax,//summary (change passengers)
    etix,//poweravail & pricing (etix, ptix)
    "",//resform (login)
    cvc, //resform CVC
    citizen, //resform (citizen)
    rules,//summary (see rules)
    pax_info_LDF,//start LDF (pax)
	business,
	SearchType,
	delivery_help,
	promotion,
	promotion_help
    ];
	
  DivRef.innerHTML= "<table class=\"tip\" width=\"320\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"7\" align=\"right\" valign=\"bottom\"><img src=\"/portal/img/tip11.gif\" alt=\"\" width=\"7\" height=\"6\" /></td><td align=\"left\" class=\"tip_top\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"100\" height=\"2\" /></td><td width=\"6\" align=\"left\" valign=\"bottom\"><img src=\"/portal/img/tip13.gif\" alt=\"\" width=\"6\" height=\"6\" /></td></tr><tr><td class=\"tip_left\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"1\" height=\"8\" /></td><td valign=\"middle\" bgcolor=\"#FFFFFF\" class=\"tipj\">" + DYMEK_element[napis] + "</td><td class=\"tip_right\"><img src=\"/portal/img/transp.gif\" alt=\"\" /></td></tr><tr><td width=\"7\" align=\"right\" valign=\"top\"><img src=\"/portal/img/tip31.gif\" alt=\"tip31\" width=\"7\" height=\"6\" /></td><td align=\"left\" valign=\"top\" class=\"tip_bottom\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"75\" height=\"2\" /></td><td width=\"6\" align=\"left\" valign=\"top\"><img src=\"/portal/img/tip33.gif\" alt=\"\" width=\"6\" height=\"6\" /></td></tr></table>";
  
  DivRef.style.display = "block";
  
  IfrRef.style.width = DivRef.offsetWidth;
  IfrRef.style.height = DivRef.offsetHeight;
  IfrRef.style.top = DivRef.style.top;
  IfrRef.style.left = DivRef.style.left;
  IfrRef.style.zIndex = DivRef.style.zIndex - 1;
  IfrRef.style.display = "block"; 
}
function HideHint() {
  var DivRef = document.getElementById('hint');
  var IfrRef = document.getElementById('DivShim');
  DivRef.style.display = "none";
  IfrRef.style.display = "none";  
}
function mouseX(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX)
   return evt.clientX + (document.documentElement.scrollLeft ?
   document.documentElement.scrollLeft :
   document.body.scrollLeft);
else return null;
}
function mouseY(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
   return evt.clientY + (document.documentElement.scrollTop ?
   document.documentElement.scrollTop :
   document.body.scrollTop);
else return null;
}

function ShowHintanx(napis,pos) {

  var DivRef = document.getElementById('tool'+napis+pos);

   
  DYMEK_element = [
    next,//poweravail (next) 
    prev,//poweravail (prevs)
    pax_info,//start (pax)
    promo_code,//start (promotion code)
    change_address,//summary (change address)
    change_payment,//summary (change payment)
    rules,//summary (see rules)
    agree,//summary (agreement)
    change_pax,//summary (change passengers)
    etix,//poweravail & pricing (etix, ptix)
    "",//resform (login)
    cvc, //resform CVC
    citizen, //resform (citizen)
    rules,//summary (see rules)
    pax_info_LDF,//start LDF (pax)
	business,
	SearchType,
	delivery_help,
	promotion,
	promotion_help
    ];
  DivRef.innerHTML= "<table class=\"tip\" width=\"200\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"7\" align=\"right\" valign=\"bottom\"><img src=\"/portal/img/tip11.gif\" alt=\"\" width=\"7\" height=\"6\" /></td><td align=\"left\" class=\"tip_top\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"100\" height=\"2\" /></td><td width=\"6\" align=\"left\" valign=\"bottom\"><img src=\"/portal/img/tip13.gif\" alt=\"\" width=\"6\" height=\"6\" /></td></tr><tr><td class=\"tip_left\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"1\" height=\"8\" /></td><td valign=\"middle\" bgcolor=\"#FFFFFF\" class=\"tipj\">" + DYMEK_element[napis] + "</td><td class=\"tip_right\"><img src=\"/portal/img/transp.gif\" alt=\"\" /></td></tr><tr><td width=\"7\" align=\"right\" valign=\"top\"><img src=\"/portal/img/tip31.gif\" alt=\"tip31\" width=\"7\" height=\"6\" /></td><td align=\"left\" valign=\"top\" class=\"tip_bottom\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"75\" height=\"2\" /></td><td width=\"6\" align=\"left\" valign=\"top\"><img src=\"/portal/img/tip33.gif\" alt=\"\" width=\"6\" height=\"6\" /></td></tr></table>";
  
  DivRef.style.display = "block";  
 
}
function HideHintanx(napis,pos) {
  var DivRef = document.getElementById('tool'+napis+pos);
  DivRef.innerHTML= "";
  DivRef.style.display = "none";
}

function Dymki (conf, element) {
	this.top = conf.top ? conf.top : 0;
	this.lewa = conf.left ? conf.left : 0;
	this.n_dl_show = conf.show_delay;
	this.n_dl_ukryj = conf.ukryj_delay;
	this.orientacja = conf.orientacja;
	this.sledzenie = conf.sledzenie;
	this.x = 0;
	this.y = 0;
	this.divy = [];	
	this.pokaz  = DymekPokaz;
	this.pokazD = DymekPokazD;
	this.ukryj = DymekUkryj;
	this.przesun = DymekPrzesun;
	if (document.layers) return;							// sprawdzenie czy "piszemy na" wartwie Netscape
	var b_IE = navigator.userAgent.indexOf('MSIE') > -1,	// rozpoznanie przegladarki
	s_tag = ['<div id="Dymek%name%" style="visibility:hidden;position:absolute;top:0px;left:0px;', b_IE ? 'width:1px;height:1px;' : '', conf['z-index'] != null ? 'z-index:' + conf['z-index'] : '', '"><table cellpadding="0" cellspacing="0" border="0"><tr><td class="', conf.css, '" nowrap>%text%</td></tr></table></div>'].join('');
															// tabela w js obrazujacego DIV o zawartosci odpowiedniej dla wykrytej przegladarki - style itp

	this.pobierzElement = function (id) { return document.all ? document.all[id] : document.getElementById(id); };
	this.showElem = function (id, ukryj) { this.divy[id].o_css.visibility = ukryj ? 'hidden' : 'visible'; }; // dla ustawienia warstwy - atrybuty hidden i visible
	this.getWinSz = window.innerHeight != null ? function (b_hight) { return b_hight ? innerHeight : innerWidth; } : function (b_hight) { return document.body[b_hight ? 'clientHeight' : 'clientWidth']; };	// 
	this.getWinSc = window.innerHeight != null ? function (b_hight) { return b_hight ? pageYOffset : pageXOffset; }	: function (b_hight) { return document.body[b_hight ? 'scrollTop' : 'scrollLeft']; };	
	if (window.opera) {
		this.pobierzRozmiar = function (id, b_hight) { 
			return this.divy[id].o_css[b_hight ? 'pixelHeight' : 'pixelWidth']
		};
		document.onmousemove = function () {
			mojDymek.x = event.clientX;
			mojDymek.y = event.clientY;
			if (mojDymek.sledzenie && mojDymek.visible) mojDymek.przesun(mojDymek.visible)
				return true;
		};
	}
	else {
		this.pobierzRozmiar = function (id, b_hight) { 
			return this.divy[id].o_obj[b_hight ? 'offsetHeight' : 'offsetWidth'] 
		};
		document.onmousemove = b_IE
		? function () {
			mojDymek.x = event.clientX + document.body.scrollLeft;
			mojDymek.y = event.clientY + document.body.scrollTop;
			if (mojDymek.sledzenie && mojDymek.visible) mojDymek.przesun(mojDymek.visible)
				return true;
		} 
		: function (e) {
			mojDymek.x = e.pageX;
			mojDymek.y = e.pageY;
			if (mojDymek.sledzenie && mojDymek.visible) mojDymek.przesun(mojDymek.visible)
			return true;
		};
	}
	for (i in element) {
		document.write (s_tag.replace(/%text%/, element[i]).replace(/%name%/, i));
		this.divy[i] = { 'o_obj' : this.pobierzElement('Dymek' + i) };
		this.divy[i].o_css = this.divy[i].o_obj.style;
	}
}

function DymekPokaz (id) {

	if (document.layers) return;
	this.ukryj();
	if (this.divy[id]) {
		if (this.n_dl_show) 
			this.divy[id].timer = setTimeout("mojDymek.pokazD(" + id + ")", this.n_dl_show);
		else this.pokazD(id);
			this.visible = id;
	}
}

function DymekPokazD (id) {

	this.przesun(id);
	this.showElem(id);
	if (this.n_dl_ukryj) 
		this.timer = setTimeout("mojDymek.ukryj()", this.n_dl_ukryj);
}

function DymekPrzesun (id) {
	var n_x = this.x + this.lewa, n_y = this.y + this.top;
	
	if (this.orientacja) {
		var n_w = this.pobierzRozmiar(id), n_h = this.pobierzRozmiar(id, true), n_win_w = this.getWinSz(), n_win_h = this.getWinSz(true), n_win_l = this.getWinSc(), n_win_t = this.getWinSc(true);
		if (n_x + n_w > n_win_w + n_win_l)
			n_x = n_win_w + n_win_l - n_w;
		if (n_x < n_win_l)
			n_x = n_win_l;
		if (n_y + n_h > n_win_h + n_win_t)
			n_y = n_win_h + n_win_t - n_h;
		if (n_y < n_win_t)
			n_y = n_win_t;
		}
	this.divy[id].o_css.left = n_x+'px';
	this.divy[id].o_css.top = n_y+'px';
}

function DymekUkryj () {
	if (this.timer) clearTimeout(this.timer);
	if (this.visible != null) {
		if (this.divy[this.visible].timer) 
			clearTimeout(this.divy[this.visible].timer);
		setTimeout("mojDymek.showElem(" + this.visible + ", true)", 10);
		this.visible = null;
	}
}

var DYMEK_CONF = {
	'top'        : -30, 
	'left'       : -85, 
	'css'        : 'hintsClass', 
	'show_delay' : 500, 
	'ukryj_delay': 90000,
	'orientacja' : true,
	'sledzenie'  : true,
	'z-index'    : 0 
},

  DYMEK_element = [
    "<table class=\"tip\" width=\"113\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"7\" align=\"right\" valign=\"bottom\"><img src=\"/portal/img/tip11.gif\" alt=\"\" width=\"7\" height=\"6\" /></td><td colspan=\"3\" align=\"left\" class=\"tip_top\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"100\" height=\"2\" /></td><td width=\"6\" align=\"left\" valign=\"bottom\"><img src=\"/portal/img/tip13.gif\" alt=\"\" width=\"6\" height=\"6\" /></td></tr><tr><td class=\"tip_left\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"1\" height=\"8\" /></td><td colspan=\"3\" valign=\"middle\" bgcolor=\"#FFFFFF\" class=\"tip\">"+next+"</td><td class=\"tip_right\"><img src=\"/portal/img/transp.gif\" alt=\"\" /></td></tr><tr><td width=\"7\" align=\"right\" valign=\"top\"><img src=\"/portal/img/tip31.gif\" alt=\"\" width=\"7\" height=\"6\" /></td><td align=\"left\" valign=\"top\" class=\"tip_bottom\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"75\" height=\"2\" /></td><td width=\"10\" align=\"center\" valign=\"top\"><img src=\"/portal/img/tipdziobek.gif\" alt=\"\" width=\"10\" height=\"9\" /></td><td align=\"left\" valign=\"top\" class=\"tip_bottom\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"15\" height=\"2\" /></td><td width=\"6\" align=\"left\" valign=\"top\"><img src=\"/portal/img/tip33.gif\" alt=\"\" width=\"6\" height=\"6\" /></td></tr></table>",//poweravail (next) 
    "<table class=\"tip\" width=\"113\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"7\" align=\"right\" valign=\"bottom\"><img src=\"/portal/img/tip11.gif\" alt=\"\" width=\"7\" height=\"6\" /></td><td colspan=\"3\" align=\"left\" class=\"tip_top\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"100\" height=\"2\" /></td><td width=\"6\" align=\"left\" valign=\"bottom\"><img src=\"/portal/img/tip13.gif\" alt=\"\" width=\"6\" height=\"6\" /></td></tr><tr><td class=\"tip_left\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"1\" height=\"8\" /></td><td colspan=\"3\" valign=\"middle\" bgcolor=\"#FFFFFF\" class=\"tip\">"+prev+"</td><td class=\"tip_right\"><img src=\"/portal/img/transp.gif\" alt=\"\" /></td></tr><tr><td width=\"7\" align=\"right\" valign=\"top\"><img src=\"/portal/img/tip31.gif\" alt=\"\" width=\"7\" height=\"6\" /></td><td align=\"left\" valign=\"top\" class=\"tip_bottom\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"75\" height=\"2\" /></td><td width=\"10\" align=\"center\" valign=\"top\"><img src=\"/portal/img/tipdziobek.gif\" alt=\"\" width=\"10\" height=\"9\" /></td><td align=\"left\" valign=\"top\" class=\"tip_bottom\"><img src=\"/portal/img/transp.gif\" alt=\"\" width=\"15\" height=\"2\" /></td><td width=\"6\" align=\"left\" valign=\"top\"><img src=\"/portal/img/tip33.gif\" alt=\"\" width=\"6\" height=\"6\" /></td></tr></table>",//poweravail (prevs)
    pax_info,//start (pax)
    promo_code,//start (promotion code)
    change_address,//summary (change address)
    change_payment,//summary (change payment)
    rules,//summary (see rules)
    agree,//summary (agreement)
    change_pax,//summary (change passengers)
    etix,//poweravail & pricing (etix, ptix)
    "",//resform (login)
    cvc, //resform CVC
    citizen, //resform (citizen)
    rules,//summary (see rules)
    pax_info_LDF,//start LDF (pax)
	business,
	SearchType,
	delivery_help,
	promotion,
	promotion_help
    ];

