/* v http://www.howtocreate.co.uk/tutorials/javascript/browserwindow v */

var myWidth = 0, myHeight = 0;

if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	myWidth = document.body.clientWidth;
	myHeight = document.body.clientHeight;
}

/* ^ http://www.howtocreate.co.uk/tutorials/javascript/browserwindow ^ */

myWidth -= 40;
if (myWidth < 800)
	myWidth = 800;
myHeight -= 40;
if (myHeight < 600)
	myHeight = 600;

var a_nodes = document.getElementsByTagName('A');
for (i = 0; i < a_nodes.length; i++)
	a_nodes[i].href = a_nodes[i].href.replace(/width=800&height=600&autoSize/, 'width=' + myWidth + '&height=' + myHeight);

$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'slow', /* fast/slow/normal */
		padding: 0, /* padding for each side of the picture */
		opacity: 0.75, /* Value betwee 0 and 1 */
		showTitle: false, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
		callback: function(){}
	});
});

