function serwisJs() {

new statServLive();
}


function wlaczNewsa(id) {
 new news(id);
}

var statServLive = Class.create();

  	statServLive.prototype = {
        initialize: function () {
        this.options = new Object(); 
        this.options.asynchronous = true;
        this.options.method       = 'GET';
        this.options.onSuccess   = this.onCompleteServer.bind(this);
        this.options.onFailure   = this.onFailureServer.bind(this);
       
        if ($('statServer')!=null) {
	        $('statServer').innerHTML = "Sprawdzam kto to tam jezdzi :)";
	        this.url = 'http://f1liga.pl/ktoNaServerzeSprawdz.php';
	        new Ajax.Request(this.url, this.options);
        }
        },
        onCompleteServer: function(request) {
             $('statServer').innerHTML = request.responseText;
        },
        onFailureServer: function(request) {
             $('statServer').innerHTML = "Nie udalo sie sprawdzic ;/";
        }
	  
  }

var news = Class.create();

  	news.prototype = {
    initialize: function (id) {
    	this.idek = id;
	    this.element = $('newsA'+id);
	    if (this.element!=null) {
//		Event.observe(this.element, 'mouseover', this.pokazNews.bindAsEventListener(this));
//		Event.observe(this.element, 'mouseout', this.zniknijNews.bindAsEventListener(this));
		}
	},       
	pokazNews: function() {
//		alert('newsA'+this.idek);
	    $('news'+this.idek).style.display = '';
	    $('trzy'+this.idek).style.display = 'none';
	    
    },       
	zniknijNews: function() {
	    $('news'+this.idek).style.display = 'none';
	    $('trzy'+this.idek).style.display = '';
    } 
	}
  