/* Javascript
----------------------------------------------------------------------------- */


/* Ready Function
----------------------------------------------------------------------------- */


	$(document).ready(function() {
	
	
		$('#post').hide();
		
		
/* Enlarged Image Display
----------------------------------------------------------------------------- */
		
		
		$('.module-images-browse ul.content a[rel=lightbox]').click(function() {

			$('body').append('<a href="#" id="enlarged"></a>');
			$('a#enlarged').css('display','block');
			$('a#enlarged').css('width','100%');
			$('a#enlarged').css('height','100%');
			$('a#enlarged').css('position','fixed');
			$('a#enlarged').css('top','0');
			$('a#enlarged').css('left','0');
			$('a#enlarged').css('text-align','center');

			var img = $(this).children('img').attr('src').replace('thumb_','img_');
			
			imgLoader = new Image();
			imgLoader.src = img;
			
			imgLoader.onload = function() {  
			
				var height = imgLoader.height;
				var top = ($('a#enlarged').height() - imgLoader.height) / 2;
				$('a#enlarged').append('<img src="' + img + '" alt="" />');
				$('a#enlarged img').css('display','inline');
				$('a#enlarged').css('padding-top',top + 'px');
			
			}
			
			$('a#enlarged').click(function() {
			
				$(this).remove();
				return false;
			
			});
			
			return false;
		
		});
		
		
/* Internet Explorer 6 */

		
		$('.module-images-browse ul.content a[rel=lightbox_ie]').click(function() {

			var img = $(this).children('img').attr('src').replace('thumb_','img_');
			window.open(img);
			return false;
		
		});
				
	
/* Language Changes
----------------------------------------------------------------------------- */
	
	
		$('.section-guestbook a.comment').text("Sign Guestbook");
		$('.section-guestbook #post h3').text("Sign Guestbook");
		$('.section-guestbook #browsecomments h3').text("Guestbook Entries");
		
		
/* End Ready Function
----------------------------------------------------------------------------- */


	});


/* Load Function
----------------------------------------------------------------------------- */


	$(window).load(function() {
	
		
/* External Links
----------------------------------------------------------------------------- */


		$('a[rel=external]').click(function(){
		
			link = $(this).attr('href');
			window.open(link);
			return false;
	
		});


/* End Load Function
----------------------------------------------------------------------------- */


	});
	
	
/* Function: Fix Tab Paging
----------------------------------------------------------------------------- */


	function fixPaging(pane) {

		$(pane + ' ul.paging a').each(function() { 
		
			var $this = $(this); 
			$this.attr('href', $this.attr('href') + pane); 
	
		});

	}
	
	
/* Function: Toggle Object
----------------------------------------------------------------------------- */

	
	function toggle(what) {
	
		if ($(what).css('display') != "none") {
		
			$(what).hide();
		
		} else {
		
			$(what).show();
		
		}
		
	}