
// Filename:      pageResize.js                      
// Author:        James Radford BSc                    
// Creation date: 09/03/2008                    


function GetWindowHeight() {

	if( typeof( window.innerWidth ) == 'number' ) {
		return window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		return document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		return document.body.clientHeight;
	}
}
function SetContentHeight() {	
	if (typeof document.body.style.maxHeight == "undefined") {
		document.getElementById("MainContent").style.height = GetWindowHeight() - 170 + "px";		
	}
	else {
		document.getElementById("MainContent").style.minHeight = GetWindowHeight() - 166 + "px";
	}	
}
function resize(e) {
	SetContentHeight();
}


// popup functions

function PopUpWindow(url,windowname,winwidth,winheight) {
    if(winwidth == 1 && winheight == 1) {        
        winwidth = (screen.availWidth - 10).toString();
        winheight = (screen.availHeight - 10).toString()
    }        
    if(url.indexOf('http') != '0') {        
        url = '/' + url;
    }
	window.open(url,windowname,'scrollbars=yes,resizable=yes,location=no,directories=no,menubar=no,toolsbar=no,status=no,width=' + winwidth + ',height=' + winheight);
}
function PopUpWindow2(url,windowname,winwidth,winheight) {
    if(winwidth == 1 && winheight == 1) {        
        winwidth = (screen.availWidth - 10).toString();
        winheight = (screen.availHeight - 10).toString()
    }        
    if(url.indexOf('http') != '0') {
        url = '/' + url;
    }
	window.open(url,windowname,'scrollbars=yes,resizable=no,location=no,directories=no,menubar=no,toolsbar=no,status=no,width=' + winwidth + ',height=' + winheight);
}

// launch ITP
function CustomerLogin(url) {
	window.open(url,'IRMASTERF1EXT','scrollbars=0,resizable=yes,location=no,directories=no,menubar=no,toolsbar=no,status=no,top=0,left=0,height=680,width=1030');
}