// modal_dialog.js

// shows the specified url in a modeless dialog (IE) or new window without menue and navigation bar.
function show_image(url, width, height) {
	width = width + 50;
	height = height + 50;
	var	img_w = window.open(url,'','width='+width+',height='+height+',titlebar=0,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1');
 	return false;
}

function get_undersize() {
	var wi_size = get_window_inner_size(window);
	underwidth = screen.width - wi_size[0];
	if (underwidth < 0) {
		underwidth = 0;
	}
	underheight = screen.height - wi_size[1];
	if (underheight < 0) {
		underheight = 0;
	}
	return new Array(underwidth, underheight);
}

function get_window_inner_size(window_ref) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window_ref.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window_ref.innerWidth;
    myHeight = window_ref.innerHeight;
  } else if( window_ref.document.documentElement && ( window_ref.document.documentElement.clientWidth || window_ref.document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = window_ref.document.documentElement.clientWidth;
    myHeight = window_ref.document.documentElement.clientHeight;
  } else if( window_ref.document.body && ( window_ref.document.body.clientWidth || window_ref.document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = window_ref.document.body.clientWidth;
    myHeight = window_ref.document.body.clientHeight;
  }
  //window.alert( myWidth + ' x ' + myHeight );
  return new Array(myWidth, myHeight);
}
