﻿
var jQ=jQuery.noConflict();
jQ(document).ready(function(){	
	if (jQ('div.actions').length>0) {
	var actions=jQ('div.actions');
	}else{
	var actions=jQ('div.actions-esp');
	}
	

	if(actions.length) actions.jCarouselLite({ auto:3000,speed:1500 });
	var adva=jQ('div.advatages');
	if(adva.length){
		var advMOver=function(e){ jQ(this).css({opacity:.4}).animate({opacity:1,left:'-=8'},250); },
			advMOut= function(e){ jQ(this).animate({left:'+=8'},350); };
		var i=0,as=adva.find('a'),
			x=parseInt(as.eq(0).css('left'));
		as.each(function(){
			var a=jQ(this);
			a.hover(advMOver,advMOut);
			var b=a.children();
			if(b.height()<20) b.css({position:'relative',top:'4px'});
			a.css({opacity:0,left:x+18});
			setTimeout(function(){ a.animate({opacity:1,left:'-=18'},300); },150*i);
			i++;
		});
	}
	
	jQ('.myTip').myTip();
});

(function($){  
    $.fn.myTip = function() {
        $(this).hover(function() {
            var t=$(this), o=t.offset(), div=$('#'+t.attr('rel')),
            y=o.top-div.outerHeight()-2;
            if(y<$(window).scrollTop()) y=o.top+t.outerHeight()+2;
            div.css({ top:y, left:o.left }).fadeIn();
        }, function() {
            $('#'+$(this).attr('rel')).stop(true,true).fadeOut();
        });
    }
})(jQuery);


