navouttimer = '';
function btnOver() {
	jQuery(this).stop().animate({"opacity": "0.5"}, 200);
}
function logoOver(){
	jQuery(this).stop().animate({"opacity": "0.7"}, 200);
}
function nav_init(){
	jQuery.each(jQuery('.nav_over'),function(i,e){
		jQuery(this).css({'maxHeight':jQuery(this).height()+'px', 'visibility':'hidden'});
		jQuery(this).css({'height':'0'});
	});
}
function nav_btn_over() {
	jQuery(this).stop().animate({"opacity": ".65"}, 200);
	id = jQuery(this).attr('id');
	if(jQuery('#'+id+'_over')){
		theheight = parseInt(jQuery('#'+id+'_over').css('maxHeight'));
		jQuery('#'+id+'_over').css({'display':'block', 'visibility':'visible'});
		jQuery('.nav_over').stop().animate({'height':0}, 300);
		jQuery('#'+id+'_over').stop().animate({'height':theheight}, 300);
	}
	clearTimeout(navouttimer);
}
function nav_btn_out(){
	jQuery(this).stop().animate({'opacity':1}, 200);
	id = jQuery(this).attr('id');
	navouttimer = setTimeout(function(){remove_nav_menu('#'+id+'_over')}, 500);	
}	
function nav_over_out(){
	id = jQuery(this).attr('id');
	navouttimer = setTimeout(function(){remove_nav_menu('#'+id)}, 500);	
}	
function remove_nav_menu(el){
	jQuery(el).stop().animate({'height':0}, 300, function(){
		jQuery(el).css({'visibility':'hidden', 'display':'none'})
	});
}
function btnOut() {
	jQuery(this).stop().animate({"opacity": "1"}, 200);
}
function changeImages(count){
	changeImagesInt = setInterval(function(){imageFader(count);}, 6000);
}
image_id = 0;
function imageFader(count){
	jQuery('#image_'+image_id).stop().fadeOut(1000);
	image_id++;
	if(image_id == count){
		image_id = 0;
	}
	jQuery('#image_'+image_id).stop().fadeIn(1000);
}
function prevPic(count){
	jQuery('#image_'+image_id).stop().fadeOut(1000);
	image_id--;
	if(image_id < 0){
		image_id = count - 1;
	}
	jQuery('#image_'+image_id).stop().fadeIn(1000);
	clearInterval(changeImagesInt);
}
function nextPic(count){	
	jQuery('#image_'+image_id).stop().fadeOut(1000);
	image_id++;
	if(image_id == count){
		image_id = 0;
	}
	jQuery('#image_'+image_id).stop().fadeIn(1000);
	clearInterval(changeImagesInt);
}
function changeProds(count){
	changeProdsInt = setInterval(function(){prodFader(count);}, 6000);
}
prod_id = 0;
function prodFader(count){
	jQuery('#item_'+prod_id).stop().fadeOut(600);
	prod_id++;
	if(prod_id == count){
		prod_id = 0;
	}
	jQuery('#item_'+prod_id).stop().fadeIn(600);
}
function prevProd(count){
	jQuery('#item_'+prod_id).stop().fadeOut(600);
	prod_id--;
	if(prod_id < 0){
		prod_id = count - 1;
	}
	jQuery('#item_'+prod_id).stop().fadeIn(600);
	clearInterval(changeProdsInt);
}
function nextProd(count){	
	jQuery('#item_'+prod_id).stop().fadeOut(600);
	prod_id++;
	if(prod_id == count){
		prod_id = 0;
	}
	jQuery('#item_'+prod_id).stop().fadeIn(600);
	clearInterval(changeProdsInt);
}

