// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
/**************************************************************************
Gallery Functions
***************************************************************************/
function show_picture( div_id ) {
	document.getElementById( div_id ).style.display = "block"
	//Effect.Appear( "zoom" );
	setTimeout( "center_picture( '" + div_id + "' )", 200 );
	//center_picture( div_id );
}

function center_picture( id ) {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		win_width = window.innerWidth;
		win_height = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		win_width = document.documentElement.clientWidth;
		win_height = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		win_width = document.body.clientWidth;
		win_height = document.body.clientHeight;
	}
	
	var div_id = id;
	var pic_div = document.getElementById( div_id );
	var pic_width = pic_div.clientWidth;
	var x = (win_width - pic_width) / 2;
	
	//alert( "pic_div width: " + pic_width + "\nwin width: " + win_width );
		
	pic_div.style.left = x + "px";
	
	var pic_height = pic_div.clientHeight;
	var y = (win_height - pic_height) / 2;

	var scrOfY = 0;
		
	if( typeof( window.pageYOffset ) == 'number' ) {
	    //Netscape compliant
	    scrOfY = window.pageYOffset;
	  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
	    //DOM compliant
	    scrOfY = document.body.scrollTop;
	  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
	    //IE6 standards compliant mode
	    scrOfY = document.documentElement.scrollTop;
	  }
	
	pic_div.style.top = y + scrOfY + "px";
}
