jQuery(document).ready(function () {

//jQuery('.inner').wrap('<div class="new" />');

//jQuery('img', 'div.wysiwyg_container').wrap('<div class="new" />');

//jQuery('hr', 'div.wysiwyg_container').replaceWith('<div class="new" />');

//jQuery('blockquote', 'div.wysiwyg_container').each(function (i) {
	//jQuery(this).replaceWith('<div class="new">' + jQuery(this).html() + '</div>');
//});

jQuery('a.lightbox').attr('rel', 'shadowbox'); Shadowbox.init();

/////////////////////////////////
//16/09/2010
	$('#ulcontainer').css('margin-left', '0px');
	jQuery('a.lightbox').attr('rel', 'shadowbox'); Shadowbox.init();
	jQuery(".shadow").textShadow();
	
	var timeout=6000;
	var fadeTime=300;
	
	$('.galleryChanger').click(function(){
		$('.galleryChanger').removeClass('active');
		var id = $(this).addClass('active').attr('rel');
		var totalPhotos = $('.galleryChanger', '#ulcontainer').length;
		
		$('.galleryImage').fadeOut(fadeTime);
		setTimeout("$('#image-"+id+"').fadeIn("+fadeTime+")", fadeTime);
		
		if(id==totalPhotos) {
			setTimeout(returnBack, timeout);
		}
		return false;
	})
	
	function returnBack() {
		$('.galleryImage').fadeOut(fadeTime);
		$('#counter-1').click()
		//setTimeout("$('#counter-1').click()", fadeTime);
	}
	
	function autoshow(){
	//	var i=Math.round(Math.random()*$('.galleryChanger', '#ulcontainer').length);
	//	$('#counter-'+i).click();
		var item = $('.active', '#ulcontainer').next().click();
	}
	
	setInterval(autoshow, timeout);
});
