 function load_news(id, box, hide){
	jQuery(".backen").fadeIn();
	jQuery("#"+box).html("Wczytuję aktualność, proszę czekać...");
	jQuery.ajax({	
	  type: "GET",
	  url: "./news,"+id+".html",
	  success: function(data){
		jQuery("#"+hide).fadeOut();
		jQuery("#"+box).stop(true, true).hide(1).html(data).slideDown(500);
	  }
	});
 }
 
function hider(box1, box2)
{
	jQuery("#"+box1).fadeIn();
	jQuery("#"+box2).fadeOut();
	jQuery(".backen").hide();
}

function menu(id) {
  if (document.getElementById(id).style.display=="none") {
    document.getElementById(id).style.display="inline";
  } else {
    document.getElementById(id).style.display="none";
  }
}

function okno(url, width, height) {
        var win = window.open(url,"okienko",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no,toolbar=no,location=no,directories=no,status=no,fullscreen=no,channelmode=no' );
}


function FontSize(size, wyb) {
	document.getElementById("srodek").style.fontSize = size;	
	document.getElementById("size1").style.color = "black";
	document.getElementById("size2").style.color = "black";
	document.getElementById("size3").style.color = "black";
	document.getElementById(wyb).style.color = "#FF6805";	
}
/*//////////////////////////////////obrazek w nowym oknie//////////////////////////////////*/
/*
	 Skrypt jest darmowy, poki ten komentarz w nim pozostaje.
	 Released under Creative Commons License
	 http://creativecommons.org/licenses/by/2.0/
	 Original author: Kornel Lesinski
	 http://pornel.net/pups/
*/
var pornpups =
{
	init: function(element)
	{
		if (!element || !element.getElementsByTagName) {return false;}
		var as = element.getElementsByTagName('a');
		for(var i=0;i<as.length;i++)
		{
			if ((as[i].href+'').match(/\.(jpe?g|png|gif)/i))
				as[i].onclick = this.click;
		}
		return true;
	},
	writedoc: function(win,href,title,alt,h)
	{
		var doc = win.document;
		doc.open('text/html;charset=utf-8');
		doc.write(
		'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' +
		'<html>' +
		'<head><title>' + alt + '</title>' +
		'<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2">' +
		'<meta http-equiv="imagetoolbar" content="false">' +
		'<link rel="stylesheet" href="pornpups.css">' +
		(h?'<style type="text/css">html, body {margin:0; padding:0;} .obrazek {min-height: ' + h + 'px} #iesux  .obrazek {height: ' + h + 'px;}</style>':'') +
		'</head><body onclick="window.close();">' +
		'<p class="obrazek"><img src="'+href+'" title="Kliknij aby zamknąć" alt="Kliknij aby zamknąć"></p>' +
		'</body></html>'
		);
		doc.close();
	},
	title2size: function(str)
	{
		if (str)
		{
			var out = str.match(/\(([0-9]+)x([0-9]+)\)/);
			if (out) return new Array(str.replace(/\(([0-9]+)x([0-9]+)\)/g,''),parseInt(out[1]),parseInt(out[2]));
		}
		return new Array(str,550,420);
	},
	click: function()
	{
		try {
			if (this.pp_win && this.pp_win.close && !this.pp_win.closed) {this.pp_win.close(); this.pp_win=false;}
		}
		catch(e){}
		try {
			var imgs = this.getElementsByTagName('img');
			var title = imgs[0].getAttribute('title')?imgs[0].getAttribute('title'):this.getAttribute('title');
			var alt = imgs[0].getAttribute('alt');
			var titleandsize = pornpups.title2size(title);
			var winopts = "dependent=yes,toolbar=no,resizable=yes,width=" + (titleandsize[1]) + ',height=' + (titleandsize[2]);
			var win = window.open(this.href,'_blank',winopts);
			if (win && win.opener)
			{
				this.pp_win = win;
				pornpups.writedoc(win,this.href,titleandsize[0],alt,titleandsize[2]);
				return false;
			}
		}
		catch(e){}
		return true;
	},
	initNow: function()
	{
		this.init(document.body);
	},
	initLoad: function()
	{
		var oldOnload = window.onload;
		var that = this;
		window.onload = function()
		{
			if (oldOnload) try{oldOnload();}catch(e){/*explorer dziwne rzeczy plecie*/}
			that.initNow();
		}
	}
};

var preg = "/promocje/";
var url = window.location.href;

if(!preg.test(url))
{
	pornpups.initLoad();
	pornpups.initNow();
} 
/*//////////////////////////////////obrazek w nowym oknie//////////////////////////////////*/





var sliderCarousel = function(idCont,leftHandle,rightHandle,ob,opcje)
{
	opcje = opcje || new Array();

	var timer;

	var cont = $(idCont);
	
	var czas = opcje.czas || 0;
	var minElem = opcje.minElem || 0; 
	var elementy = $A(cont.select(ob)); 
	var ile = elementy.length; 
	var elemWidth = opcje.elemWidth || Element.getWidth(elementy[0]);
	var elemTop = opcje.elemTop || 0;
	
	var box = document.createElement('div');
	var ramka = document.createElement('div');
	box.className = 'pasek_slider';
	ramka.className = 'ramka_slider';
	box.style.width = ile * elemWidth + 'px';
	elementy.each(function(elem){
		box.appendChild(elem);
	});
	ramka.appendChild(box);
	cont.appendChild(ramka);

	elementy.each(function(elem, i){

		elem.nr = i;
		elem.absolutize();
		elem.style.left = (i * elemWidth) + 'px';
		elem.style.top = (elemTop) + 'px';
	});
	
	if(ile <= minElem) {//minimum
		$(leftHandle).style.visibility = 'hidden';
		$(rightHandle).style.visibility = 'hidden';
		return;
	}
	
	
	var lewo = function(){
		$(leftHandle).style.visibility = 'hidden';
		elementy.each(function(elem,i){
			elem.nr--;
			elem.morph('left:'+((elem.nr)*elemWidth)+'px',{duration:0.3,afterFinishInternal:function(){
												if(elem.nr == -1) 
												{
													elem.style.left = ((ile-1)*elemWidth) + 'px';
													elem.nr = ile-1;
												}
												if(i == ile-1) 
												{
													$(leftHandle).style.visibility = 'visible';
												}
														},
														transition: Effect.Transitions.linear
													});												
												
		});
	};	
	
	var prawo = function(){
		$(rightHandle).style.visibility = 'hidden';
		elementy.each(function(elem,i){
			elem.nr++;	
			if(elem.nr == ile) 
			{
				elem.style.left = ((-1)*elemWidth) + 'px';
				elem.nr = 0;
			}
		});
		
		elementy.each(function(elem,i){
			elem.morph('left:'+((elem.nr)*elemWidth)+'px',{duration:0.3,transition: Effect.Transitions.linear,afterFinishInternal:function(){
												if(i == ile-1) 
												{
													$(rightHandle).style.visibility = 'visible';
												}
														}								
		});
			if(i == ile-1) $(rightHandle).show();
		});
		
	};
	
	$(leftHandle).onclick = lewo;
	$(rightHandle).onclick = prawo;
	
}

function menuRozw(idOb,opcje)
{
	opcje = opcje || new Array();
	opcje.height = opcje.height || 170;
	opcje.classn = opcje.classn || 'aranz';
	if(Element.getHeight(idOb) > 0) return false;
	ukryjMenu(opcje.classn);
	new Effect.Morph(idOb,{style:'height:' + opcje.height + 'px;',duration:0.7});
}

function ukryjMenu(classn)
{
	$A($$('div.'+classn)).each(function(el){
		if(Element.getHeight(el) > 0) new Effect.Morph(el,{style:'height:0;',duration:0.7});
		});
	
}
