	/***** CAROUSELS ********/
	$(function(){
	if($('#hor-car').size())
	{
		$('#hor-car').jcarousel({
			scroll:3,
			wrap: "last"
		});
    }
    if($('#ver-car').size())
	{
		$('#ver-car').jcarousel({
			scroll:3,
			vertical:true
		});
	}
	});
	
	




	
	/** TABS **/
	$(function () {
		var tabContainers = $('div.tabs > div');
		
		$('div.tabs ul.tabNavigation a').click(function () {
			tabContainers.hide().filter(this.hash).show();
			
			$('div.tabs ul.tabNavigation a').removeClass('selected');
			$('div.tabs ul.tabNavigation li').removeClass('tab-selected');

			$(this).parent().addClass('tab-selected');
			$(this).addClass('selected');
			
			return false;
		}).filter(':first').click();

	});






	/**** MODAL POP UP ****/
	$(function(){
		$('#pop-start').click(function (e) {
			
			var docheight = $(document).height();
			var docwidth = $(document).width();
			
			
			var overlay = "<div id='trans-overlay' style='position:absolute; height:" + docheight + "px; width:" + docwidth + "px;'></div>";
			if($("#trans-overlay").length == 0){
				$('body').prepend(overlay);
			}
			else{}
			

			var popup = $('#pop-up-container');
			$(popup).center();

			popup.css({
				'z-index' : 100,                      
				'focus' : true
			});

			$(popup).show();

			return false;
		});


		$.fn.center = function () {
			this.css("position","absolute");
			this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() - 50 + "px");
			this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
			return this;
		};

		/* FUNCTIONS TO CLOSE THE WINDOW, ON CLICKING THE x.png AND USING THE ESC KEY */
		$('.close-link').click(function (e) {
			var popup = $('#pop-up-container');
			var overlay = $('#trans-overlay');		
			popup.hide();
			overlay.remove();
			return false;
		});


		$(document).keyup(function(event) {

		 if (event.keyCode == 27) {
			var popup = $('#pop-up-container');
			var overlay = $('#trans-overlay');		
			popup.hide();
			overlay.remove();

		 }

		});

	});



	/**** TOGGLING ****/
	$(function(){

		$('#toggle-start').click(function() {
			$('#toggle-this').slideToggle(300);
			$(this).text($(this).text() == 'Hide Div' ? 'Show Div' : 'Hide Div');
			return false;
		});

	});








	/**** TRANSLUCENT ROLLOVERS ****/
		$(function(){
			//Full Caption Sliding (Hidden to Visible)
			$('.boxgrid.captionfull').hover(function(){
				$(".cover", this).stop().animate({top:'340px'},{queue:false,duration:320});
			}, function() {
				$(".cover", this).stop().animate({top:'400px'},{queue:false,duration:320});
			});
		});


