
function hajlajt()
{
	var tags=document.getElementsByTagName('tr');
	for (var i=0; i<tags.length; i++)
	{
		if (tags[i].className=='jas' || tags[i].className=='cie' || tags[i].className=='impag' || tags[i].className=='jas1'  || tags[i].className=='jas2' || tags[i].className=='jas3')
		{


			tags[i].onmouseover = tagover;
			tags[i].onmouseout = tagout;

			//tags[i].onclick = tagclick;
		}
	}
	
	storeBColor = null;
	storeLColor = null;



	function tagover()
	{
		var extra=this.getElementsByTagName('img');
		

		if (extra[0])
		{
		//alert(window.location.href);
		if (extra[0].src=='http://www.alfastar.com.pl/images/last_minute.gif' || extra[0].src=="http://alfastar.com.pl/images/last_minute.gif" ||  extra[0].src=="http://www.alfastar.pl/images/last_minute.gif" ||  extra[0].src=="http://alfastar.pl/images/last_minute.gif" )
		
		extra[0].src="/images/last_minute2.gif";
		
		else if	(extra[0].src=='http://www.alfastar.com.pl/images/EXTACENA.gif' || extra[0].src=="http://alfastar.com.pl/images/EXTACENA.gif" ||  extra[0].src=="http://www.alfastar.pl/images/EXTACENA.gif" ||  extra[0].src=="http://alfastar.pl/images/EXTACENA.gif" )
		extra[0].src="/images/EXTACENA2.gif";

		else if	(extra[0].src=='http://www.alfastar.com.pl/images/EXTRA_TERMIN1.gif' || extra[0].src=="http://alfastar.com.pl/images/EXTRA_TERMIN1.gif" ||  extra[0].src=="http://www.alfastar.pl/images/EXTRA_TERMIN1.gif" ||  extra[0].src=="http://alfastar.pl/images/EXTRA_TERMIN1.gif" )
		extra[0].src="/images/EXTRA_TERMIN2.gif";
		

		}
		storeBColor = this.style.backgroundColor;
		this.style.backgroundColor = "#255599";
		this.style.color = "#FFFFFF";
		this.style.cursor = "pointer";
	}
	function tagout()
	{
		var extra=this.getElementsByTagName('img');
		
		if (extra[0])
		{
		if (extra[0].src=="http://www.alfastar.com.pl/images/last_minute2.gif" || extra[0].src=="http://alfastar.com.pl/images/last_minute2.gif" ||  extra[0].src=="http://www.alfastar.pl/images/last_minute2.gif" ||  extra[0].src=="http://alfastar.pl/images/last_minute2.gif"  )
		
		extra[0].src="/images/last_minute.gif";
		
		else if	(extra[0].src=="http://www.alfastar.com.pl/images/EXTACENA2.gif" || extra[0].src=="http://alfastar.com.pl/images/EXTACENA2.gif" ||  extra[0].src=="http://www.alfastar.pl/images/EXTACENA2.gif" ||  extra[0].src=="http://alfastar.pl/images/EXTACENA2.gif" )
		extra[0].src="/images/EXTACENA.gif";
		
		else if	(extra[0].src=='http://www.alfastar.com.pl/images/EXTRA_TERMIN2.gif' || extra[0].src=="http://alfastar.com.pl/images/EXTRA_TERMIN2.gif" ||  extra[0].src=="http://www.alfastar.pl/images/EXTRA_TERMIN2.gif" ||  extra[0].src=="http://alfastar.pl/images/EXTRA_TERMIN2.gif" )
		extra[0].src="/images/EXTRA_TERMIN1.gif";
		
		}
		this.style.backgroundColor = storeBColor;
		this.style.color = "#255599";
	}
	function tagclick()
	{
		this.all.tags("A")[0].click();
	}
}

function hajnav() {
  if (document.getElementById && document.createTextNode) {
    var tables=document.getElementsByTagName('table');
    for (var i=0;i<tables.length;i++)
    {
      if(tables[i].className=='nawigacja') {
        var trs=tables[i].getElementsByTagName('td');
        for(var j=0;j<trs.length;j++)
        {
			trs[j].onmouseover=function(){this.style.cursor = "pointer";storeBColor = this.style.backgroundColor;this.style.backgroundColor = "#255599";this.style.color = "#FFFFFF";return false}
			trs[j].onmouseout=function(){this.style.backgroundColor = storeBColor;this.style.color = "#000000";return false}
        }
      }
    }
  }
}

function wyl(id_wylotu)
{
	document.location.href='/oferta,Last minute/id_wylotu,'+id_wylotu+'/';
}
function imp(id_imprezy)
{
	document.location.href='/oferta,Last minute/id_imprezy,'+id_imprezy+'/';
}

