var author="images/obavtor1.gif";
var author2="images/obavtor2.png";
var author3="images/obavtor3.png";
var author4="images/obavtor4.png";


var kontakt="images/kontakt1.gif";
var kontakt2="images/kontakt2.png";
var kontakt3="images/kontakt3.png";
var kontakt4="images/kontakt4.png";

var webanim="images/webanim1.gif";
var webanim2="images/webanim2.png";
var webanim3="images/webanim3.png";
var webanim4="images/webanim4.png";

var fotogal="images/fotogall1.gif";
var fotogal2="images/fotogall2.png";
var fotogal3="images/fotogall3.png";
var fotogal4="images/fotogall4.png";




$(document).ready(function(){

// Блок ховера, меняющий картинку при наведении мыши, а затем обратно, спустя полсекунды
    $("img.author").hover(function() {
	$("img.author").attr({src: author});
	$("img.podpis-about").attr({src: author3});
    },function() {
	$(this).oneTime(2500, function() {
	$("img.author").attr({src: author4});
	});
	$("img.podpis-about").attr({src: author2});
	});
	
	$("img.podpis-about").hover(function() {
	$("img.author").attr({src: author});
	$("img.podpis-about").attr({src: author3});
    },function() {
	$(this).oneTime(2500, function() {
	$("img.author").attr({src: author4});
	});
	$("img.podpis-about").attr({src: author2});
	});
//

	$("img.photo").hover(function() {
	$("img.photo").attr({src: fotogal});
		$("img.podpis-fotogal").attr({src: fotogal3});
    },function() {
	$(this).oneTime(2500, function() {
	$("img.photo").attr({src: fotogal14});
	});
	$("img.podpis-fotogal").attr({src: fotogal2});
	});
	
		$("img.podpis-fotogal").hover(function() {
	$("img.photo").attr({src: fotogal});
		$("img.podpis-fotogal").attr({src: fotogal3});
    },function() {
	$(this).oneTime(2500, function() {
	$("img.photo").attr({src: fotogal14});
	});
	$("img.podpis-fotogal").attr({src: fotogal2});
	});
//
	$("img.cont").hover(function() {
	$("img.cont").attr({src: kontakt});
	$("img.podpis-contact").attr({src: kontakt3});
    },function() {
	$(this).oneTime(2500, function() {
	$("img.cont").attr({src: kontakt4});
	});
	$("img.podpis-contact").attr({src: kontakt2});
	});
	
	$("img.podpis-contact").hover(function() {
	$("img.cont").attr({src: kontakt});
	$("img.podpis-contact").attr({src: kontakt3});
    },function() {
	$(this).oneTime(2500, function() {
	$("img.cont").attr({src: kontakt4});
	});
	$("img.podpis-contact").attr({src: kontakt2});
	});
// 

	$("img.anim").hover(function() {
	$("img.anim").attr({src: webanim});
	$("img.podpis-webanim").attr({src: webanim3});
    },function() {
	$(this).oneTime(2500, function() {
	$("img.anim").attr({src: webanim4});
	});
	$("img.podpis-webanim").attr({src: webanim2});
	});
	

	$("img.podpis-webanim").hover(function() {
	$("img.anim").attr({src: webanim});
	$("img.podpis-webanim").attr({src: webanim3});
    },function() {
	$(this).oneTime(2500, function() {
	$("img.anim").attr({src: webanim4});
	});
	$("img.podpis-webanim").attr({src: webanim2});
	});
	
	
	//
	
	
	
	
	
// генерируем случайное число, через которое буде запускаться анимация для каждого объекта
	var AuthorTimeBg=Math.random()*8000+5000;
	$("img.author").everyTime(AuthorTimeBg, function() {
	$(this).attr({src: author});
	$("img.author").oneTime(2000, function() {
	$(this).attr({src: author4});	
	});
	});

	var PhotoTimeBg=Math.random()*6000+5000;
	$("img.photo").everyTime(PhotoTimeBg, function() {
	$(this).attr({src: fotogal});
	$("img.photo").oneTime(2000, function() {
	$(this).attr({src: fotogal4});	
	});
	});
	
		var AuthorTimeBg=Math.random()*5000+6000;
	$("img.cont").everyTime(AuthorTimeBg, function() {
	$(this).attr({src: kontakt});
	$("img.cont").oneTime(2000, function() {
	$(this).attr({src: kontakt4});	
	});
	});

	var PhotoTimeBg=Math.random()*7000+5000;
	$("img.anim").everyTime(PhotoTimeBg, function() {
	$(this).attr({src: webanim});
	$("img.anim").oneTime(2000, function() {
	$(this).attr({src: webanim4});	
	});
	});
});