var index=0;
var actual_position = new Array();
actual_position[1]=0;
actual_position[2]=0;
actual_position[3]=0;
var clicked_buk=0;
var show_podserwisow=4;
var index_przesuniec=0;
var gameDataType=1;
var gameDataPodserwis=0;
var gameDataTypeName;

var backupData = new Array();
var active_li = new Array();
var change_li = new Array();
var timer=0;
var move_table_porownanie_buk_active =1 ;
var bukmacher_opis_active=0;

var left_src = "http://www.bukmacherzy.com/new_lay/images/porownanie_buk_box_d_on.gif";
var left_src2 = "http://www.bukmacherzy.com/new_lay/images/porownanie_buk_box_d_on.gif";

var right_src = "http://www.bukmacherzy.com//new_lay/images/porownanie_buk_box_f_on.gif";
var right_src2 = "http://www.bukmacherzy.com/new_lay/images/porownanie_buk_box_f_on.gif";


	var last_sort=8;
	var last_sort_type=0;
	var tabela_backup = new Array();
	var asc=true;

function click_a(obj)
{
    a = obj.getElementsByTagName("a");
    if(a.length==0)
        return false;

    window.location = a.item(0).href;

}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;


      for (i = 0; i < sText.length && IsNumber == true; i++)
      {
        Char = sText.charAt(i);
        if (ValidChars.indexOf(Char) == -1)
        {
         IsNumber = false;
        }
      }
       return IsNumber;

   }


	function sort(sort,obj,type)
	{		
		var tabelka = obj.parentNode.parentNode.parentNode.parentNode.id;
		tabela_backup[0] = $(tabelka).cloneNode(true);
			
		var th = obj.parentNode.parentNode.parentNode.getElementsByTagName("th");
		for(i = 0;i<th.length;i++)
		{	
			var img = th[i].getElementsByTagName("img");
			for(k=0;k<img.length;k++)
				img[k].src = "http://www.bukmacherzy.com/nl/new_lay/images/tab_a.gif";
		}
	
		if(last_sort == sort && asc==false){
			asc=true;
			src = "http://www.bukmacherzy.com/nl/new_lay/images/tab_c.gif";
		}else{
			src = "http://www.bukmacherzy.com/nl/new_lay/images/tab_b.gif";
			asc=false;
		}
		last_sort = sort;
		
		var tr_tags = obj.parentNode.parentNode.parentNode.getElementsByTagName("tr");
		obj.getElementsByTagName("img").item(0).src = src;
		var tr = new Array();
	
		var key=0
		for(var i=1;i<tr_tags.length;i++){
			tr[key] = new Array();
			var td = tr_tags[i].getElementsByTagName("td");
			tr[key]['value'] = td[sort].innerHTML; 
			tr[key]['key'] = i; 
			tr[key]['name'] = td[1].innerHTML; 
			key++;
		}
		
	
		for(j = 0; j < tr.length-1; j++){
			change=0;
			for (i=0; i<tr.length-1-j; i++){
				if((asc && new Number(tr[i+1]['value']) > new Number(tr[i]['value'])) || (!asc && new Number(tr[i+1]['value']) < new Number(tr[i]['value'])) )
				{
					x = tr[i]; 
					tr[i] = tr[i+1]; 
					tr[i+1] = x;
					change=1;
				}
			}
			if(!change) break; 
		}
		
		
		new Effect.Opacity(tabelka, { from: 1, to: 0, duration:1 });
		
		setTimeout(function(){
			//zamiana
			for(i=1;i<tr_tags.length;i++)
			{		
				var td = tabela_backup[0].getElementsByTagName("tr").item(tr[i-1]['key']).
				getElementsByTagName("td");

				
				tr_tags[0].parentNode.deleteRow(i);
				var x = tr_tags[0].parentNode.insertRow(i);
				x.id = "t_"+i;
				if(i%2!=0)
					x.className="tabele_parz_bg";
					
				for(var k=0;k<td.length;k++)
				{
					if(k==0){
						td_tmp = x.insertCell(0);
						td_tmp.className = td[k].className;
						td_tmp.innerHTML = i;
					}else{
						td_tmp = x.insertCell(k);
						td_tmp.className = td[k].className;
						td_tmp.innerHTML = td[k].innerHTML;
					}
				}

			}
		},900);
		new Effect.Opacity(tabelka, { from: 0, to: 1, delay:1.0 });
		
	}
	
function show_select_on(obj,direction,type)
{
	
	if(direction=="l")
		if(type==1)
			obj.src = "http://www.bukmacherzy.com/nl/new_lay/images/left_select_on.gif";
		else if(type==2)
			obj.src="http://www.bukmacherzy.com/nl/new_lay/images/box_bukmacherzy_left_on.gif";
		else
			obj.src=left_src;
	else
		if(type==1)	
			obj.src = "http://www.bukmacherzy.com/nl/new_lay/images/right_select_on.gif";
		else if(type==2)
			obj.src = "http://www.bukmacherzy.com/nl/new_lay/images/box_bukmacherzy_right_on.gif";
		else
			obj.src=right_src;
}

function show_hidden_text(obj)
{
      if($('hidden_text').style.display=='none'){
        Effect.BlindDown('hidden_text');
        obj.innerHTML = "Ukryj przywitanie"
      }else{
        Effect.BlindUp('hidden_text');
        obj.innerHTML = "Pokaż przywitanie"
      }
}

function convert_round(round)
{
	var out="";
	
	switch(parseInt(round))
	{
		case 998: out="trzecie miejsce";break;
		case 999: out="finał";break;		
		case 997: out="półfinały";break;
		case 996: out="ćwierćfinały";break;
		case 995: out="1/8";break;
		case 994: out="1/16";break;
		case 993: out="1/32";break;
		case 992: out="1/64";break;
		default: out=round;
	}
	return out;
}

function show_select_off(obj,direction,type)
{
	if(direction=="l")
		if(type==1)
			obj.src = "http://www.bukmacherzy.com/nl/new_lay/images/left_select.gif";
		else if(type==2)
			obj.src="http://www.bukmacherzy.com/nl/new_lay/images/box_bukmacherzy_left.gif";
		else
			obj.src=left_src;
	else
		if(type==1)	
			obj.src = "http://www.bukmacherzy.com/nl/new_lay/images/right_select.gif";
		else if(type==2)
			obj.src = "http://www.bukmacherzy.com/nl/new_lay/images/box_bukmacherzy_right.gif";
		else
			obj.src=right_src;

}

function isdefined(variable)
{
    return (typeof(window[variable]) == "undefined")?  false: true;
}

function select_menu_li(obj)
{
    obj.style.background="#c7ffcb";
}

function unselect_menu_li(obj)
{
    obj.style.background="transparent";
}


function set_embed_transparent(obj)
{
    embed = obj.getElementsByTagName("embed");
    for(i=0;i<embed.lenth;i++)
    {
        embed[i].setAttribute("wmode","transparent");
    }
}

function swf_transparent(bill)
{
    if(!bill)
        return false;

    //get object
	var sd = bill.getElementsByTagName("object");
    param = '<param name="wmode" value="transparent"/>';
    for(k=0;k<sd.length;k++)
    {
       var params = sd[k].getElementsByTagName("param");
       var old_sd_html = sd[0].innerHTML;
       sd[0].innerHTML = param+old_sd_html;
    }
    
    return true;
	var object_element = bill.getElementsByTagName("object");
	
	var txt="";
	set_embed_transparent(bill);
    return true;
	for(k=0;k<sd.length;k++)
	{
		var object = sd[k].parentNode;
		
		
        if(navigator.appName == "Microsoft Internet Explorer"){
			/*var old = object_element[0].outerHTML.toLowerCase();
			old = old.replace(/="window"/,'="transparent"');
			if(old.lastIndexOf('"wmode"',0)==-1)
			{
				param = param+old;
				old="";
				old=param;
			}
			object_element[0].outerHTML=old;
            */
		}else{
			var old = object.innerHTML.toLowerCase();
			old = old.replace(/="window"/,'="transparent"');
			
			if(old.lastIndexOf('"wmode"',0)==-1)
			{
				param = param+old;
				old="";
				old=param;
			}
           
			//object.innerHTML=old;
		
        }
		
	
	
	}
}

function deactive_box_menu(obj,type_name)
{

	timer=1;
	setTimeout(function(){
	if(timer>0)
	{
		var li = obj.getElementsByTagName("li");
				
		for(var i=0;i<li.length;i++)
		{
			if("d_"+active_li[type_name]===li[i].id)
				active_box_menu(li[i],type_name);
		}
	}},500);			
}

function right_search_other_active_box_menu(obj)
{

}

function search_other_active_box_menu(obj,type_name)
{
	var tables = obj.parentNode.getElementsByTagName("table");
	
	for(var i=0;i<tables.length;i++)
	{
		if(tables[i])
		{
			var a = tables[i].getElementsByTagName("a");
			if(a.length==0)return false;

			var tmp_el = tables[i].parentNode.parentNode;
			var a_clone = a.item(0).cloneNode(true);
			tables[i].parentNode.parentNode.innerHTML = "";		
			tmp_el.appendChild(a_clone);
		}
	}

}

