﻿function newCfwindow(nameWin,titleWin,sourceWin,heightWin,widthWin,isClosable,isResizable) {
	var winW = 0, winH = 0;
	if(isClosable==''){isClosable='true';}
	if(isResizable==''){isResizable='false';}
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		winW = window.innerWidth;
		winH = window.innerHeight;
	} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'                           
		winW = document.documentElement.clientWidth;
		winH = document.documentElement.clientHeight;
	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		winW = document.body.clientWidth;
		winH = document.body.clientHeight;
	}
	PosX = (winW/2)-(widthWin/2);
	PosY = (winH/2)-(heightWin/2);
	ColdFusion.Window.create(nameWin, titleWin, sourceWin, {height:heightWin,width:widthWin,x:PosX,y:PosY,modal:true,closable:isClosable,draggable:true,resizable:isResizable,initshow:true});
	ColdFusion.Window.onHide(nameWin, cfwindowOnHide );
	return true;
}
function cfwindowOnHide(name) {
	ColdFusion.Window.destroy(name,true);
	return true;
}
