var sensSpeed = 100;
$(document).ready(function(){
///
	$(".sens").hover(
		function(){
			$(this).fadeTo(sensSpeed,.4);
		},
		function(){
			$(this).fadeTo(sensSpeed,1);
		}
	);
///
	$(".sens1").hover(
		function(){
			$(this).fadeTo(sensSpeed,0);
		},
		function(){
			$(this).fadeTo(sensSpeed,1);
		}
	);
///
	$(".fadeTo").fadeIn(sensSpeed*10);
});
window.allowOpen = 'yes';
window.isOpen = 0;
function togg(){
	if(window.allowOpen=='yes'){
		if(window.isOpen==0){
			//$('#ajaxResult3').attr('innerHTML','!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
			//$('#ajaxLoad3').attr('innerHTML','');
		}
	$('#trToSlide').toggle('blind',function(){
											if(window.isOpen==0){
												//$('#ajaxResult3').attr('innerHTML','');
												//alert('OPEN');
												goDesc();
												window.isOpen=1;}else{
													//$('#ajaxResult3').attr('innerHTML','');
												//$('#ajaxLoad3').attr('innerHTML','');
													//alert('CLOSE');
													
													window.isOpen=0;}});
	$('.bottButt').toggleClass('bottButt1',0);
	}
}
function ajaxer(){
//alert('ajaxer runs: '+id);
	
	$('#ajaxResult').fadeOut(sensSpeed*2,function(){$('#ajaxLoad').fadeIn(sensSpeed*2,function(){
	
	$.ajax({
	url: 'ajaxForm.php',
	dataType: 'html',
	success:function(data){
				$('#ajaxResult').html(data);
				$('#ajaxLoad').fadeOut(sensSpeed*2,function(){$('#ajaxResult').fadeIn(sensSpeed*2);});
				
			}
	})
	
	});});
	
}
function goShow(id){
	
	if(id>window.maxId){ window.currId = 1; }else if(id<1){ window.currId = window.maxId; }else{ window.currId = id; }
	//alert(window.currId);
	
	$('#nR'+window.prevId).css('color','#ccc');
	$('#nR'+window.currId).css('color','#893b56');
	
	window.prevId = window.currId;
	
	$('#ajaxResult2').fadeOut(sensSpeed*2,function(){
	
												   $('#ajaxLoad2').fadeIn(sensSpeed*2,function(){
	
	$.ajax({
	url: 'ajaxShow.php?id='+window.currId,
	dataType: 'html',
	success:function(data){
				$('#ajaxResult2').html(data);
				$('#ajaxLoad2').fadeOut(sensSpeed*2,function(){$('#ajaxResult2').fadeIn(sensSpeed*2);});
				
			}
	})
	
	});});

	goDesc();
	
}
function goDesc(){
		$('#ajaxResult3').fadeOut(sensSpeed*2,function(){
	
												   $('#ajaxLoad3').fadeIn(sensSpeed*2,function(){
	$.ajax({
	url: 'ajaxDesc.php?id='+window.currId,
	dataType: 'html',
	success:function(data){
				$('#ajaxResult3').html(data);
				$('#ajaxLoad3').fadeOut(sensSpeed*2,function(){$('#ajaxResult3').fadeIn(sensSpeed*2);});
				
			}
	})
	
	});});
}
