var screen_width = window.screen.availWidth;
var screen_height = window.screen.availHeight;
var widthvalue = parseInt(screen_width * .8);
var heightvalue = parseInt(screen_height * .88);

function browserWidth ()
{
	if (widthvalue < 600){
		return (600)
	}
	else if (widthvalue > 720){
		return (720)
	}
	else{
		return widthvalue
	}
}

function browserHeight ()
{
	if (heightvalue < 516){
		return (516)
	}
	else if (heightvalue > 850){
		return (850)
	}
	else{
		return heightvalue
	}
}

var left_point = parseInt((screen_width - browserWidth ())/2);
var top_point = parseInt(((screen_height - (browserHeight ()+32))/2));

if (top_point < 25){
	(top_point = 25)
}
if (left_point < 75){
		(left_point = 75)
}

function openAndMoveWindow (url)
{
	var optionString = 'left=' + left_point + ',top=' + top_point + ',width=' + browserWidth () + ',height=' + browserHeight () + ',resizable=yes';
   	var the_window =  window.open(url,'imageviewerpopup',optionString);
   	the_window.focus();
}