$(document).ready(function(){

	$(".products_kategorite li").live("mouseenter", function() {
  		$(this).animate({ "padding-left" : "15px"}, 300); 
		$(this).css("background-image", "url(images/shigjeta_produktet.png)"); 
	});
	
	$(".products_kategorite li").live("mouseleave", function() {
		$(this).animate({ "padding-left" : "0px"}, 300); 
		$(this).css("background-image", "none"); 
	});
	
	$("#produktet li").live("mouseenter", function() {
		jQuery("a", this).fadeIn(300);
		
	});
	
	$("#produktet li").live("mouseleave", function() {
		jQuery("a", this).fadeOut(150);
	});
	
	$(".latest_catalog").live("mouseenter", function() {
		jQuery("a", this).fadeIn(300);
		
	});
	
	$('.latest_catalog').hover(function(){
		$(this).children('.fade').stop().animate({ opacity: 99 }, 300);
		$(this).children('.fade').css('display', 'block');
	}, function(){
		$(this).children('.fade').stop().animate({ opacity: 0}, 300);
	});	
	
});

$(function () {
 var timeri = setInterval(function(){lajmet();}, 5000);
                  
  function lajmet()
  {
	var tickeriAktiv = $("#latest_news > li#latest_news_aktive");
	var dataAktiv = $(".latest_news_data > div#data_aktive");
	var tickeriTjeter;
	var dataTjeter;
	
	if (tickeriAktiv.next().length == 0) { tickeriTjeter = $("#latest_news > li").eq(0); dataTjeter = $(".latest_news_data > div").eq(0); } else { tickeriTjeter = tickeriAktiv.next(); dataTjeter = dataAktiv.next(); }
	
	tickeriAktiv.slideUp("slow");
	tickeriAktiv.attr('id', '');
	tickeriTjeter.attr('id','latest_news_aktive');
	tickeriTjeter.slideDown("slow");
	
	dataAktiv.slideUp("slow");
	dataAktiv.attr('id', '');
	dataTjeter.attr('id','data_aktive');
	dataTjeter.slideDown("slow");

  }
  

});
/*
    (function ($) {
        $.fn.cross = function (options) {
            return this.each(function (i) { 
                var $$ = $(this);
                
                var target = $$.css('backgroundImage').replace(/^url|[\(\)'"]/g, '');
                $$.wrap('<span style="position: relative;"></span>')
                    .parent()
                    .prepend('<img>')
                    .find(':first-child')
                    .attr('src', target);

                if ($.browser.msie || $.browser.mozilla) {
                    $$.css({
                        'position' : 'absolute', 
                        'left' : 0,
                        'background' : '',
                        'top' : this.offsetTop
                    });
                } else if ($.browser.opera && $.browser.version < 9.5) {            
                    $$.css({
                        'position' : 'absolute', 
                        'left' : 0,
                        'background' : '',
                        'top' : "0"
                    });
                } else {
                    $$.css({
                        'position' : 'absolute', 
                        'left' : 0,
                        'background' : ''
                    });
                }

                $$.hover(function () {
                    $$.stop().animate({
                        opacity: 0
                    }, 250);
                }, function () {
                    $$.stop().animate({
                        opacity: 1
                    }, 250);
                });
            });
        };
        
    })(jQuery);
    
    $(window).bind('load', function () {
        $('img.fade').cross();
    });
	*/
