/*
* GENERAL FUNCTIONS
* 
* Window and screen handling functions
*
*/






/**************************************** Window and screen handling functions ***************************************************/


//page global variables
var window_width, window_height, screen_width, screen_height, avail_width, avail_height;

var pop_win_ref;

//function to get page dimensions
function getPageDimensions() 
{
	window_width = (is_ie) ? document.body.clientWidth : window.innerWidth;
	window_height = (is_ie) ? document.body.clientHeight : window.innerHeight;
	
	avail_width = screen.availWidth;
	avail_height = screen.availHeight;
	
	screen_width = screen.width;
	screen_height = screen.height;
}


//function get xy (returns string for pop up properties
function getWinXY (win_width,win_height) 
{		
	//get page dimensions if not already set
	if (screen_width == null) getPageDimensions();
	
	//determine x y of centered window
	var xpos = Math.round(((avail_width - win_width)/2));
	var ypos = Math.round(((avail_height - win_height)/2)) - ((screen_height - avail_height)/2);	
	
	//start return string
	var return_string = 'width='+win_width+',height=' + win_height;
	
	//return relevant string
	if (is_nav && (is_major <=4)) return (return_string + ',screenX=' + xpos + ',screenY=' + ypos)
	else return (return_string + ',left=' + xpos + ',top=' + ypos)
}



//futura general popup function (centres on page)
function popWin (file_name,win_name,win_width,win_height,is_scroll,is_resize,is_location,config) 
{
	//create conf_string for popup
	var conf_string = getWinXY(win_width,win_height);
	conf_string += (is_scroll) ? ',scrollbars=yes' : ',scrollbars=no';
	conf_string += (is_resize) ? ',resizable=yes' : ',resizable=no';
	conf_string += (is_location) ? ',location=yes' : ',location=no';
	if (config != null) conf_string += ','+config;
	//window.alert(conf_string);
	
	//open window and set to focus
	if (pop_win_ref && (!pop_win_ref.closed)) pop_win_ref.close();
	pop_win_ref = window.open(file_name,win_name,conf_string);
	pop_win_ref.focus();
}


//Site specific scripts

//popup function for vision2010
function launchSite()
{
	popWin('popup.html','popup',770,510,false,false,'');
}


function popMov(page)
{
	popWin(page,'mov_popup',320,255,false,false,'');
	
}

function popMov2(page)
{
	popWin(page,'mov_popup2',320,215,false,false,'');
}

function popMov3(page)
{
	popWin(page,'mov_popup3',300,255,false,false,'');
}

function popMov4(page)
{
	popWin(page,'mov_popup4',800,600,false,false,'');
}

function popMov5(page)
{
	popWin(page,'mov_popup4',400,335,false,false,'');
}

function popMov6(page)
{
	popWin(page,'mov_popup6',800,450,false,false,'');
	
}
function popMov7(page)
{
	popWin(page,'mov_popup7',1024,650,false,false,'');
	
}
function popMov600x330(page)
{
	popWin(page,'mov_popup7',600,330,false,false,'');
}
function popMovcircus(page)
{
	popWin(page,'mov_popup7',379,319,false,false,'');

}
function popChicago(page)
{
	popWin(page,'mov_popup8',534,411,false,false,'');

}
	
	