function callWindow(winID,winTitle,winURL,winHeight,winWidth) {
	try {
		var oldWindow = ColdFusion.Window.getWindowObject('win1');
		oldWindow.destroy(true);
		ColdFusion.objectCache['win1'] = null;
	} catch(e) { }
	
	if (!winWidth) {
		var winWidth = getBrowserSize()[0] / 2 - 100;
		winWidth = Math.max(winWidth,600); //Make sure at least 600
	}
	
	if (!winHeight) {
		var winHeight = getBrowserSize()[1] / 2 + 100;
		winHeight = Math.max(winHeight,435); //Make sure at least 435
	}
	
	ColdFusion.Window.create(	'win1', winTitle, winURL,
	{height:winHeight,width:winWidth,minheight:winHeight,minwidth:winWidth,modal:true,closable:true,draggable:true,resizable:true,center:true,initshow:true,refreshOnShow:true})

	var newWindow = ColdFusion.Window.getWindowObject('win1');
	
	//winButtons('win1');
	
	//Add listeners
	newWindow.on("hide",cleanup);
	newWindow.on("resize",resizePopFrame);
	
	//Fix for CF9 Centering issue
	newWindow.center();
}

function cleanup() {
	myWindow = ColdFusion.Window.getWindowObject('win1');
	myWindow.destroy(true);
	ColdFusion.objectCache['win1'] = null;
}

function resizePopFrame() {
	
	var popWindow = ColdFusion.Window.getWindowObject('win1');
	var popFrame = document.getElementById("popFrame");
	var popFrameHeight = 350; //Default Height
	
	if(typeof popWindow.getInnerHeight == 'function')
		popFrameHeight = popWindow.getInnerHeight() - 60; //CF9
	else
		popFrameHeight = popWindow.getEl().getHeight() - 100; //CF8
	
	popFrame.style.height = popFrameHeight + "px";
	
	//Resize map div if it exists
	if (popFrame.contentWindow.document.getElementById("map") != null)
		popFrame.contentWindow.document.getElementById("map").style.height = popFrameHeight + "px";
}

/* Uncomment the lines below to add a button to the bottom of the cfwindow ---
function winButtons(winID) {
	myWindow = ColdFusion.Window.getWindowObject('win1');
	
	myWindow.addButton({
		text:"Close",
		handler:function() {
		ColdFusion.Window.hide('win1',true);
		ColdFusion.Window.onHide('win1',cleanup);}
	});
}*/