function games_other_active_box_menu(obj)
{
	var tables = obj.parentNode.getElementsByTagName("table");

	for(var i=0;i<tables.length;i++)
	{	
		var a_element = tables[i].getElementsByTagName("a");
		if(a_element.length==0)return false;
		var tmp_el = tables[i].parentNode;
		var images = obj.getElementsByTagName("img");
		
		var a_clone = a_element.item(0).cloneNode(true);
		tables[i].parentNode.removeChild(tables[i]);
		tmp_el.appendChild(a_clone);
	}
}

function search_menu_gb_active_box_menu(obj)
{
	var tables = obj.parentNode.getElementsByTagName("table");
	
	for(var i=0;i<tables.length;i++)
	{
		var tmp_parent = tables[i].parentNode;
		var div = document.createElement("div");
		var a_elements = tables[i].getElementsByTagName("a");
		if(a_elements.length == 0)
			return false;
			
		var a_element_clone = a_elements.item(0).cloneNode(true);	
		tables[i].parentNode.removeChild(tables[i]);
		tmp_parent.appendChild(a_element_clone);	
		
	}

}

function active_box_menu(obj,type_name)
{
	change_li[type_name] = obj.id;
	timer=0;
	var tables = obj.getElementsByTagName("table");
	if(tables.length > 0)
		return false;
	
	if(obj.parentNode.parentNode.id=="selectors")
		games_other_active_box_menu(obj);
	else if(obj.parentNode.parentNode.id=="menu_gb")
		search_menu_gb_active_box_menu(obj);
	else
		search_other_active_box_menu(obj);

	var div = document.createElement("div");
	div.className="t";
	
	var table = document.createElement("table");
	table.cellSpacing=0;
	table.cellPadding=0;
	
	var row = table.insertRow(0);
	
	var td = row.insertCell(0);
	td.valign="top";
	var img = document.createElement("img");
	img.src = "http://www.bukmacherzy.com/nl/new_lay/images/chmurka_black_a.gif";
	td.appendChild(img);
	
	var td = row.insertCell(1);
	td.valign="top";
	td.className = "chmurka_black_td";
	var a_tmp = obj.getElementsByTagName("a");
	if(a_tmp.length > 0)
	{
		//var a = document.createElement("a");
		var a_clone = a_tmp.item(0).cloneNode(true);
		//a.href = a_tmp.item(0).href;
		//a.onclick = function(){ return setGameDataType(1);};
		//a.innerHTML = a_tmp.item(0).innerHTML;
		td.appendChild(a_clone);
		
	}else{
		td.innerHTML = obj.innerHTML;
	}
	
	var td = row.insertCell(2);
	td.valign="top";
	var img = document.createElement("img");
	img.src = "http://www.bukmacherzy.com/nl/new_lay/images/chmurka_black_b.gif";
	td.appendChild(img);
	
	row = table.insertRow(1);
	td = row.insertCell(0);
	td.className="strzalka_td";
	td.colSpan=3;
	
	img = document.createElement("img");
	img.className="strzalka";
	img.src="http://www.bukmacherzy.com/nl/new_lay/images/strzalka_dol.gif";
	td.appendChild(img);
	
	div.appendChild(table);
	
	var a_elements = obj.getElementsByTagName("a");
	if(a_elements.length>0)
		a_elements.item(0).parentNode.removeChild(a_elements.item(0));
	
	obj.appendChild(div);

}

 function findPosX(obj)
  {
	if(!obj)return 0;
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
	if(!obj)return 0;
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

function move_table_porownanie_buk(pokaz,direction)
{

	if(!move_table_porownanie_buk_active)
		return false;
		
	move_table_porownanie_buk_active=0;
	
	if(!bukmacherzy[pokaz])
		return false;
		
	var pb = $('porownanie_buk_table');
	var ul = pb.getElementsByTagName("ul");
	
	if(direction==0){
		var l=0;var r=8;
	}else{
		var l=7;var r=0;
	}
	
	if(!ul.item(l))
		return false;
		
	if(direction==0)
		new Effect.Shrink('ul_'+l);
	else
		new Effect.Shrink('ul_'+l,{direction:'top-left'});
	
	setTimeout(function(){
		var tmp_name = 'ul_'+(l>2?l+1:l);
		if($(tmp_name))
			pb.removeChild($(tmp_name));
		
		for(var i=1;i<ul.length;i++)
		{
			ul[i].id="ul_"+new Number(i-1);
		}
		move_table_porownanie_buk_active=1;
	},900);

	var new_ul = document.createElement("ul");
	new_ul.style.display="none";
	if(direction==0)
		new_ul.id = "ul_8";
	else	
		new_ul.id = "ul_0";
	
	var li = ul.item(0).getElementsByTagName("li");
	var li2 = ul.item(1).getElementsByTagName("li");
	
	for(var i=0;i<li.length;i++)
	{
		var new_li = document.createElement("li");
		var tmp = li[i].id.replace(/bp_/,"");
		var bi = bukmacherzy[pokaz][1];
		new_li.className = li2[i].className;
		new_li.style.margin = li2[i].style.margin;

		if(new_li.className=="margintop"){
			new_li.style.margin = "21px 0 0 0";
            new_li.style.background="transparent";
        }

		if(p[bi][tmp]){
			new_li.innerHTML = p[bi][tmp];
   
            new_li.onmouseover=function(e){
                var targ;
                if (!e) var e = window.event;
                
                if (e.target) targ = e.target;
                else if (e.srcElement) targ = e.srcElement;
                if (targ.nodeType == 3) // defeat Safari bug
                    targ = targ.parentNode;

                select_porownanie_row(targ.id);

        };
            new_li.onmouseout=function(e){
                var targ;
                if (!e) var e = window.event;

                if (e.target) targ = e.target;
                else if (e.srcElement) targ = e.srcElement;
                if (targ.nodeType == 3) // defeat Safari bug
                    targ = targ.parentNode;

                unselect_porownanie_row(targ.id);


            };
            new_li.id = i;

        }else{
			new_li.inneHTML = "&nbsp;";
        }
		if(p[bi][tmp]==1 && new_li.className=="parz")
			new_li.innerHTML = '<img src="http://www.bukmacherzy.com/nl/new_lay/images/s_parz.gif" />&nbsp;';
		else if(p[bi][tmp]==1 && new_li.className!="parz")
			new_li.innerHTML = '<img src="http://www.bukmacherzy.com/nl/new_lay/images/s_.gif" />&nbsp;';
		else if(p[bi][tmp]==0 && new_li.className=="parz")
			new_li.innerHTML = '<img src="http://www.bukmacherzy.com/nl/new_lay/images/sn_parz.gif" />&nbsp;';
		else if(p[bi][tmp]==0)
			new_li.innerHTML = '<img src="http://www.bukmacherzy.com/nl/new_lay/images/sn_.gif" />&nbsp;';
		
		new_ul.appendChild(new_li);
	}
    
	new_li = document.createElement("li");
	new_li.className="opis_porownanie_buk";
	var img = document.createElement("img");
	img.src = "http://www.bukmacherzy.com/nl/new_lay/images/info_icon.gif";
	new_li.appendChild(img);
	new_li.innerHTML += " Opis "+bukmacherzy[pokaz][0];
   
	new_ul.appendChild(new_li);
 
	new_li = document.createElement("li");
	var new_div = document.createElement("div");
	new_div.className="odwiedz";

	var a=document.createElement("a");
	a.href=bukmacherzy[pokaz][2];
	a.target="_blank";
	a.innerHTML = "Odwied\u017a <br /><strong>"+bukmacherzy[pokaz][0]+"</strong>";
	new_div.appendChild(a)
    new_li.style.background="#1f1f1f";
	new_li.appendChild(new_div);
	new_ul.appendChild(new_li);
	//<li><div class="odwiedz"><a href="{$bukmacherzy[$smarty.section.z.index].book_url}" target="_blank">Odwiedź <br /><strong>{$bukmacherzy[$smarty.section.z.index].book_name}</strong></a></div></li>
		
	ul = pb.getElementsByTagName("ul");
	
	if(direction==0)
		pb.appendChild(new_ul);
	else
		pb.insertBefore(new_ul,ul.item(1));

	//ul.item(r).appear({delay:0.7});
	new Effect.Appear("ul_"+r,{delay:0.7});
	
		
}  
var move_games_act=true;
var show_podserwisow_porownanie=0;


var move_porownanie_index = 8;

function move_games(direction,type)
{	
	name="g_";show_podserwisow=4;
	if(type==2){
		name="b_";
		show_podserwisow=9;
	}else if(type==3){
		show_podserwisow=8;name="c_";
		if(show_podserwisow_porownanie)
			show_podserwisow = show_podserwisow_porownanie;
		
		if(!move_games_act)return false;
		move_games_act=false;
		setTimeout(function(){move_games_act=true},700);
	}
	
	if(direction==0)
	{
		var pokaz = actual_position[type]+show_podserwisow;		
		var obj = $(name+new Number(actual_position[type]));
		
		if(!obj)return false;
		
		if((type==1 && !podserwisy[pokaz]) || (!bukmacherzy[pokaz] && type==2) || (!bukmacherzy[pokaz] && type==3))
			return false;
						
		new Effect.Shrink(name+actual_position[type],{duration:1});

	}else if(direction==1){
		var pokaz = actual_position[type]-1;		
		var przesun = actual_position[type]+show_podserwisow-1;
		var obj = $(name+przesun);
		
		if(((type==1 &&!podserwisy[pokaz] || !obj)) || (!bukmacherzy[pokaz] && type==2) ||(!bukmacherzy[pokaz] && type==3))
			return false;

		new Effect.Shrink(name+przesun,{duration:1,direction:'top-right'});
	}	
	
	if(type==3)
		move_table_porownanie_buk(pokaz,direction);

		var li = document.createElement("li");
		li.id = name+pokaz;
			
		li.style.opacity="0";	
		li.style.background="none";
		li.className="filter_opacity_none";
	
		if(type==1){
			var img = document.createElement("img");
			img.src = "http://www.bukmacherzy.com/nl/new_lay/images/podserwis_"+podserwisy[pokaz][1]+".gif";
			img.className = "logo";
			li.appendChild(img);
			li.onclick = function(){ return setGameDataPodserwis(podserwisy[pokaz][1])};
			li.onmouseout=function(){podserwis_li_unactive(this)};
			li.onmouseover=function(){podserwis_li_active(this)};		
			
			var a = document.createElement("a");
			a.innerHTML = podserwisy[pokaz][0];
			li.appendChild(a);
			
		}else{
			var img = document.createElement("img");
			img.onclick=function(){setBukmacherOpis(pokaz)};
			if(type==2){
				li.onmouseover=function onmouseover(){return select_buk(this)};
				li.onmouseout=function onmouseout(){return unselect_buk(this)};
			}else if(type==3){
				li.onmouseover=function onmouseover(){ select_buk(this);select_buk_col(this);};
				li.onmouseout = function onmouseout(){unselect_buk(this);unselect_buk_col(this)};	
			}
			
			img.src = "http://www.bukmacherzy.com/nl/new_lay/images/loga/"+bukmacherzy[pokaz][1]+".gif";
			
			if(type==3)
			{
				a_new = document.createElement("a");
				a_new.target="_blank";
				a_new.href = bukmacherzy[pokaz][3];
				a_new.appendChild(img);
				li.appendChild(a_new);
			}else{
				li.appendChild(img);
			}
		}
	
		if(direction==0)
		{
			obj.parentNode.appendChild(li);

			if(type==1)
				$(name+new Number(pokaz-1).toString()).style.background="url('http://www.bukmacherzy.com/nl/new_lay/images/selectors_seperator.gif') no-repeat top right";;
			
			obj.id="";
			setTimeout(function(){
				li.className="filter_opacity_max";
				obj.parentNode.removeChild(obj);
				},900
			);
		
		new Effect.Opacity(name+pokaz, { from: 0, to: 1, duration: 1 });
		actual_position[type]++;			
	
	}else if(direction==1){

		obj.parentNode.insertBefore(li,$(name+actual_position[type]));
		if(type==1)
			li.style.background="url('http://www.bukmacherzy.com/nl/new_lay/images/selectors_seperator.gif') no-repeat top right";;
			
		obj.visible="hidden";
		setTimeout(function(){
			li.className="filter_opacity_max";
			obj.parentNode.removeChild(obj);
			},900
		);
		new Effect.Opacity(name+pokaz, { from: 0, to: 1, duration: 1 });
					
		actual_position[type]--;

	}

	show_podserwisow=4;
}

var lis_bg = new Array();

function select_buk_col(obj)
{
	var li = obj.parentNode.getElementsByTagName("li");
	for(var i=0;i<li.length;i++)
	{
		if(li[i].id==obj.id){
			var lis = $('ul_'+i).getElementsByTagName("li");
            
			for(var z=0;z<lis.length-2;z++)
				if(lis[z].innerHTML){
					lis_bg[z] = lis[z].className;
                    lis[z].style.background="url('http://www.bukmacherzy.com/nl/new_lay/images/porownianie_bg_a.gif')";
                    img = lis[z].getElementsByTagName("img");
                    if(img.length > 0){
                       img.item(0).src = img.item(0).src.replace(/s_/,"s_parz");
                       
                    }
				}
			
		}
	}
}

function bg_bottom_col()
{
    var obj = $('porownanie_buk_table');
	var ul = obj.parentNode.getElementsByTagName("ul");
	for(var i=0;i<ul.length;i++)
	{
        var lis = ul.item(i).getElementsByTagName("li");
        
        for(var z=lis.length-2;z<lis.length;z++)
             lis[z].style.background="none";
		
        for(z=0;z<lis.length-2;z++)
            if(lis[z].innerHTML=="")
              lis[z].style.background="none";

	}
}

function podserwis_li_active(obj)
{
	obj.className="podserwis_li_active";
	obj.style.background="url('http://www.bukmacherzy.com/nl/new_lay/images/podserwis_li_active.gif') repeat-x";
	
	var img = obj.getElementsByTagName("img");
	if(img.length>0 && img[0].src.substr(img[0].src.length-7,7)!="_on.gif")
		img[0].src = img[0].src.replace(/.gif/,"_on.gif");

}

function podserwis_li_unactive(obj)
{
	obj.className="";
	obj.style.background="";
	
	var img = obj.getElementsByTagName("img");
	if(img.length>0 && img[0].src.substr(img[0].src.length-7,7)=="_on.gif")
		img[0].src = img[0].src.replace(/_on.gif/,".gif");

}

function unselect_buk_col(obj)
{
	var li = obj.parentNode.getElementsByTagName("li");
	for(var i=0;i<li.length;i++)
	{
		if(li[i].id==obj.id){
       
			var lis = $('ul_'+i).getElementsByTagName("li");
			for(var z=0;z<lis.length-2;z++)
				if(lis[z].innerHTML){
					lis[z].className=lis_bg[z];
					lis[z].style.color="";
                    lis[z].style.background="#1f1f1f";
                    img = lis[z].getElementsByTagName("img");
                    if(img.length > 0){
                       img.item(0).src = img.item(0).src.replace(/s_parz/,"s_");

                    }
				}
				
			return true;
		}
	}
}
 
function unselect_all_buk(obj)
{
	if(!obj) return false;
	var li = obj.parentNode.getElementsByTagName("li");
	for(var i=0;i<li.length;i++)
		if(li[i].className=="active")
			unselect_buk(li[i]);
}
 
function unselect_buk(obj)
{
	obj.className="";
	obj.style.background="";
	
	var imgs = obj.getElementsByTagName("img");
	if(imgs.length > 1)
		imgs[1].parentNode.removeChild(imgs[1]);
}

var moveClickA = new Array();
function endMoveClick(obj,direction,type)
{

	moveClickA[type]=false;
}

function moveClick(obj,direction,type)
{
	return true;
	moveClickA[type] = true;
	setTimeout(function(){
		move_games(direction,type);
		setTimeout(function(){
		if(moveClickA[type])
			moveClick(obj,direction,type);
			},1500);
		},850);
}

function select_buk(obj)
{
	if(!obj)return false;
	unselect_all_buk(obj);
	obj.className="active";
	obj.style.background = "url('http://www.bukmacherzy.com/nl/new_lay/images/box_bukmacherzy_active.gif') repeat-x";
				
	/*var img = document.createElement("img");
	img.className="strzalka";
	img.src="http://www.bukmacherzy.com/nl/new_lay/images/box_bukmacherzy_strzalka.gif";

	obj.appendChild(img);*/
}

function search_clicked_buk(obj)
{
	//var lis = obj.getElementsByTagName("li");
	select_buk($('b_'+bukmacher_opis_active));
}

function move_all_podserwisy(ile,dlugo,przedluz,yp)
{
	
	for(var i=0;i<=6;i++)
	{
		var name = new Number(i+actual_podserwis).toString();
		if($("g_"+name) && $('g_'+name).id)
		{
			new Effect.Parallel([
				new Effect.Move("g_"+name,{sunc:true,x:ile,y:yp,mode: 'relative' })	
			],{
			duration: dlugo,
			delay: przedluz
			});

		}
	}
	if(parseInt(ile) > 0){
		index_przesuniec++;
		
	}else{
		index_przesuniec=0;
	}

}

function replace_li_id(id,id2)
{
	$(id).id = id2;
}

function delete_li(to_delete)
{
	var obj = $(to_delete);
	obj.parentNode.removeChild(obj);
}

function move_right(obj)
{

}

function setGameDataType(id,name)
{
	gameDataType=id;
	gameDataTypeName=name;
	active_li[gameDataTypeName] = gameDataType;
	
	return false;
}

function setGameDataPodserwis(id)
{
	
	gameDataPodserwis=id;
	getData();
	return false
}

function getData()
{
	active_li[gameDataTypeName] = gameDataType;
	
	if((gameDataType && gameDataPodserwis) || gameDataType > 4)
	{
		switch(gameDataType)
		{
			case 1:var type="getPodserwisTypy";break;
			case 2:var type="getTables";break;
			case 3:var type="getPodserwisTypy";break;
			case 4:var type="getPodserwisTypy";break;
			case 5:var type="getOstatniePosty";break;
			case 6:setZaklady(false);return false;break;
			case 7:setNewsyBukmacherskie(false);return false;break;
			case 8:var type="getBonusy";break;
			case 9:var type="getNewsySportowe";break;
			case 10:var type="getBukmacherDnia";break;
			
		}

		if(type){
		advAJAX.get({	
				url: "http://www.bukmacherzy.com/nl/a.php?url="+type+"/?id="+gameDataPodserwis,
				onSuccess : function(obj) { setData(obj.responseXML,gameDataType); },
				onError : function(obj) { alert("Error: " + obj.status); }
			});
			
		}
	}
}

function setZaklady(xml)
{

	if(backupData['most_content'])
	{
		new Effect.Opacity('most_content',{ from: 1, to: 0 ,duration:1.0});
	
		setTimeout(function(){
			$('most_content').innerHTML = backupData['most_content'];
		},900);
		new Effect.Opacity('most_content',{ from: 0, to: 1 ,duration:1.0,delay:1.0});
	
	}
}

function setPosty(xml)
{
	backupData['most_content'] = $('most_content').innerHTML;
	
	new Effect.Opacity('most_content',{ from: 1, to: 0 ,duration:1.0});
	
	setTimeout(function(){
		var topics = xml.getElementsByTagName("i");
		var table = document.createElement("table");
		
		for(var i=0;i<topics.length;i++)
		{
			var tr = table.insertRow(i);
				
			var td = tr.insertCell(0);
			if(i%2==0)
				td.style.background="#1c5a48";
			
			var a = document.createElement("a");
			a.innerHTML = topics[i].getElementsByTagName("title").item(0).firstChild.nodeValue;
			a.target="_blank";
			a.href = "http://typujemy.pl/forum/viewtopic.php?t="+topics[i].getElementsByTagName("id").item(0).firstChild.nodeValue;
			td.appendChild(a);
			
		}
		
		$('most_content').innerHTML = "";
		$('most_content').appendChild(table);
	},900);
	
	new Effect.Opacity('most_content',{ from: 0, to: 1 ,duration:1.0,delay:1.0});
	
	
}

function setNewsy(xml)
{
	if(!backupData['news_content'])
		backupData['news_content'] = $('news_content').innerHTML;
	
	new Effect.Opacity('news_content',{ from: 1, to: 0 ,duration:1.0});
	
	setTimeout(function(){
		var news = xml.getElementsByTagName("content_title");
		var table = document.createElement("table");
		table.cellSpacing=0;
		table.cellPadding=0;
		table.width="100%";
		for(var i=0;i<news.length;i++)
		{	
			var tr = table.insertRow(i);
			
			if(i%2==0)
				tr.style.background="#2f2f2f";
				
			var td = tr.insertCell(0);
			var img = document.createElement("img");
			if(i%2!=0)
				img.src = "http://www.bukmacherzy.com/nl/new_lay/images/news_icon_a.gif";
			else
				img.src = "http://www.bukmacherzy.com/nl/new_lay/images/news_icon_b.gif";
			td.appendChild(img);
			td = tr.insertCell(1);
			
			var a = document.createElement("a");
			a.href="http://www.bukmacherzy.com/nl/"+news[i].parentNode.getElementsByTagName("content_url").item(0).firstChild.nodeValue;
			a.innerHTML = news[i].parentNode.getElementsByTagName("content_title").item(0).firstChild.nodeValue;
			td.appendChild(a);
			
			td = tr.insertCell(2);
			td.className="td_right";
			td.innerHTML = news[i].parentNode.getElementsByTagName("content_modified").item(0).firstChild.nodeValue;
		
		}
		$('news_content').innerHTML = "";
		$('news_content').appendChild(table);
	},900);
	new Effect.Opacity('news_content',{ from: 0, to: 1 ,duration:1.0, delay:1.0});
	
	
}

function setKursy(xml)
{
	if(!backupData['games'])
		backupData['games'] = $('games').innerHTML;
		
	new Effect.Opacity('games',{duration:1,from:1,to:0});
		
	setTimeout(function(){
		var table = document.createElement("table");
		table.cellSpacing=0;
		table.cellPadding=0;
		var tr = table.insertRow(0);
		
		var th = document.createElement("th");
		th.innerHTML ="data";
		tr.appendChild(th);
		th = document.createElement("th");
		th.innerHTML ="godz";tr.appendChild(th);
		th = document.createElement("th");
		th.innerHTML ="drużyna";tr.appendChild(th);
		th = document.createElement("th");
		th.innerHTML ="drużyna";tr.appendChild(th);
		th = document.createElement("th");
		th.innerHTML ="1";tr.appendChild(th);
		th = document.createElement("th");
		th.innerHTML ="x";tr.appendChild(th);
		th = document.createElement("th");
		th.innerHTML ="2";tr.appendChild(th);
		
		var games = xml.getElementsByTagName("teams");

		for(var i=0;i<games.length;i++)
		{
			var game_node = games[i].parentNode;
			var date = new Date(new Number(game_node.getAttribute("game_date"))*1000);
			tr = table.insertRow(i+1);
			if(i%2==0)
				tr.className = "parz";
				
			td = tr.insertCell(0);
			td.innerHTML = date.format("d-m-Y");
			td = tr.insertCell(1);
			td.innerHTML = date.format("H:i");
			td = tr.insertCell(2);
			teams = game_node.getElementsByTagName("teams");
			if(teams.length > 0 )
			{
				var team = teams.item(0).getElementsByTagName("i");
				td.innerHTML = team.item(0).getAttribute("team_item_name");
				td = tr.insertCell(3);
				td.innerHTML = team.item(1).getAttribute("team_item_name");
			}
			
			var odds = game_node.getElementsByTagName("odds");
			var odds_items = odds.item(0).getElementsByTagName("i");
			for(var y=0;y<odds_items.length;y++)
			{
				td = tr.insertCell(4+y);
				var a = document.createElement("a");
				var value = odds_items.item(y).getAttribute("max_a");
				if(value){
					a.innerHTML = value;a.href = odds_items.item(y).getAttribute("book_link");
				}else{
					a.innerHTML = "-";
				}
				td.appendChild(a);			
			}
			 
		}
			
		$('games').innerHTML="";
		$('games').appendChild(table);
	},980);
	
	new Effect.Opacity('games',{duration:1,from:0,to:1,delay:1.0});
		
}

function setTabele(xml)
{
	if(!backupData['games'])
		backupData['games'] = $('games').innerHTML;
	
	var leagues = xml.getElementsByTagName("teams");
	if(leagues.length == 0)
		alert("Brak tabel");
		
		new Effect.Opacity('games',{duration:1,from:1,to:0});
		
	setTimeout(function (){
		$('games').innerHTML="";
		for(var i=0;i<leagues.length;i++)
		{
				
			var table = document.createElement("table");
			table.cellSpacing=0;
			table.cellPadding=0;
				
			var tr = table.insertRow(0);
			
			
			var th = document.createElement("th");
			th.innerHTML = "";
			th.width="200";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "Ogólnie";
			th.colSpan = 7;
			th.align="center";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "U siebie";
			th.colSpan = 7;
			th.align="center";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "Na wyjeździe";
			th.colSpan = 6;
			th.align="center";
			tr.appendChild(th);
			
			tr = table.insertRow(1);
			th = document.createElement("th");
			th.innerHTML ="Drużyna";
			
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML ="M";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "W";
			tr.appendChild(th);

			th = document.createElement("th");
			th.innerHTML = "R";
			tr.appendChild(th);

			th = document.createElement("th");
			th.innerHTML = "P";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "Gz";
			tr.appendChild(th);

			th = document.createElement("th");
			th.innerHTML = "Gs";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.className = "table_border";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML ="M";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "W";
			tr.appendChild(th);

			th = document.createElement("th");
			th.innerHTML = "R";
			tr.appendChild(th);

			th = document.createElement("th");
			th.innerHTML = "P";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "Gz";
			tr.appendChild(th);

			th = document.createElement("th");
			th.innerHTML = "Gs";
			tr.appendChild(th);

			th = document.createElement("th");
			th.className = "table_border";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML ="M";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "W";
			tr.appendChild(th);

			th = document.createElement("th");
			th.innerHTML = "R";
			tr.appendChild(th);

			th = document.createElement("th");
			th.innerHTML = "P";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "Gz";
			tr.appendChild(th);

			th = document.createElement("th");
			th.innerHTML = "Gs";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "Rg";
			tr.appendChild(th);
			
			th = document.createElement("th");
			th.innerHTML = "Punkty";
			tr.appendChild(th);
		
			if(leagues.length > 0)
			{
				var div = document.createElement("div");
				if(leagues.length > 1){
					var div2 = document.createElement("div");
					div2.innerHTML = leagues[i].parentNode.getAttribute("league_item_name");
					div2.className="league_title";
					div.appendChild(div2);
				}
				
			}
			
			var teams = leagues[i].parentNode.getElementsByTagName("i");
			
			for(var x=0;x<teams.length;x++)
			{
				var team_node = teams[x];
				tr = table.insertRow(2+x);
				if(x%2==0)
					tr.className = "parz";
				
				td = tr.insertCell(0);
				td.innerHTML = team_node.getAttribute("team_name");
				
				td = tr.insertCell(1);
				td.innerHTML = team_node.getAttribute("games");
				
				td = tr.insertCell(2);
				td.innerHTML = team_node.getAttribute("wins");
				
				td = tr.insertCell(3);
				td.innerHTML = team_node.getAttribute("draws");
			
				td = tr.insertCell(4);
				td.innerHTML = team_node.getAttribute("defeits");
				
				td = tr.insertCell(5);
				td.innerHTML = team_node.getAttribute("goals");
				
				td = tr.insertCell(6);
				td.innerHTML = team_node.getAttribute("goals_defeits");
				
				td = tr.insertCell(7);
				td.className = "table_border";
				
				td = tr.insertCell(8);
				td.innerHTML = team_node.getAttribute("home_games");
				
				td = tr.insertCell(9);
				td.innerHTML = team_node.getAttribute("home_wins");
		
				td = tr.insertCell(10);
				td.innerHTML = team_node.getAttribute("home_draws");

				td = tr.insertCell(11);
				td.innerHTML = team_node.getAttribute("home_defeits");			

				td = tr.insertCell(12);
				td.innerHTML = team_node.getAttribute("home_goals");
				
				td = tr.insertCell(13);
				td.innerHTML = team_node.getAttribute("home_goals_defeits");
				
				td = tr.insertCell(14);
				td.className = "table_border";	

				td = tr.insertCell(15);
				td.innerHTML = team_node.getAttribute("away_games");				
				
				td = tr.insertCell(16);
				td.innerHTML = team_node.getAttribute("away_wins");			

				td = tr.insertCell(17);
				td.innerHTML = team_node.getAttribute("away_draws");

				td = tr.insertCell(18);
				td.innerHTML = team_node.getAttribute("away_defeits");
				
				td = tr.insertCell(19);
				td.innerHTML = team_node.getAttribute("away_goals");

				td = tr.insertCell(20);
				td.innerHTML = team_node.getAttribute("away_goals_defeits");
				
				td = tr.insertCell(21);
				td.innerHTML = team_node.getAttribute("goals_diffrence");

				td = tr.insertCell(22);
				td.innerHTML = team_node.getAttribute("points");			
			}
			
			
			if(x>0 && leagues.length > 0){
				div.appendChild(table);
				$('games').appendChild(div);
			}
			
		}
	},980);
	new Effect.Opacity('games',{duration:1,from:0,to:1,delay:1.0});
		
	if(leagues.length == 0)
	{
		$('games').innerHTML="";
		$('games').appendChild(table);
	}

}


function setTypy(xml)
{
	if(!backupData['games'])
		backupData['games'] = $('games').innerHTML;
		
	new Effect.Opacity('games',{duration:1,from:1,to:0});
	
	setTimeout(function(){
		var table = document.createElement("table");
		table.cellSpacing=0;
		table.cellPadding=0;
		var tr = table.insertRow(0);
		td = tr.insertCell(0);
		td.innerHTML ="data";
		td = tr.insertCell(1);
		td.innerHTML ="godz";
		td = tr.insertCell(2);
		td.innerHTML ="drużyna";
		td = tr.insertCell(3);
		td.innerHTML ="drużyna";
		td = tr.insertCell(4);
		td.innerHTML ="1";
		td = tr.insertCell(5);
		td.innerHTML ="x";
		td = tr.insertCell(6);
		td.innerHTML ="2";
		td = tr.insertCell(7);
		td.innerHTML ="1x";
		td = tr.insertCell(8);
		td.innerHTML ="x2";
		td = tr.insertCell(9);
		td.innerHTML ="12";
		
		var games = xml.getElementsByTagName("teams");

		for(var i=0;i<games.length;i++)
		{
			var game_node = games[i].parentNode;
			var date = new Date(new Number(game_node.getAttribute("game_date"))*1000);
			tr = table.insertRow(i+1);
			if(i%2==0)
				tr.className = "parz";
				
			td = tr.insertCell(0);
			td.innerHTML = date.format("d-m-Y");
			td = tr.insertCell(1);
			td.innerHTML = date.format("H:i");
			td = tr.insertCell(2);
			teams = game_node.getElementsByTagName("teams");
			if(teams.length > 0 )
			{
				var team = teams.item(0).getElementsByTagName("i");
				td.innerHTML = team.item(0).getAttribute("team_item_name");
				td = tr.insertCell(3);
				td.innerHTML = team.item(1).getAttribute("team_item_name");
			}
			
			var types_sum_node = game_node.getElementsByTagName("types");
			var types_sum = types_sum_node.item(0).getAttribute("sum");
			
			//types
			var types_nodes = types_sum_node.item(0).getElementsByTagName("i");
			for(var z=0;z<6;z++){td = tr.insertCell(4+z);td.innerHTML = "0%";}
		
			for(var z=0;z<types_nodes.length;z++)
			{
				procent = Math.round(100*types_nodes[z].getAttribute("ilosc")/types_sum);
				tr.cells[3+new Number(types_nodes[z].getAttribute("odd_value_id"))].innerHTML = procent+"%";
			} 
		}
		$('games').innerHTML="";
		$('games').appendChild(table);
	},980);
	
	
	new Effect.Opacity('games',{duration:1,from:0,to:1,delay:1.0});
}

function setData(xml,type)
{
	switch(type)
	{
		case 1:setWyniki(xml);break;
		case 2:setTabele(xml);break;
		case 3:setTypy(xml);break;
		case 4:setKursy(xml);break;	
		case 5:setPosty(xml);break;
		
		case 8:setBonusy(xml);break;
		case 9:setNewsy(xml);break;
		case 10:setBukmacherDnia(xml);break;
	}
}	

function setNewsyBukmacherskie(xml)
{
	if(backupData['news_content'])
	{
		new Effect.Opacity('news_content',{ from: 1, to: 0 ,duration:1.0});
	
		setTimeout(function(){
			$('news_content').innerHTML = backupData['news_content'];
		},900);
		
		new Effect.Opacity('news_content',{ from: 0, to: 1 , delay:1.0, duration:1.0});
	
	}
		
}

function setWyniki(xml)
{

	var table = document.createElement("table");
	table.cellSpacing=0;
	table.cellPadding=0;
	
	var tr = table.insertRow(0);
	var th = "<th>data:</th><th>godz:</th><th>drużyna:</th><th></th><th>drużyna:</th><th>wynik:</th><th>rozgrywki:</th>";
	tr.innerHTML = th;
	
	
	var games = xml.getElementsByTagName("teams");
	for(var i=0;i<games.length;i++)
	{
		var game_node = games[i].parentNode;
		tr = table.insertRow(1+i);
		
		var td = tr.insertCell(0);
		td.className="date";
		td.innerHTML = new Date(new Number(game_node.getAttribute("game_date"))*1000).format("d.m.Y");
		
		var td = tr.insertCell(1);
		td.className="date";
		td.innerHTML = new Date(new Number(game_node.getAttribute("game_date"))*1000).format("H:i");
		
		var teams = games[i].getElementsByTagName("i");
		if(teams.length < 2)
			return alert("Blad z teams");
			
		td = tr.insertCell(2);
		td.className="n";
		td.innerHTML = teams[0].getAttribute("team_item_name");
		
		td = tr.insertCell(3);
		td.className="n";
		td.innerHTML="";
		
		td = tr.insertCell(4);
		td.className="n";
		td.innerHTML=teams[1].getAttribute("team_item_name");
	
		td = tr.insertCell(5);
		td.className="n";
		td.innerHTML=game_node.getAttribute("game_score");
		
		
	}
	var div = document.createElement("div");
	div.className = "table";
	div.appendChild(table);
	
	$('games').innerHTML = "";
	$('games').appendChild(div);
	
							
/*
	if(backupData['games'])
	{
		new Effect.Opacity('games',{ from: 1, to: 0 ,duration:1.0});
	
		setTimeout(function(){
			$('games').innerHTML = backupData['games'];
		},900);
		
		new Effect.Opacity('games',{ from: 0, to: 1 , delay:1.0, duration:1.0});
	
	}
	*/
	
}

function setBukmacherDnia(xml)
{
	if(!backupData['news_content'])
		backupData['news_content'] = $('news_content').innerHTML;	
	
	new Effect.Opacity('news_content',{ from: 1, to: 0 ,duration:1.0});

	setTimeout(function(){
	
		var buk_id_t = xml.getElementsByTagName("book_id");
		if(buk_id_t.length == 0)
			return false;
		buk_name="";
		buk_desc="";
		
		buk_id = buk_id_t.item(0).firstChild.nodeValue;
		var desc_node = buk_id_t.item(0).parentNode.getElementsByTagName("book_description")
		if(desc_node.length>0 && desc_node.item(0).firstChild)
			buk_desc = desc_node.item(0).firstChild.nodeValue;
		
		var name_node = buk_id_t.item(0).parentNode.getElementsByTagName("book_name");
		if(name_node.length>0 && name_node.item(0).firstChild)
			buk_name = name_node.item(0).firstChild.nodeValue;

		var div = document.createElement("div");
		div.className="main_news";
		div.style.background = "url('http://www.bukmacherzy.com/nl/new_lay/images/bukmacherzy/"+buk_id+".gif')";
		
		var div2 = document.createElement("div");
		var strong = document.createElement("strong");
		strong.innerHTML = buk_name+"<br />a";
		
		div2.appendChild(strong);
		div.appendChild(div2);
		
		var div3 = document.createElement("div");
		div3.className="bukmacher_dnia_opis";
		div3.innerHTML = buk_desc;
		
		$('news_content').innerHTML = "";
		$('news_content').appendChild(div);
		$('news_content').appendChild(div3);
	},900);
	new Effect.Opacity('news_content',{ from: 0, to: 1 ,duration:1.0, delay:1.0});
	
	return false;
}

function setBukmacherOpis(index)
{	
	bukmacher_opis_active=index;
	new Effect.BlindUp('opis_bukmacher',{duration:1.0});
	
	setTimeout(function(){
		
		//var img = document.createElement("img");
		var img = $('opis_bukmacher').getElementsByTagName("img");
		//img.className = "main_news";
		//img.style.margin = "0 15px 0 0";
		img[0].src = "http://www.bukmacherzy.com/nl/new_lay/images/bukmacherzy/"+bukmacherzy[index][1]+".gif";
		//$('opis_bukmacher').appendChild(img);
		
		advAJAX.get({
				url: "http://www.bukmacherzy.com/nl/a.php?url=getBukmacher/"+bukmacherzy[index][1],
				onSuccess : function(obj) { var bt = obj.responseXML.getElementsByTagName("book_description"); if(bt.length > 0) $('opis_bukmacher').getElementsByTagName("div").item(0).innerHTML=bt.item(0).firstChild.nodeValue },
				onError : function(obj) { alert("Error: " + obj.status); }
			});
			
		},900);
		
	new Effect.BlindDown('opis_bukmacher',{duration:1.0,delay:1.0});
	
}

var last_class="";

function leftMenuAct(obj)
{
    var a = obj.getElementsByTagName("a");
    if(a.length>0)
    {
        a.item(0).className="active";

    }
}

function leftMenuDeAct(obj)
{

    var a = obj.getElementsByTagName("a");
    if(a.length>0)
    {
        a.item(0).className="";
    }
}

function leftMenuActive(obj)
{
    classname = obj.className;
    last_class = classname;
    id = new Number(classname.substr(classname.length-1,classname.length));
    if(id>0){
        obj.className="active"+id;
    }else{
        obj.className="active";
    }
   
	/*last_class = obj.className;
    
    var images = obj.getElementsByTagName("img");
    var images_count = images.length;
    
    if(images_count > 0 && images[0].className!="fm")
        obj.removeChild(images.item(0));

    obj.className="li_active";
*/
    
		//if(images.length >0 && images[0].className=="flag_typy")
		//	obj.style.paddingLeft="63px";
	
	
	
}

function leftMenuDeActive(obj)
{
    obj.className = last_class;
    return;
	//var div = obj.getElementsByTagName("div");
	//div.item(1).style.display="none";
	//div.item(0).style.display="block";
	var images = obj.getElementsByTagName("img");
	if(last_class=="child" || last_class=="child2"){
		var img = document.createElement("img");
		img.src="http://www.bukmacherzy.com/nl/new_lay/images/left_ul_li_list.gif";
      
		var a_items = obj.getElementsByTagName("a");
			
		if(images.length > 0 && images[0].className!="left_menu_icon")
		{
			obj.insertBefore(img,images.item(0));
		}else if(a_items.length>0)
		{
			var a = a_items.item(0);
			obj.insertBefore(img,a);
		}
	}

	obj.className=last_class;
	if(last_class=="child" && images.length>1 && images[1].className=="flag_typy")
		obj.style.paddingLeft="35px";
}

function setLeftMenuItem(obj)
{
	var a = obj.getElementsByTagName("a");
	var img = obj.getElementsByTagName("img");
	obj.onmouseover = function(){return leftMenuActive(this)};
	obj.onmouseout = function(){return leftMenuDeActive(this)};
	
	var div_old = document.createElement("div");
	var div_new = document.createElement("div");
	div_new.className = "active";
	
	var div2=document.createElement("div");
	div2.className="a";
	
	var div3=document.createElement("div");
	div3.className="b";
	div3.appendChild(a.item(0).cloneNode(true));
	
	var div4=document.createElement("div");
	div4.className="c";
	
	div_new.appendChild(div2);
	div_new.appendChild(div3);
	div_new.appendChild(div4);
	
	div_old.appendChild(img.item(0).cloneNode(true));
	div_old.appendChild(a.item(0).cloneNode(true));
	
	//obj.innerHTML="";
	img.item(0).parentNode.removeChild(img.item(0));
	a.item(0).parentNode.removeChild(a.item(0));
	
	obj.appendChild(div_old);
	obj.appendChild(div_new);
	
return 65;	
	var div_old = document.createElement("div");
	var div_new = document.createElement("div");
	div_new.className = "active";
	
	//pobranie a i imgs
	var a = obj.getElementsByTagName("a");
	var img = obj.getElementsByTagName("img");
	
	if(a.length == 0 || img.length==0)
		return false;
	
	var a_clone = a.item(0).cloneNode(true);
	var img_clone = img.item(0).cloneNode(true);		
	//var a_clone2 = a.item(0).cloneNode(true);
	//var img_clone2 = img.item(0).cloneNode(true);
	//img_clone2.className="ai";
	
	var div2 = document.createElement("div");
	div2.className="a";
	div.appendChild(div2);
		
	div2 = document.createElement("div");
	div2.className="b";
	
	if(obj.parentNode.className!="child")
		div2.appendChild(img_clone2);
	
	div2.appendChild(a_clone2);
	div.appendChild(div2);
	
	div2 = document.createElement("div");
	div2.className="c";
	div.appendChild(div2);
	
	/*	
	var div3 = document.createElement("div");
	var div = document.createElement("div");
	div.className="active";
		
	var a = obj.getElementsByTagName("a");
	var img = obj.getElementsByTagName("img");
	
	if(a.length == 0 || img.length==0)
		return false;
		
	var a_clone = a.item(0).cloneNode(true);
	var img_clone = img.item(0).cloneNode(true);		
	var a_clone2 = a.item(0).cloneNode(true);
	var img_clone2 = img.item(0).cloneNode(true);
	img_clone2.className="ai";

	a.item(0).parentNode.removeChild(a.item(0));
	img.item(0).parentNode.removeChild(img.item(0));
	
	div3.appendChild(img_clone);
	div3.appendChild(a_clone);
		
	var div2 = document.createElement("div");
	div2.className="a";
	div.appendChild(div2);
		
	div2 = document.createElement("div");
	div2.className="b";
	
	if(obj.parentNode.className!="child")
		div2.appendChild(img_clone2);
	
	div2.appendChild(a_clone2);
	div.appendChild(div2);
	
	div2 = document.createElement("div");
	div2.className="c";
	div.appendChild(div2);

	obj.innerHTML ="";
	obj.appendChild(div3);
	obj.appendChild(div);
	*/
}

function setLeftMenu()
{

	var ul = $('pod_left_menu').getElementsByTagName("ul");
	var ul2 = ul.item(0).getElementsByTagName("ul");
	var li = ul.item(0).getElementsByTagName("li");

	for(var i=0;i<ul2.length;i++)
		if(ul2[i].nodeType==1 && ul2[i].nodeName.toLowerCase()=="ul" )
			setLeftMenuChild(ul2[i]);
	
	for(var z=0;z<li.length;z++)
		if(li[z].nodeType==1 && li[z].nodeName.toLowerCase()=="li")
			setLeftMenuItem(li[z]);	

}

function setLeftMenuChild(obj)
{
	var ul = obj.getElementsByTagName("ul");
	var li = obj.getElementsByTagName("li");
	
	for(var i=0;i<li.length;i++)
		if(li[i].nodeType==1 && li[i].nodeName.toLowerCase()=="li")
			setLeftMenuItem(li[i]);
			
	for(var z=0;z<ul.length;z++)
		if(ul[z].nodeType==1 && ul[z].nodeName.toLowerCase()=="ul")
			setLeftMenuChild(ul[z]);

}

function setBonusy(xml)
{
	if(!backupData['news_content'])
		backupData['news_content'] = $('news_content').innerHTML;
	
	if(!xml)
		return false;
		
	new Effect.Opacity('news_content',{ from: 1, to: 0 ,duration:1.0});
	
	setTimeout(function(){
		var table = document.createElement("table");
		table.cellSpacing=0;
		table.cellPadding=0;
		
		var buk = xml.getElementsByTagName("i");
		
		var tr = table.insertRow(0);
		var th=document.createElement("th");
		th.width="100px";
		th.innerHTML = "Bukmacher";
		tr.appendChild(th);
		
		th = document.createElement("th");
		th.innerHTML = "Bonus";
		tr.appendChild(th);
		
		th = document.createElement("th");
		th.innerHTML = "Opis";
		tr.appendChild(th);
		
		var tr_index=1;
		for(var i=0;i<buk.length;i++)
		{
			if(buk[i].getAttribute("bonus_kwota"))
			{		
				tr = table.insertRow(tr_index);
				if(tr_index%2==0)
					tr.style.background="#2f2f2f";
					
				td = tr.insertCell(0);
				td.width="100";
				var img=document.createElement("img");
				img.border=0;
				img.src = "http://www.bukmacherzy.com/nl/new_lay/images/"+buk[i].getAttribute("book_id")+".gif";
				var a = document.createElement("a");
				a.href = buk[i].getAttribute("book_link");
				a.target="_blank";
				a.appendChild(img);
				td.appendChild(a);
				td = tr.insertCell(1);
				td.align="center";
				td.className="bonusTdPrice";
				td.innerHTML = buk[i].getAttribute("bonus_kwota");
				
				td = tr.insertCell(2);
				td.innerHTML = buk[i].getAttribute("bonus_opis");
				td.className="bonusTdPrice";
				tr_index++;
			}
		}	
		
		$('news_content').innerHTML="";
		$('news_content').appendChild(table);
	},900);
	
	new Effect.Opacity('news_content',{ from: 0, to: 1 ,duration:1.0, delay:1.0});
}
	
function search_old_images(obj,delete_node)
{
	//search old images
	var old_images = obj.getElementsByTagName("img");
	
	for(var i=0;i<old_images.length;i++)
	{
		new_img = old_images.item(i).cloneNode(true);
		if(delete_node==1)
			old_images[i].parentNode.removeChild(old_images[i]);

	}
	
	if(new_img)
		return new_img;
		
	return false;
}	
// Simulates PHP's date function
Date.prototype.format = function(format) {
	var returnStr = '';
	var replace = Date.replaceChars;
	for (var i = 0; i < format.length; i++) {
		var curChar = format.charAt(i);
		if (replace[curChar])
			returnStr += replace[curChar].call(this);
		else
			returnStr += curChar;
	}
	return returnStr;
};
Date.replaceChars = {
	shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
	longMonths: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
	shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
	longDays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
	
	// Day
	d: function() { return (this.getDate() < 10 ? '0' : '') + this.getDate(); },
	D: function() { return Date.replace.shortDays[this.getDay()]; },
	j: function() { return this.getDate(); },
	l: function() { return Date.replace.longDays[this.getDay()]; },
	N: function() { return this.getDay() + 1; },
	S: function() { return (this.getDate() % 10 == 1 && this.getDate() != 11 ? 'st' : (this.getDate() % 10 == 2 && this.getDate() != 12 ? 'nd' : (this.getDate() % 10 == 3 && this.getDate() != 13 ? 'rd' : 'th'))); },
	w: function() { return this.getDay(); },
	z: function() { return "Not Yet Supported"; },
	// Week
	W: function() { return "Not Yet Supported"; },
	// Month
	F: function() { return Date.replace.longMonths[this.getMonth()]; },
	m: function() { return (this.getMonth() < 9 ? '0' : '') + (this.getMonth() + 1); },
	M: function() { return Date.replace.shortMonths[this.getMonth()]; },
	n: function() { return this.getMonth() + 1; },
	t: function() { return "Not Yet Supported"; },
	// Year
	L: function() { return "Not Yet Supported"; },
	o: function() { return "Not Supported"; },
	Y: function() { return this.getFullYear(); },
	y: function() { return ('' + this.getFullYear()).substr(2); },
	// Time
	a: function() { return this.getHours() < 12 ? 'am' : 'pm'; },
	A: function() { return this.getHours() < 12 ? 'AM' : 'PM'; },
	B: function() { return "Not Yet Supported"; },
	g: function() { return this.getHours() == 0 ? 12 : (this.getHours() > 12 ? this.getHours() - 12 : this.getHours()); },
	G: function() { return this.getHours(); },
	h: function() { return (this.getHours() < 10 || (12 < this.getHours() < 22) ? '0' : '') + (this.getHours() < 10 ? this.getHours() + 1 : this.getHours() - 12); },
	H: function() { return (this.getHours() < 10 ? '0' : '') + this.getHours(); },
	i: function() { return (this.getMinutes() < 10 ? '0' : '') + this.getMinutes(); },
	s: function() { return (this.getSeconds() < 10 ? '0' : '') + this.getSeconds(); },
	// Timezone
	e: function() { return "Not Yet Supported"; },
	I: function() { return "Not Supported"; },
	O: function() { return (this.getTimezoneOffset() < 0 ? '-' : '+') + (this.getTimezoneOffset() / 60 < 10 ? '0' : '') + (this.getTimezoneOffset() / 60) + '00'; },
	T: function() { return "Not Yet Supported"; },
	Z: function() { return this.getTimezoneOffset() * 60; },
	// Full Date/Time
	c: function() { return "Not Yet Supported"; },
	r: function() { return this.toString(); },
	U: function() { return this.getTime() / 1000; }

}

function tabele_change_zakladka(obj)
{
	var div = obj.parentNode.getElementsByTagName("div");
	for(var i=0;i<div.length;i++)
		div[i].className="tm";
		
	obj.className="box_light_green";

}

var select_tabele_backup;
var obj_select_tabele_change;
var selected_tabele_zakladka=0;

function select_tabele_zakladka(type)
{		
	selected_tabele_zakladka=type;
	var parent = $('top_black_green');
	var div = parent.getElementsByTagName("div");
	if(!select_tabele_backup)
	{
		for(var i=0;i<div.length;i++)
		{
			if(div[i].className=="text")
			{
				select_tabele_backup = div[i].innerHTML;
				obj_select_tabele_change = div[i];
			}
		}
	}

	if(type==0 && select_tabele_backup){
		obj_select_tabele_change.innerHTML=select_tabele_backup;
	}else if(type==2){
		obj_select_tabele_change.innerHTML = $('terminarz').innerHTML;
	}else if(type==1){
	
		html = '<APPLET CODE="embe.ts.TeamStats.class" ARCHIVE="http://www.bukmacherzy.com/kursy/js/embe/ts.zip" NAME="TeamStats" WIDTH="530" HEIGHT="480">';
		html += '<PARAM NAME="Leaguefile" id="lfi" value="http://www.bukmacherzy.com/java_stat_'+$('l_id').innerHTML+'_2008-2009_args.txt">';
		html += '<PARAM NAME="cabbase" VALUE="http://www.bukmacherzy.com/js/embe/ts.cab">';
		html += '</APPLET>';
		obj_select_tabele_change.innerHTML=html;
	}
}

function select_rate(obj,value)
{
    //unselect_rate(obj.parentNode);
    var img = obj.parentNode.getElementsByTagName("img");
    for(var i=1;i<=value;i++){
        img[i].src='http://www.bukmacherzy.com/nl/new_lay/images/star3_c.gif';
        img[i].className='active';
    }
    for(var a=i;a<img.length;a++)
        if(img[a].className=='active')
        {
            img[a].src='http://www.bukmacherzy.com/nl/new_lay/images/star3_d.gif';
            img[a].className=null;
        }
}

function unselect_rate(obj)
{
    // obj.src='http://www.bukmacherzy.com/nl/new_lay/images/star3_a.gif';
    // obj.className='';
    var img = obj.getElementsByTagName('img');
    for(var i=0;i<img.length;i++)
        if(img[i].className=='active')
        {
            img[i].src='http://www.bukmacherzy.com/nl/new_lay/images/star3_a.gif';
            img[i].className=null;
        }
}
var ocena=0;
function add_rate(obj,value)
{
    ocena = value;
    $('recenzja_submit').style.visibility='visible';
    
}

function submit_rate()
{
    if(ocena==0)
        return alert('Wybierz ocen\u0119');

    if($('recenzja_text').value.length==0)
        return alert('Wpisz opini\u0119');

	advAJAX.get({
		url: "http://www.bukmacherzy.com/nl/recenzje/add_review/?buk_id="+buk_id+"&ocena="+ocena+"&text="+$('recenzja_text').value,
		 timeout : 4000,
		 onTimeout : function() { alert("Connection timed out."); },
		 retry: 1,
		 retryDelay: 2000,
		 onRetry : function() { alert("Retry connection..."); },
		 onRetryDelay : function() { alert("Awaiting retry..."); },
		 onSuccess : function(obj)
         {
             if(obj.responseXML.getElementsByTagName("errors").length>0)
                 return alert(obj.responseXML.getElementsByTagName("errors").item(0).getElementsByTagName("i").item(0).firstChild.nodeValue);
             
             alert('Dodano Twoj\u0105 opinię o bukmacherze.');
             $('recenzja_submit').style.display="none";
             $('recenzja_text').disabled=true;
         },
		 onError : function(obj) {alert("Error: " + obj.status); }
	 });
   return true;
}

function str_rate(obj)
{
    if(obj.value.length > 250)
       obj.value=obj.value.slice(0,249);
   
    var rate_counter = 250-new Number(obj.value.length);
    $('dodaj_recenzje_z').innerHTML = 'Pozosta\u0142o znaków: '+rate_counter;

}

function search_clicked_zakladka(obj)
{
	var div = obj.getElementsByTagName("div");
	for(var i=0;i<div.length;i++)
		div[i].className="tm";
	
	div.item(selected_tabele_zakladka).className="box_light_green";
}

var last_rozwin_spis_tabel=0;
function rozwin_spis_tabel(obj)
{
	if(last_rozwin_spis_tabel==0){
		t = "";
        obj.src = "http://www.bukmacherzy.com/nl/new_lay/images/zwin_liste.gif";
    }else{
		t="none";
        obj.src = "http://www.bukmacherzy.com/nl/new_lay/images/rozwin.gif";
    }

	var tr = $('table_list').getElementsByTagName("tr");
	for(var i=7;i<tr.length;i++){
		tr[i].style.display=t;
	}
	if(last_rozwin_spis_tabel==1)
		last_rozwin_spis_tabel=0;
	else
		last_rozwin_spis_tabel=1;
}


function htmlentities (string, quote_style)
{
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: nobbler
    // +    tweaked by: Jack
    // +   bugfixed by: Onno Marsman
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // -    depends on: get_html_translation_table
    // *     example 1: htmlentities('Kevin & van Zonneveld');
    // *     returns 1: 'Kevin &amp; van Zonneveld'

    var histogram = {}, symbol = '', tmp_str = '', entity = '';
    tmp_str = string.toString();

    if (false === (histogram = get_html_translation_table('HTML_ENTITIES', quote_style))) {
        return false;
    }

    for (symbol in histogram) {
        entity = histogram[symbol];
        tmp_str = tmp_str.split(symbol).join(entity);
    }

    return tmp_str;
}

function get_html_translation_table(table, quote_style) {
    // http://kevin.vanzonneveld.net
    // +   original by: Philip Peterson
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: noname
    // %          note: It has been decided that we're not going to add global
    // %          note: dependencies to php.js. Meaning the constants are not
    // %          note: real constants, but strings instead. integers are also supported if someone
    // %          note: chooses to create the constants themselves.
    // %          note: Table from http://www.the-art-of-web.com/html/character-codes/
    // *     example 1: get_html_translation_table('HTML_SPECIALCHARS');
    // *     returns 1: {'"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;'}

    var entities = {}, histogram = {}, decimal = 0, symbol = '';
    var constMappingTable = {}, constMappingQuoteStyle = {};
    var useTable = {}, useQuoteStyle = {};

    useTable      = (table ? table.toUpperCase() : 'HTML_SPECIALCHARS');
    useQuoteStyle = (quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT');

    // Translate arguments
    constMappingTable[0]      = 'HTML_SPECIALCHARS';
    constMappingTable[1]      = 'HTML_ENTITIES';
    constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
    constMappingQuoteStyle[2] = 'ENT_COMPAT';
    constMappingQuoteStyle[3] = 'ENT_QUOTES';

    // Map numbers to strings for compatibilty with PHP constants
    if (!isNaN(useTable)) {
        useTable = constMappingTable[useTable];
    }
    if (!isNaN(useQuoteStyle)) {
        useQuoteStyle = constMappingQuoteStyle[useQuoteStyle];
    }

    if (useQuoteStyle != 'ENT_NOQUOTES') {
        entities['34'] = '&quot;';
    }

    if (useQuoteStyle == 'ENT_QUOTES') {
        entities['39'] = '&#039;';
    }

    if (useTable == 'HTML_SPECIALCHARS') {
        // ascii decimals for better compatibility
        entities['38'] = '&amp;';
        entities['60'] = '&lt;';
        entities['62'] = '&gt;';
    } else if (useTable == 'HTML_ENTITIES') {
        // ascii decimals for better compatibility
      entities['38']  = '&amp;';
      entities['60']  = '&lt;';
      entities['62']  = '&gt;';
      entities['160'] = '&nbsp;';
      entities['161'] = '&iexcl;';
      entities['162'] = '&cent;';
      entities['163'] = '&pound;';
      entities['164'] = '&curren;';
      entities['165'] = '&yen;';
      entities['166'] = '&brvbar;';
      entities['167'] = '&sect;';
      entities['168'] = '&uml;';
      entities['169'] = '&copy;';
      entities['170'] = '&ordf;';
      entities['171'] = '&laquo;';
      entities['172'] = '&not;';
      entities['173'] = '&shy;';
      entities['174'] = '&reg;';
      entities['175'] = '&macr;';
      entities['176'] = '&deg;';
      entities['177'] = '&plusmn;';
      entities['178'] = '&sup2;';
      entities['179'] = '&sup3;';
      entities['180'] = '&acute;';
      entities['181'] = '&micro;';
      entities['182'] = '&para;';
      entities['183'] = '&middot;';
      entities['184'] = '&cedil;';
      entities['185'] = '&sup1;';
      entities['186'] = '&ordm;';
      entities['187'] = '&raquo;';
      entities['188'] = '&frac14;';
      entities['189'] = '&frac12;';
      entities['190'] = '&frac34;';
      entities['191'] = '&iquest;';
      entities['192'] = '&Agrave;';
      entities['193'] = '&Aacute;';
      entities['194'] = '&Acirc;';
      entities['195'] = '&Atilde;';
      entities['196'] = '&Auml;';
      entities['197'] = '&Aring;';
      entities['198'] = '&AElig;';
      entities['199'] = '&Ccedil;';
      entities['200'] = '&Egrave;';
      entities['201'] = '&Eacute;';
      entities['202'] = '&Ecirc;';
      entities['203'] = '&Euml;';
      entities['204'] = '&Igrave;';
      entities['205'] = '&Iacute;';
      entities['206'] = '&Icirc;';
      entities['207'] = '&Iuml;';
      entities['208'] = '&ETH;';
      entities['209'] = '&Ntilde;';
      entities['210'] = '&Ograve;';
      entities['211'] = '&Oacute;';
      entities['212'] = '&Ocirc;';
      entities['213'] = '&Otilde;';
      entities['214'] = '&Ouml;';
      entities['215'] = '&times;';
      entities['216'] = '&Oslash;';
      entities['217'] = '&Ugrave;';
      entities['218'] = '&Uacute;';
      entities['219'] = '&Ucirc;';
      entities['220'] = '&Uuml;';
      entities['221'] = '&Yacute;';
      entities['222'] = '&THORN;';
      entities['223'] = '&szlig;';
      entities['224'] = '&agrave;';
      entities['225'] = '&aacute;';
      entities['226'] = '&acirc;';
      entities['227'] = '&atilde;';
      entities['228'] = '&auml;';
      entities['229'] = '&aring;';
      entities['230'] = '&aelig;';
      entities['231'] = '&ccedil;';
      entities['232'] = '&egrave;';
      entities['233'] = '&eacute;';
      entities['234'] = '&ecirc;';
      entities['235'] = '&euml;';
      entities['236'] = '&igrave;';
      entities['237'] = '&iacute;';
      entities['238'] = '&icirc;';
      entities['239'] = '&iuml;';
      entities['240'] = '&eth;';
      entities['241'] = '&ntilde;';
      entities['242'] = '&ograve;';
      entities['243'] = '&oacute;';
      entities['244'] = '&ocirc;';
      entities['245'] = '&otilde;';
      entities['246'] = '&ouml;';
      entities['247'] = '&divide;';
      entities['248'] = '&oslash;';
      entities['249'] = '&ugrave;';
      entities['250'] = '&uacute;';
      entities['251'] = '&ucirc;';
      entities['252'] = '&uuml;';
      entities['253'] = '&yacute;';
      entities['254'] = '&thorn;';
      entities['255'] = '&yuml;';
    } else {
        throw Error("Table: "+useTable+' not supported');
        return false;
    }

    // ascii decimals to real symbols
    for (decimal in entities) {
        symbol = String.fromCharCode(decimal)
        histogram[symbol] = entities[decimal];
    }

    return histogram;
}

function stripslashes( str )
{
    return (str+'').replace(/\0/g, '0').replace(/\\([\\'"])/g, '$1');
}

function set_kontakt()
{
    /*$('webmaster_mail').href="mailto:it@bukmacherzy.com";
    $('webmaster_mail').innerHTML="it@bukmacherzy.com";
*/
    $('marketing_mail').href="mailto:marketing@bukmacherzy.com";
    $('marketing_mail').innerHTML="marketing@bukmacherzy.com";
/*
    $('konkursy_mail').href="mailto:konkursy@bukmacherzy.com";
    $('konkursy_mail').innerHTML="konkursy@bukmacherzy.com";

    $('user_mail').href="mailto:user@bukmacherzy.com";
    $('user_mail').innerHTML="user@bukmacherzy.com";
    */
}

function stripslashes( str ) {

    return (str+'').replace(/\\(.?)/g, function (s, n1) {
        switch(n1) {
            case '\\':
                return '\\';
            case '0':
                return '\0';
            case '':
                return '';
            default:
                return n1;
        }
    });
}

function zwin_tresc_przywitania(obj){
        if($('hidden_text').style.display=='none')
        {
            Effect.BlindDown('hidden_text');
            obj.innerHTML = "Rozwiń całą treść przywitania";
        }else{
            Effect.BlindUp('hidden_text');
            obj.innerHTML="Zwiń całą treść przywitania";
        }
}
