$(document).ready(function(){
/* --------------------------------------- */
/* CORNERS */
/* --------------------------------------- */					   
	$("#container, #footer, #header, #products, #aboutus, .big_images, label, button, .images ").corner("keep 5px");	
	$("#category_link").corner("keep 5px tl");
	$("#producers_link").corner("keep 5px tr");	
	$(".top_products").corner("keep 5px bottom");
/* --------------------------------------- */
/* SHOW / HIDE */
/* --------------------------------------- */	
	$('a#category_link').click(function() {
		$('#category_tree').show('slow');
		$('#producers_tree').hide('slow');
		$('a#category_link').addClass('select_tab');
		$('a#producers_link').removeClass('select_tab');
	return false;
    });
	$('a#producers_link').click(function() {
		$('#category_tree').hide('slow');
		$('#producers_tree').show('slow');
		$('a#producers_link').addClass('select_tab');
		$('a#category_link').removeClass('select_tab');
	return false;
    });
	
	if(menuProducers == 'true') {
		$('#category_tree').hide('slow');
		$('#producers_tree').show('slow');
		$('a#producers_link').addClass('select_tab');
		$('a#category_link').removeClass('select_tab');
	};
/* --------------------------------------- */
/* GALLERY */
/* --------------------------------------- */		
	$('a.lightbox').lightBox({fixedNavigation:true});
/* --------------------------------------- */
/* PRELOADER */
/* --------------------------------------- */
	$('#carousel img').hide();//hide all the images on the page
});	
var i = 0;//initialize
var int=0;//Internet Explorer Fix
$(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
	var int = setInterval("doThis(i)",500);//500 is the fade in speed in milliseconds
});
function doThis() {
	var imgs = $('img').length;//count the number of images on the page
	if (i >= imgs) {// Loop the images
		clearInterval(int);//When it reaches the last image the loop ends
	}
	$('img:hidden').eq(0).fadeIn(500);//fades in the hidden images one by one
	i++;//add 1 to the count
	$('#carousel').removeClass('preloader');
}
/* --------------------------------------- */
/* CAROUSEL */
/* --------------------------------------- */	
window.onload = function() {
	$('#carousel').Carousel({
		itemWidth:580,
		itemHeight: 450,
		itemMinWidth: 250,
		items: 'span',
		reflections: .000001,
		rotationSpeed: 3.0
	});
};



  
  
