var slideID = 1;
	
jQuery(document).ready(function(){
	
	var enableAutomaticSlides = true; // set to false if you don't wont automatic slides
	var sliderTime = 8000; // 10 seconds

	
	var stopAutomatic = false;
	var autoMaticClick = false;
	
	jQuery("div.img_slider ul li a").each(function(){
		jQuery(this).mouseenter(function(){
			var img = jQuery(this).find("img");
			if (!jQuery(img).parent().parent().hasClass("big_active"))	{
				img.attr("src","/images/frames/big_" + img.attr("rel") + ".png");
				$(img).css({width: "61px",height: "61px"});
			}
		}).mouseleave(function(){
			var img = jQuery(this).find("img");
			if (!jQuery(img).parent().parent().hasClass("big_active"))	{
				img.attr("src","/images/frames/small_" + img.attr("rel") + ".png");
				$(img).css({width: "61px",height: "61px"});
			}
		}).click(function(){
			
			if (!autoMaticClick) {
				stopAutomatic = true;
			}

			autoMaticClick = false;

			if (jQuery(this).parent().hasClass("big_active")) return false;

			var img = jQuery(this).find("img");

				jQuery("div.frames_banner div.baner_url").each(function(){
					var div = jQuery(this);
				  	if (!div.hasClass("visible"))	{
				  			div.css({"opacity":"0","zIndex":0});
				  	}	else	{
				  			div.animate({opacity:0},300);
				  	}
				});

			  	jQuery("div.img_slider ul li img").each(function(){
			  		var img = jQuery(this);
			  		img.css({width: "61px",height:"61px"});
			  		img.attr("src","/images/frames/small_" + jQuery(this).attr("rel") + ".png");
			  		img.parent().parent().removeClass("big_active");
			  	})
			  
			  	img.parent().parent().addClass("big_active");
				img.css({width: "73px",height: "73px"});
				img.attr("src","/images/frames/big_" + img.attr("rel") + ".png");

				slideID = (img.attr("rel"));
				
			  	jQuery(jQuery(this).attr("href")).animate({opacity:1},500,function(){
			  	jQuery(this).removeClass("visible");
			  	jQuery(jQuery(this).attr("href")).addClass("visible");
			  }).css({"zIndex":8});

		return false;
		});
	});
		function startAutomatic(autoI){
				setTimeout(function(){
					if (stopAutomatic)	 return false;
					autoMaticClick = true;
					jQuery(jQuery("div.img_slider ul li").get(autoI)).find("a").click();
					
					autoI++;
					if (autoI == jQuery("div.img_slider ul li").length) autoI = 0;
					startAutomatic(autoI);
				},sliderTime);
		}

		if (enableAutomaticSlides)	{
			startAutomatic(0);
		}
});