/**
 *	Viewport
 *	Thickbox sucks its own bum. These functions
 *	work out the briowse window then update thickbox links
 *	to be the window height minus 100px.
 *	
 *	@author philthompson.co.uk
 *	@copyright 2009 
 *	@library jQuery
 */

/**
 *	setViewport
 *	@copyright: http://www.javascripter.net/faq/browserw.htm
 */
function setViewport(){

	
	var windowHeight  = $(window).height(); 

	return windowHeight;

}

function alterThickboxLinks(height){
	height = (height - 100);
	
	$('#screenshots-inner a.thickbox').each(function(){
		var href = $(this).attr('href');
		var newHref = href.replace('height=500', 'height=' + height);
		$(this).attr('href', newHref)
		
	});
}


$(document).ready(function(){
	windowHeight = setViewport();
	alterThickboxLinks(windowHeight);
});


