var configureButtons = "<div class='admi_configureButtons'><div class='admi_widgetLabel'></div><div class='admi_configureButton'><a style=\"background: url('/images/ico-cancel.gif') left no-repeat;\" href=\"#\" class='admi_cancelButton'>"+i18n.__('Cancel')+"</a></div><div class='admi_configureButton'><a style=\"background: url('/images/ico-saveSettings.gif') left no-repeat;\" class='admi_saveButton' href=\"#\">"+i18n.__('Save')+"</a> </div></div>";
/**
* This is just an easy way to get the pop up window to show up.  The
* paramater is optional, if not included it will default to 600x300
* and position directly in the middle of the screen.  You can pass it a
* different width and height as well as Move the position.
*
* The offest is usually height / 2 so if height is 300 postop is 150
* to be in the center.
*
* Postop and PosLeft auto calculate according to the passed width and
* height.
*
* Params object can have width, height, postop, posleft, close, closeOnClick,
* closeOnEsc, classname, and html
*
* width = width of object
* height = height of object
* postop = what is subtracted from how far down it moves
* posleft = what is subtracted from how far left if moves
* close = Text of the close button
* closeOnClick = if you want to allow the box to close when they click
* 		outside the box
* closeonEsc = same as above, but esc key pressed
* classname = name of the class that it will be called
* html = HTML That will be loaded in.
*/
var configureButtons = "<div class='admi_configureButtons'><div class='admi_widgetLabel'></div><div class='admi_configureButton'><a style=\"background: url('/images/ico-cancel.gif') left no-repeat;\" href=\"#\" class='admi_cancelButton'>"+i18n.__('Cancel')+"</a></div><div class='admi_configureButton'><a style=\"background: url('/images/ico-saveSettings.gif') left no-repeat;\" class='admi_saveButton' href=\"#\">"+i18n.__('Save')+"</a> </div></div>";
function popExpose(params) {
	/* Preset Vals */ 
	preset = {	"width":600, "height":300, "close":i18n.__("Cancel"),"closeOnClick":false,"closeOnEsc":false, "classname":"admi_configurationElement","html":""}

	/* Overwrite anything passed in */ 
	for(var x in params) {
		preset[x] = params[x];
	}
   
	if(preset.postop == undefined) {
		preset.postop = preset.height / 2;
	}
	if(preset.posleft == undefined) {
		preset.posleft = preset.width / 2;
	}
	
	var configWindow = $("<div class='" + preset.classname + "' style='text-align:left; font-size:12px;'><div id='admin_top'><div style='float:right;'><a href='#' onclick='closeExpose()' style='text-decoration:none;'><img src='/images/ico-cancel.gif''> " + preset.close + "</a></div></div><br clear='all'> " + preset.html + "</div>");
	positionleft = ($(window).width()/ 2) - preset.posleft;
	positiontop = ($(window).height() / 2) - preset.postop;
	configWindow.css("top", positiontop);
	configWindow.css("left", positionleft);
	configWindow.css("width", preset.width);
	configWindow.css("height", preset.height);
	$($('body')[0]).append(configWindow);
		
	buttons = $(configureButtons).clone(true);
	//configWindow.append(buttons); /* I'm not sure if we want these buttons or not? */ 
	//configWindow.append(data);
	
	
	current_expose_overlay = configWindow.expose({
		api: true,
		closeOnClick: preset.closeOnClick,
		closeOnEsc: preset.closeOnEsc
	}).load();
   
}
/**
 * Incase they cancel early
 */
function closeExpose() {
	$.mask.close();
	//current_expose_overlay.close();
	$(".admi_configurationElement").remove();
}
