i = 1;
$(document).ready(function(){

$('marquee').marquee();

if (ileOfert>0) { 
$('a#link_0').css("background-color","#efffc3")
$("#hot").everyTime(7000,function() {
					if (i>=ileOfert) i = 0;
					h(i,ileOfert);
					i++;
				});
}
/* IFR */ 
$("a").filter(".arch").click(function(){
	
   if ($("div").filter("#Archiwum").is(":hidden")) {
        $("div").filter("#Archiwum").slideDown("slow");
      } else {
        $("div").filter("#Archiwum").hide();
      }
 });
/* EOF */
$('a#Bookmark').click(function() {
	bookmark('http://www.rajzer.net', 'Rajzer Consulting');
	});
/* Patroni */
var ilePatronow = $('div.patroni a.Patroni').length;
if (ilePatronow>2) {
	var counter = 2;
	
	$('a#Bookmark').everyTime(6000,function() {
					if (counter>ilePatronow) counter = 1;
					p(counter,ilePatronow);
					counter++;
				});
}

$('marquee').fadeIn();
});

function p(id, ile) {
	var a = 0;
	
	for (z=1;z<=ile;z++) {
		$('a#Patroni_'+z).hide();
		
		if (id==z) {
			$('a#Patroni_'+z).show();
			a++;
		}
		if (id+1==z) {
			$('a#Patroni_'+z).show();
			a++;
		}
		if (id+1>ile && z+1==ile+1) {
			$('a#Patroni_1').show();
			a++;
		}
		
	}
	//alert(id+' '+ile);
	//if (id<ile-2) alert('Brak');
	//else alert('Bedzie');
	
}
function h(id,ile) {
	for (a=0;a<ile;a++) {
		$('div#oferta_'+a).hide();
		$('a#link_'+a).css("background-color","#f6ffde")
	}
	$('div#oferta_'+id).show();
	$('a#link_'+id).css("background-color","#efffc3")
}

function bookmark(url, description){
    if (url == null) { // if description is not passed then default to page title
        url = window.location.href;
    }
    if (description == null) { // if description is not passed then default to page title
        description = document.title;
    }
    if (document.all){ // Test If: Internet Explorer
    window.external.AddFavorite(url, description); // AddFavorite is IE specific
    }
    else if (window.sidebar){ // Test If: Mozilla, Netscape, or FireFox
    window.sidebar.addPanel(description, url, ""); // sidebar.addPanel is Mozilla specific
    }
    else { // If all others
    window.alert("Press CTRL+T to bookmark this page"); // CTRL + T typically for Opera and other browsers
    }
    
}
function printSite(module,akcja) {
	var options = "width=800,height=600,scrollbars=yes,resizable=no,menubar=yes";
	var help_url="/index.php?module="+module+"&print=1&akcja="+akcja;
	var win = open(help_url, "help", options);
	win.moveTo(100,50);
	win.focus();
	}