
$(function() {
	// Use this example, or...
	$('a[rel*=lightbox]').lightBox({containerBorderSize: 2, overlayBgColor: '#FFF', overlayOpacity: 0.8, containerResizeSpeed: 1000 }); // Select all links that contains lightbox in the attribute rel
	// This, or...
	//$('#gallery a').lightBox(); // Select all links in object with gallery ID
	// This, or...
	//$('a.lightbox').lightBox(); // Select all links with lightbox class
	// This, or...
	//$('a').lightBox(); // Select all links in the page
	// ... The possibility are many. Use your creative or choose one in the examples above
	
});

$(document).ready(function(){
	
	var szukaj_tresc = 'szukaj produktu..';
	
	$("#search_").attr({ value: szukaj_tresc }).focus(function(){
            if($(this).val() == szukaj_tresc ){
               $(this).val( "" );
            }
       }).blur(function(){
            if($(this).val()==""){
               $(this).val(szukaj_tresc);
            }
       });
});
host_name = '/';

function change_image(sciezka,w,h) {
	var big_image = document.getElementById('big_image');
	var big_image_link = document.getElementById('big_image_link');
	big_image.style.width = w+'px';
	big_image.style.height = h+'px';
	
	big_image.src = sciezka;
	//document.write(big_image.src);
	big_image_link.href = sciezka;

}


function acttab_short(on)
{
var opis = document.getElementById('opis_short');
var opinie = document.getElementById('opinie_short');

if (opis)
{
opis.className = 'off';
opis.src = host_name+'images/detale/button_off_opis_short.png';
}
if (opinie)
{
opinie.src = host_name+'images/detale/button_off_opinie_short.png';
opinie.className = 'off';
}
on.src = host_name+'images/detale/button_on_'+on.id+'.png';
on.className = 'on';

//pobiera zawartosc poszczególnych kontenerów

var opisContent = document.getElementById('opis_shortContent');
var opinieContent = document.getElementById('opinie_shortContent');

if (opisContent)
{
opisContent.className = 'content tabcontentoff_short';
}
if (opinieContent)
{
opinieContent.className = 'content tabcontentoff_short';
}

on = on.id;
var con = document.getElementById(on+'Content');
con.className = 'content tabcontenton_short';
}


function reklama_rotation(on)
{
var button = 0;
var reklama;
for (s = 1; s <= 10; s++)	{
	if(document.getElementById(s+'_')){
		button = document.getElementById(s+'_');
		button.className = 'cell';
	}
	if(document.getElementById(s+'_reklamaContent')){
		reklama = document.getElementById(s+'_reklamaContent');
		if(reklama.className == 'content reklama_content_on'){
			reklama.className = 'content reklama_content_off';
		}	
	}
}
currentAD = document.getElementById(on+'_')
currentAD.className = 'cell_active';

var con = document.getElementById(on+'_reklamaContent');
con.className = 'content reklama_content_on';
}

function changeStatus(zmieniany) {
	var warstwa, strzalka;
if(document.getElementById('opis_'+zmieniany))	{
		warstwa = document.getElementById('opis_'+zmieniany);
		if (warstwa.className == 'hide'){
			warstwa.className = 'active';
			if (strzalka = document.getElementById('arrow_'+zmieniany))	{
				strzalka.className = 'arrow_up';
				strzalka.title = 'zwiń';
				}
			}
		else if (warstwa.className == 'active'){
			warstwa.className = 'hide';
			if(strzalka = document.getElementById('arrow_'+zmieniany)) {
				strzalka.className = 'arrow_down';
				strzalka.title = 'rozwiń';
				}
			}
		}
}

function rotate() {
var reklama;
var ostatni,bierzacy,nastepny;
	for (var s = 1; s <= 10; s++)	{
			if(document.getElementById(s+'_'))	{
				reklama = document.getElementById(s+'_');
				if(reklama.className == 'cell_active'){
					bierzacy = s;
					}
				ostatni = s;
				}
		}
	if(bierzacy+1 <= ostatni)
		nastepny = bierzacy+1;
	else
		nastepny = 1;
		
		reklama_rotation(nastepny);
	setTimeout ('rotate()', 7*1000);
	return false;
}


function check_transport(transport, platnosc) {
	var gotowka = document.getElementById('gotowka');
	var lukas = document.getElementById('lukas_01');
	var gotowka_option = document.getElementById('gotowka_option');
	var lukas_option = document.getElementById('Lukas_option');
	var przelew = document.getElementById('przelew');
	var przelew_option = document.getElementById('przelew_option');
	if(transport == 'osobisty') {
		gotowka_option.checked = true;
		gotowka.className = 'visibled';
		lukas.className = 'visibled';
		przelew_option.checked = false;
		przelew.className = 'visibled';
		}
	else
	if(transport == 'lokalny') {
		gotowka_option.checked = false;
		gotowka.className = 'visibled';
		lukas.className = 'visibled';
		przelew_option.checked = true;
		przelew.className = 'visibled';
		}
	else
	if(transport == 'kurier' || transport == '') {
		if(transport == '') {
		var kurier_radio = document.getElementById('kurier');
		kurier_radio.checked = true;
		}
		gotowka_option.checked = false;
		gotowka.className = 'hidden';
		lukas.className = 'visibled';
		przelew_option.checked = true;
		przelew.className = 'visibled';
		}
	else
	if(transport == 'firmowy') {
		gotowka_option.checked = false;
		gotowka.className = 'hidden';
		lukas.className = 'visibled';
		przelew_option.checked = true;
		przelew.className = 'visibled';
		}
	if(platnosc == 'gotówka')	{
		gotowka_option.checked = true;
		}
	if(platnosc == 'przelew')	{
		przelew_option.checked = true;
		}
	if(platnosc == 'LUKAS Raty')	{
		lukas_option.checked = true;
		}
	}
function show_form(formularz) {
	var faktura_form = document.getElementById(formularz+'_form');
	var faktura_option = document.getElementById(formularz+'_option');
	if(faktura_option.checked == true)
		faktura_form.className = 'active';
	else if(faktura_option.checked == false)
		faktura_form.className = 'hide';
	}