function widok(url)
{
	window.location=url;
}
function wiov(obiekt,obr)
{
	obiekt.src=obr;
}
function golx(id_oferty,termin,wyzywienie)
{
    okienko('https://alfastar.pl/alfa/gate.php?id_oferty='+id_oferty+'&termin='+termin+'&wyzywienie='+wyzywienie,'820','530','','','1');
}
function golx_out(id_oferty,termin,wyzywienie,id_agent_outside)
{
    okienko('https://alfastar.pl/alfa/zgloszenie_form.php?id_agent_outside='+id_agent_outside+'&id_oferty='+id_oferty+'&termin='+termin+'&wyzywienie='+wyzywienie,'820','530','','','1');
}
function zapyt(id_oferty,termin,wyzywienie)
{
    okienko('/alfa/zapytaj.php?id_oferty='+id_oferty+'&termin='+termin+'&wyzywienie='+wyzywienie,'820','530','','','1');
}
function golxx(id_oferty,termin,wyzywienie)
{
	okienko('https://alfastar.pl/alfa/gate.php?oferta_dnia=1&id_oferty='+id_oferty+'&termin='+termin+'&wyzywienie='+wyzywienie,'820','530','','','1');
}

function g_przel(nr_rez)
{
	okienko('http://www.alfastar.com.pl/alfa/przelew.php?nr_rez='+nr_rez,'720','490','','','1');
}


var licz=0;
window.licznik=1;

function okienko(url, w, h, l, t, s)
{
   if (!l && !t)
   {	   
   	var winl = (screen.width-w)/2;
  	var wint = (screen.height-h)/2;
   	var t='location=no,toolbar=no,directories=no,menubar=yes,resizable=yes,scrollbars='+s+',status=yes,width='+w+',height='+h+',left='+winl+',top='+wint;
   }
   else
   {
   	  var t='location=no,toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars='+s+',status=no,width='+w+',height='+h+',left='+l+',top='+t;
   }
   	now = new Date();
    sec = now.getSeconds(); 
    sec = sec+""+now.getMinutes();
    namex="okno"+sec;
   	  
   	  nowe_okienko=window.open(url,namex,t);
   	  nowe_okienko.focus();
}
function okienko_wydruk(url)
{   
   	var w=670;
   	var h=500;
   	var winl = (screen.width-w)/2;
  	var wint = (screen.height-h)/2;
   	var t='location=no,toolbar=no,directories=no,menubar=yes,resizable=yes,scrollbars=yes,status=no,width=670,height=500,left='+winl+',top='+wint;

   	now = new Date();
    sec = now.getSeconds(); 
    sec = sec+""+now.getMinutes();
    namex="okno"+sec;
   	  
   	  nowe_okienko=window.open(url,namex,t);
   	  nowe_okienko.focus();
}

function ustaw()
{
if(document.all)
{document.all.stopka.style.top=document.body.clientHeight+document.body.scrollTop-40;

}
else
{document.layers.stopka.style.bottom=pageYOffset;}
setTimeout("ustaw()",1);
}

function prwydr(id_imprezy)
{
	var s,wybrane='';
	var ar = document.getElementsByTagName('input');
	for (var i=0; i<ar.length; i++)
	{
		if (ar[i].className=='zaz' && ar[i].checked==true)
		{
			//s=ar[i].name.split('[');
			//id=s[1].split(']');
			//wybrane+=id
			//s=ar[i].name.split('o');
			//wybrane+=s[1];
			wybrane+=ar[i].value+',';
		}
	}
	
	if (wybrane=='')
	{
		//check_all();
		alert('Proszę zaznaczyć oferty do wydruku.');
	}
	else
	{
		okienko('/system_inc/przygotuj_wydruk.php?id_imprezy='+id_imprezy+'&wybrane='+wybrane,'730','500','','','1');
	}
}


function htlwydr(id_hotelu)
{
		
		okienko('/wydruk_hotelu.php?id_hotelu='+id_hotelu,'730','650','','','1');
	
}

 function go_form(){
 
 var w=770;
 var h=650;
 var winl = (screen.width-w)/2;
 var wint = (screen.height-h)/2-50; 
   okno = window.open("", "okno", "width="+w+", height="+h+",left="+winl+",top="+wint+",scrollbars=yes"); 
  if (document.rez_dop.nr_rez.value>0) 
  {
   document.rez_dop.target="okno"; 
   document.rez_dop.action="http://alfastar.com.pl/alfa/przelew.php"; 
   document.rez_dop.submit();
   }
 }
 
