// Java Document
function getDimensions() {
var Dimensions = "";
var scrwidth;
var scrheight;
var width;
var height;
var dim;
var vals;
var name = "userResolution";
var days = "1";
// Get the dimensions; IE uses .clientWidth/Height
// and Netscape (all versions) as well as Opera use .innerWidth/Height
if ((navigator.userAgent.indexOf('MSIE') > -1) && (navigator.userAgent.indexOf('Opera') == -1)) {
Dimensions = document.body.clientWidth + "x" + document.body.clientHeight;
scrwidth = document.body.clientWidth - 50;
scrheight = document.body.clientHeight - 250;

 width = scrwidth;
 height = scrheight;
 dim = Dimensions;
 vals = width + "|" + height + "|" + dim;
createCookie(name,vals,days)

} else {
Dimensions = window.innerWidth + "x" + window.innerHeight;
// give some space for headers and footers maybe.
scrwidth = window.innerWidth - 50;
scrheight = window.innerHeight - 250;
}
// Get the current resolution, which is a browser independant value
var ScreenRes = screen.width + "x" + screen.height;
// Return the dimensions
//return "<B>Browser:</B>" + Dimensions + "<B>Display:</B>" + ScreenRes;
if ((scrwidth > 1060) || (scrheight > 900)) {
 width = scrwidth;
 height = scrheight;
 dim = Dimensions;
 vals = width + "|" + height + "|" + dim;
createCookie(name,vals,days)

} else {

 width = "750";
 height = "350";
 dim = "0";
 vals = width + "|" + height + "|" + dim;
createCookie(name,vals,days)
}
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
