// Modified by Nathan 23/07/08.
function popup(imgLink, winWidth, winHeight) {
	var winWMax	= 950;
	var winHMax	= 590;
	var hAdjust	= 350;
	var wAdjust	= 140;

	if (winWidth >= winWMax) {
		winHeight 	= Math.round((winWMax / winWidth) * winHeight);
		winWidth	= winWMax;
	}

	if (winHeight >= winHMax) {
		winWidth 	= Math.round((winHMax / winHeight) * winWidth);
		winHeight 	= winHMax;
	}
	
	winHeight	+= hAdjust;
	winWidth	+= wAdjust;
	
	window.open('popup.php?imgLink='+imgLink, '', 'height='+winHeight+', width='+winWidth+', resizable=1, scrollbars=1');
}


/*function popup(imgLink, imgWidth, imgHeight) {

	imgHeight = (imgHeight + 350);

	if(imgWidth > 700)
	{
		imgWidth = (imgWidth) - (imgWidth / 10);
	}

	if(imgWidth > 1450)
	{
		 // imgWidth = 950;
		imgWidth = screen.width;
	}
	else
	{
	}

	if(imgHeight > 950)
	{
		imgHeight = 950;
	}
	else
	{

	}

	//alert(imgWidth + ' ' + imgHeight);

	window.open('popup.php?imgLink='+imgLink, '', 'resizable=1, scrollbars=1, height=' + imgHeight + ', width=' + imgWidth);

}*/

function swap(ob, name, state) {

	ob.src= 'images/';

	ob.src+= (state == 1) ? name+'_over.png' : name+'_out.png';

}

function apply_event() {

	var main= document.getElementById('mc');

	var s_left= document.getElementById('shadow-left');

	var s_right= document.getElementById('shadow-right');

	

	if (navigator.appVersion.indexOf("MSIE") != -1){

		var b= navigator.appVersion.split("MSIE");

		var version= parseFloat(b[1]);

		if (version < 7) {

			s_left.style.height= main.clientHeight+'px';

			s_right.style.height= main.clientHeight+'px';

		} else {

			s_left.style.height= main.offsetHeight+'px';

			s_right.style.height= main.offsetHeight+'px';

		}

	} else {

		s_left.style.height= main.offsetHeight+'px';

		s_right.style.height= main.offsetHeight+'px';

	}

}


function init() {

    if (arguments.callee.done) return;

    arguments.callee.done= true;

	

	apply_event();

}



if (document.addEventListener) {

   document.addEventListener("DOMContentLoaded", init, false);

}



/*@cc_on @*/

/*@if (@_win32)

   document.write('<script defer src="http://www.acidgreen.com.au/247studios/inc/scripts/ie_init.js" /><'+'/script>');

/*@end @*/



window.onload = init;