$(function(){
    $("#animation").cycle({
        fx:    'zoom',
        random:  1
       });
    $("#guestbook").hover(function(){
        $(this).children('span').first().stop().animate({"width":"130px"},500);
    },
    function(){
        $(this).children('span').first().stop().animate({"width":"0px"},500);
    });
    $(".news_item").each(function(){
        var img=$(this).children("img").first();
        var el=document.createElement('div');
        el.className='div_news';
        el.style.width=(img.width())?img.width()+'px':1+'px';
        el.style.height=(img.height())?img.height()+'px':1+'px';
        if(img.width()>300) el.style.width=10+'px';
        $(this).append(el);
        $(el).stop().animate({"left":"10px","top":"15px"},1000);
    });
    if(window.opera) {
	        if ($("#AddFavourite").attr("rel") != ""){ // don't overwrite the rel attrib if already set
	            $("#AddFavourite").attr("rel","sidebar");
	        }
	    }
    $("#AddFavourite").click(function(event){
       event.preventDefault();
       var url='http://nubis-sport.pl';
       var title='Nubis sport';
       if (window.sidebar) { // Mozilla Firefox Bookmark
	            window.sidebar.addPanel(title, url,"");
	        } else if( window.external ) { // IE Favorite
	            window.external.AddFavorite( url, title);
	        } else if(window.opera) { // Opera 7+
	            return false; // do nothing - the rel="sidebar" should do the
                }
    });
    $('#menu_top .menu_link').hover(function(){
        $(this).children('.menu_').first().stop().animate({"height":'314px'},100);
    },function() {
        $(this).children('.menu_').first().stop().animate({"height":'0px'},500);
    });
    $("#menu_bottom a").each(function(index){
      $(this).hover(function(){
        switch(index) {
            case 0:$('.line_menu').stop().animate({"width":"513px"},500); break;
            case 1:$('.line_menu2').stop().animate({"width":"43px"},500); $('.line_menu').stop().animate({"width":"513px"},500); break;
            case 2:$('.line_menu2').stop().animate({"width":"43px"},500); break;
        }
    },function(){
         switch(index) {
            case 0:$('.line_menu').stop().animate({"width":"0px"},500); break;
            case 1:$('.line_menu2').stop().animate({"width":"0px"},500); $('.line_menu').stop().animate({"width":"0px"},500);break;
            case 2:$('.line_menu2').stop().animate({"width":"0px"},500); break;
        }
    })
    })
})
