var timerBig;
function setBigImg(id, clear) {
	if(id==lastBigImg) return;

	if(clear==1) {
		clearTimeout(timerBig);
		timerBig = setTimeout("setTimerBigImg()", motiveTime*1000);
	}
	
	$("#sq_"+lastBigImg).toggleClass("act");

/*
	$("#motive_" + lastBigImg).hide();
	$("#imgAnons_" + lastBigImg).hide();
*/
	$("#motive_" + lastBigImg).fadeOut(300)
	$("#imgAnons_" + lastBigImg).fadeOut(300)

	$("#sq_"+id).toggleClass("act");

/*
	$("#motive_" + id).show();
	$("#imgAnons_" + id).show();
*/
	$("#motive_" + id).fadeIn(300);
	$("#imgAnons_" + id).fadeIn(300);
	
	lastBigImg = id;

}
function setTimerBigImg() {
	var next = lastBigImg+1;
	if(next==6) next = 1;
	setBigImg(next, 0)
	clearTimeout(timerBig);
	timerBig = setTimeout("setTimerBigImg()", motiveTime*1000);
}


//////////////////////////////////////////////////////////////////////////////

function setTimerBigImgThree(toc_id) {
//	alert(toc_id)
	var next = lastBigImgThree[toc_id]+1;
	if(next==4) next = 1;
	setBigImgThree(next, 0, toc_id)
	clearTimeout(timerBigThree[toc_id]);
	timerBigThree[toc_id] = setTimeout(function(){setTimerBigImgThree(toc_id)}, motiveTimeThree[toc_id]*1000);
}

var timerBigThree = new Array();
var motiveTimeThree = new Array();
var lastBigImgThree = new Array();

function setBigImgThree(id, clear, toc_id) {
	if(id==lastBigImgThree[toc_id]) return;

	if(clear==1) {
		clearTimeout(timerBigThree[toc_id]);
		timerBigThree[toc_id] = setTimeout("setTimerBigImgThree()", motiveTime*1000);
	}
	
	$("#sq_" + toc_id + "_" + lastBigImgThree[toc_id]).toggleClass("act");

//	$("#motive_" + toc_id + "_" + lastBigImgThree[toc_id]).fadeOut(300)
	$("#imgAnons_" + toc_id + "_" + lastBigImgThree[toc_id]).fadeOut(300)

	$("#sq_" + toc_id + "_" + id).toggleClass("act");

//	$("#motive_" + toc_id + "_" + id).fadeIn(300);
	$("#imgAnons_" + toc_id + "_" + id).fadeIn(300);
	
	lastBigImgThree[toc_id] = id;

}
//////////////////////////////////////////////////////////////////////////////



function showFormGuestVisit() {
	if ($("#formGuestVisit").css("display") == "none" ) {
		$("#formGuestVisit").show();
		$(".banner-ind").css({
			visibility: "hidden"
		});
	}
	else {
		$("#formGuestVisit").hide();
		$(".banner-ind").css({
			visibility: "visible"
		});
	}
}

function showHideBlock(id) {
	if ($("#"+id).css("display") == "none" ) {
		$("#"+id).show();
	}
	else {
		$("#"+id).hide();
	}
}


