(function ($) {
// VERTICALLY ALIGN FUNCTION
$.fn.tabs = function(settings) {
	
	settings = jQuery.extend({
							 
	hide:true
	
	},settings);
	if(settings.hide==true)
	{
		 $('.tabNavigation').hide();
		 
		 $('.tabNavigation').show();
			setTimeout(function() {
			$('.tabNavigation').slideUp('fast');
			}, 2000);
			
	}
	
     var tabContainers = $('div.tabs > div');
     tabContainers.hide().filter(':first').show();	
                        
     $('div.tabs ul.tabNavigation a').click(function () {
			//GEEN CONTENT MAAR GALLERY			
		 if($(this).attr('href')!='#third'){
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('div.tabs ul.tabNavigation a').removeClass('selected');
			$(this).addClass('selected');
		 }
	 return false;
     }).filter(':first').click();	
	 
	 
	if(settings.hide==true)
	{
		/*TABLE HOVER*/
		   $("table").bind("mouseenter",function(){
		  $('.tabNavigation').slideDown('fast');
		}).bind("mouseleave",function(){
		  $('.tabNavigation').slideUp('fast');
		});
	}
};
})(jQuery);



$(document).ready(function(){  

var url=document.URL;
var check=/links/gi;
if(url.match(check)){var hidevar=false}else{var hidevar=true;}

$('.tabs').tabs({hide: hidevar});						   

	var url='http://www.kunst-en-licht.nl/';

	/*GALLERY*/
	$("#startGallery, #startGalleryImg").click(function () {
		$('a.lightbox').lightBox({
			imageBtnClose:url+'public/images/lightbox-close.gif',
			imageBtnPrev:url+'public/images/left.png',
			imageBtnNext:url+'public/images/right.png',
			txtImage:'Afbeelding',
			fixedNavigation:true,
			txtOf:'van',
			imageLoading:url+'public/images/lightbox-ico-loading.gif'
		});
	$("#gallery a.lightbox:first").trigger('click');
	});
	




	/*NIEUWS ALGEMEEN*/
	$("img").addClass("maxWidth");
	$(".kleinVenster").hide();	
	
	/*GROOT VENSTER NIEUWS*/
	$(".grootVenster").click(function()
	{
		var h=$(window).height();
		var hInner=h-20;		
		$("#frame").attr("id", "frame1");
		$("#frame1").attr({style:"margin-top:0px;  width:850px; height:"+h+"px; margin:auto; text-align:left;"});
		//$("#frame1").attr({style:"margin-top:0px; margin:auto; text-align:left;"});
		//$("#frame1").animate( { width:"850px" } , 1000 ).animate( { height:+h+"px" } , 1000 );
		$("#content").css("width", "760px");
		$("#content").animate( { height:+h+"px" } , 2000 );
		$("img").removeClass("maxWidth");

		$("#logo").hide();
		$("#menu").hide();
			$("#footer").hide();

		$(".grootVenster").hide();
		$(".kleinVenster").show();
	});
	
	/*KLEIN VENSTER NIEUWS */		
	$(".kleinVenster").click(function()
	{
		$("#frame1").attr("id", "frame");
		$("#frame").css("visibility", "visible");
		$("#frame").css("width", "800px");
		$("#frame").css("height", "600px");
		$("img").addClass("maxWidth");
		$("#content").attr({style:"height:304px; width:732px;"});
			
		$("#logo").slideDown("slow");
		$("#menu").slideDown("slow");
		$("#footer").slideDown("slow");
		$(".grootVenster").show();
		$(".kleinVenster").hide();
		$("#frame").vAlign();

	});
	
	
	/*BORDER TABEL BOTTOM TOEVOEGEN*/
	var rowCount = $('#overOns tr').length;
	var row=rowCount-1;
	$("tr:gt(0):lt("+row+")").addClass('bottomtop');


	/* CUSTOM SCROLLBAR */					   
	$('#scroll').jScrollPane({showArrows:true});

	
});	