(function() {
try {
if (!cllc.exists) { throw "cllcObjUndefined"; }

//Commonly used functions/helpers
cllc.utils = 
{
	//Universal Window Function Type "yes" or "no" for scrollBar
	flexWin: function(url, scrollbars, width, height, name, chrome, xPos, yPos, close) {
		cllc.utils.new_window({
			url: url,
			name: name,
			width: width,
			height: height,
			left: xPos,
			top: yPos,
			directories: chrome,
			location: chrome,
			menubar: chrome,
			resizable: chrome,
			scrollbars: scrollbars,
			status: chrome,
			toolbar: chrome,
			close: close
		});
	},
	
	new_window: function(options) {
		options.name	= options.name || "cllc_win_"+(new Date()).getMilliseconds();
		options.replace	= options.replace || false;
		options.width	= options.width || 800;
		options.height	= options.height || 600;
		options.left	= options.left || (screen.availWidth - options.width) / 2;
		options.top		= options.top || ((screen.availHeight - options.height) / 2) - 40;
		
		var window_features = [];
		
		window_features.push("width=" + options.width);
		window_features.push("height=" + options.height);
		window_features.push("left=" + options.left);
		window_features.push("top=" + options.top);
		
		if (options.directories)	{ window_features.push("directories=" + options.directories); }
		if (options.location)		{ window_features.push("location=" + options.location); }
		if (options.menubar)		{ window_features.push("menubar=" + options.menubar); }
		if (options.resizable)		{ window_features.push("resizable=" + options.resizable); }
		if (options.scrollbars)		{ window_features.push("scrollbars=" + options.scrollbars); }
		if (options.status)			{ window_features.push("status=" + options.status); }
		if (options.toolbar)		{ window_features.push("toolbar=" + options.toolbar); }
		
		window.open(options.url, options.name, window_features.join(','), options.replace);
		if (options.close) window.close();
	}
};

//flexWin = cllc.utils.flexWin;

} catch(e) { cllc.standard_error_handler(e); }
})();