
// AJAX enable in-line gallery module
jQuery(function($){
	$('.moduleType_Images:has(.type-inline)').each(function(index,section){ // all inline sections
		$('.gallerylist li a',section).click(function(){
			thumbpath = $('img',this).attr('src');
			imgID = thumbpath.substring(thumbpath.lastIndexOf("_")+1);
			imgID = imgID.substring(0,imgID.indexOf('.'));
			//console.log(imgID);
			$('.image-inline',section).attr('src','/UserFiles/Image/images_full_'+imgID+'.jpg')
			$('.image-inline',section).attr('alt',$('img',this).attr('alt'))
			$('.gallerylist li.selected',section).removeClass('selected');
			$(this).parent().addClass('selected');
			
			$('.image-description',section).load($(this).attr('href')+' #'+$(section).attr('id')+' .image-description p' );
			if((typeof pageTracker)!="undefined")
			{
				// don't neglect analytics!
				pageTracker._trackPageview($(this).attr('href'));
			}
			return false;
		});
	})
});

/*
jQuery(function($){
	for each(txt in document.getElementsByClassName("copyHtml",document))
	{
		if(txt.tagName=="TEXTAREA")
		{
			txt.onclick = function(){
				this.focus();
				this.select();
			}
		}
	}
});
*/
