



/*
* GENERAL PAGE FUNCTIONS
*
* requires browsersniff function (uses browser detection variables)
*
* SECTION 1: page dimension functions
* SECTION 2: preload functions
*
*/




/************************************************* PAGE DIMENSION FUNCTIONS *************************************************/

//set page variables holding minimum width and height of page
var min_width = 760;
var min_height = 400;


//vars to hold width and height of window
var win_width, win_height, screen_width, screen_height;


//function to get window and screen dimensions
//(n.b. can only be called once page has loaded)
function getDimensions() {
	//get window dimensions
	win_width = (is_ie) ? document.body.clientWidth : window.innerWidth;
	win_height = (is_ie) ? document.body.clientHeight : window.innerHeight;
	//get screen dimesnsions
	screen_width = screen.availWidth;
	screen_height = screen.availHeight;
}


//function set xy position for centered popup
//(returns string for pop up properties)
function centrePopUp(pop_width,pop_height) {
		var xpos = Math.round(((screen_width - pop_width)/2));
		var ypos = Math.round(((screen_height - pop_height)/2));
		var dim_string = 'width=' + pop_width + ',height=' + pop_height;
		//set strings depending on client browser
		if (is_nav && (is_major <= 4)) return (dim_string + ",screenX=" + xpos + ",screenY=" + ypos);
		else return (dim_string + ",left=" + xpos + ",top=" + ypos);
}



