$(document).ready(function() {

	JQLightboxGrouper ();

});

function meret (){

	//var windowHeight = document.body.offsetHeight;
	var windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
	var headerHeight = $('#top').height();
	var footerHeight = $('#bottom_bg').height();
	
	var contentHeight = windowHeight-headerHeight-footerHeight;
	
	var actHeight = $('#middle').height();

	if(actHeight < contentHeight){
		$('#middle').css('height',contentHeight-175+'px');
	}
}

function JQLightboxGrouper () {
	$(function() {
        var boxen = [];
        //find all links w/ rel="lightbox[gallery_name]" or just rel="lightbox" it works both ways
        $('a[rel*=lightbox]').each(function() {
        //push only unique lightbox[gallery_name] into boxen array
        if ($.inArray($(this).attr('rel'),boxen)) boxen.push($(this).attr('rel'));
    });
    //for each unique lightbox group, apply the lightBox
    $(boxen).each(function(i,val) { $('a[rel='+val+']').lightBox(); });
    });
}
