﻿// START New Open Pop Up 
// dynamically set the width and height 
// of the pop window based on the site visitor's 
// screen resolution

// Set inner width and height - USED By function screenDetect() and newBrWindow
var iw, ih; 

function newOpenPopup(theURL,winName,features) {

    if (features == '' || features == null){
	    features = 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=400,screenX=50,screenY=50,left=50,top=50';
    }else if (features == 'detect'){	    
	    screenDetect();	
	    features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+iw+',height='+ih+',screenX=25,screenY=25,left=25,top=25';
    }
    newWin = window.open(theURL,winName,features);
}
function screenDetect () {
    var reduction = 50;
	if (window.innerWidth == null) {
	    iw = document.body.clientWidth - reduction;
	    ih = document.body.clientHeight - reduction;
    }
    else {
	    iw = window.innerWidth - reduction;
	    ih = window.innerHeight - reduction;
    }
    return iw, ih;
}
// END New Open Pop Up