$(document).ready(function(){
	if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) return false;	
	var id = 0;
	
	function _execV(selector_string){
		
		selector_element = '#photo_bar a:eq('+id+')';
		_url = $(selector_element).attr('href');
		var title_img = new String();
		title_img = $(selector_element+' img').attr("title");
		but_class = $(selector_element).attr("class");
		
		count_img = $('#photo_bar a').size();
		if((count_img-1) == id){
			id = 0;
		} else {
		id = id + 1;
		}

		$("#photo_block img").css("display", "none");
		$("#photo_block img").detach();
		$(selector_element+' img').clone().prependTo('#photo_block');
		$("#photo_block img").css("display", "none");
		$("#photo_block img").attr('id', 'photo_main');
		
		$("#photo_block img").attr('class', but_class);
		if($.browser.msie){
			$("#photo_block img").css("display", "block");
			$("#photo_title").css("display", "none").delay(2700);
			$("#photo_title").attr('class', but_class);
			$("#photo_title a").text(title_img);
			$("#photo_title a").attr('href', _url);
			$("#photo_title").css("display", "block");
		} else{
			$("#photo_block img").fadeIn("slow");
			$("#photo_title").css("display", "none").delay(700);
			$("#photo_title").attr('class', but_class);
			$("#photo_title a").text(title_img);
			$("#photo_title a").attr('href', _url);
			$("#photo_title").fadeIn("fast");
		}
	}
	
	intervalID = setInterval(_execV, 4000); /*_*/
});
