// JavaScript Document




// Мои расширения
(function($){
  
$.fn.bigFotoHover = function(settings){//увеличение и сдвиг дива вверх, указываем:
var setting = $.extend({
upValue: 50, // на сколько вверх
cooficient: 1.1, //на сколько больше
speed: 'fast'}, //скорость
settings||{});
$(this).css({position: 'relative'});
var widthSource  = 0;					   
var heightSource = 0;
widthSource  = $(this).find('img').attr('width');					   
heightSource = $(this).find('img').attr('height');
$(this).find('div').hover(function() {	
								 
$(this).animate({bottom: setting.upValue}, setting.speed);
width = widthSource;
height = heightSource;
$(this).find('img').animate({width: (width * setting.cooficient), height: (height * setting.cooficient)}, setting.speed )
},
function(){
$(this).find('img').animate({width: widthSource , height: heightSource}, setting.speed - setting.speed/3 );
$(this).animate({bottom: "0"}, setting.speed - setting.speed/3);
});
}

$.fn.slideMenuHover = function(settings){ //увеличение и сдвиг дива вправо, указываем:
var setting = $.extend({				   
slideValue: 10, // на сколько вправо
cooficient: 1.1, //на сколько больше
speed: 'fast'}, //скорость
settings||{});
var fontSizeSource;
$(this).css({position: 'relative'});
$(this).hover(function() {
$(this).css({position: 'relative'});					   
fontSizeSource = parseInt($(this).css('font-size')); 
var fSize = fontSizeSource * setting.cooficient;			  
$(this).animate({left: setting.slideValue, fontSize: fSize}, setting.speed);
},
function(){
$(this).animate({left: 0, fontSize: fontSizeSource}, setting.speed - setting.speed/3);
});
}

$.fn.togleCustomBaner = function(settings){ //мигание элемента, передаем ИД и скорость
var setting = $.extend({
interval : 1500,
speedOut : 1000,  //скорость изчезания 
speedIn : 1500}, //скорость появления 
settings||{});
var id = $(this);
setInterval(function(){	
$(id).animate({opacity: 0.1}, setting.speedOut);
$(id).animate({opacity: 1}, setting.speedIn);
}, setting.interval)
}
		 
})(jQuery);


// настройки док реди
$(function() {	 

$('#baner h1').togleCustomBaner();

$('#leftMenuInner p ').find('a').hover(function(){
	$(this).css({color : '#fe7e00'})},
	function(){
	$(this).css({color : '#000'})
	}); 
$('#topMenuInner p ').find('a').hover(function(){
	$(this).css({color : '#fe7e00'}).animate({fontSize: '17px'}, 800)},
	function(){
	$(this).css({color : '#000'}).animate({fontSize: '15px'}, 500)
	});
$('#leftMenuInner a ').slideMenuHover({slideValue: 10, cooficient: 1, speed: 500});		    

		 
		 
});  
