function switch_thumbs() {
    $("#thumbs-content").fadeTo("fast", 0, function(){
        for (i=1; i<8; i++) $("#imgstc" + i).attr("src", "res/img/scroller-thumbs/energy" + (Math.round(Math.random() * 38) + 1) + ".jpg");
        $("#thumbs-content").fadeTo("slow", 1);
    });
}

$(document).ready(function(){
	// Some code to execute;
    $("a.sus").click(function(){ $(window).scrollTop(0); return false; });
    switch_thumbs();
    setInterval("switch_thumbs()", 5000);
    if ($("#galerie").is("table")) { // Gallery mode present;
        $("a[rel=galerie1]").colorbox({ current: "{current}/{total}", previous: "&laquo;", next: "&raquo;", close: "Închide", height: "93%" });
        $("a[rel=galerie2]").colorbox({ current: "{current}/{total}", previous: "&laquo;", next: "&raquo;", close: "Închide", height: "93%" });
    }
    if ($("#tarife-energy").is("table")) {
        $("tr.tr1,tr.tr2").mouseenter(function(){$(this).addClass("trx")}).mouseleave(function(){$(this).removeClass("trx");});
    }
});