window.addEvent('domready', function() {

var comment = new Request({
	url: '/ajax/mainComments.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('komentarze').set('html',response);
	}
})

comment.send();

var hallOfFame = new Request({
	url: '/ajax/mainHallOfFame.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('halloffame').set('html',response);
	}
})

hallOfFame.send();

// z wypisaniem liderow klasyfikacji
//var analityk = new Request({
//	url: '/ajax/mainAnalityk.php',
//	method: 'get',
//	update: 'refresh-me',
//	onComplete: function(response) {
//		$('analityk').set('html',response);
//	}
//})
//
//analityk.send();

var analityk = new Request({
	url: '/ajax/mainAnalityk.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('analityk').set('html',response);
	}
})

analityk.send();


var bill = new Request({
	url: '/ajax/mainGaleria.php?dzial=billboardy',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		galeria.zmienPole('kampania_grafika','id_billboard', response);
	}
})

bill.send();

var gal = new Request({
	url: '/ajax/mainGaleria.php?dzial=galeria',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
        galeria.zmienPole('galeria_grafika', 'id_galeria', response);
	}
})

gal.send();

var video = new Request({
	url: '/ajax/mainVideo.php?od=0',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('video_text').set('html',response);
	}
})

video.send();


random=Math.floor(Math.random() * 7) + 1;
var basic = new Request({
	url: '/ajax/topOfDivisions.php?liga=basic&random='+random,
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('basic').set('html',response);
	}
})

basic.send();

var pretendent = new Request({
	url: '/ajax/topOfDivisions.php?liga=pretendent&random='+random,
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('pretendent').set('html',response);
	}
})

pretendent.send();

var major = new Request({
	url: '/ajax/topOfDivisions.php?liga=major&random='+random,
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('major').set('html',response);
	}
})

major.send();

});

