var container;
/*
 *	Executes the function when the DOM is ready to be used
 */
$(function(){

	//workaround to close the popover from the popover
	$("body").append('<input id="closedailog" name="closedialog" onclick="$(\'.ui-dialog-titlebar-close\').trigger(\'click\');" type="button" />');		
	$("#closedailog").hide();

	//create the popover
	container = $('<div style="margin:0;padding:0;"><iframe class="iframe" style="width:100%;height:100%;" src="http://www.globalbx.com/popup.html" name="pop_iframe" marginheight="0" marginwidth="0" noresize="noresize" frameborder="0" scrolling="no" ></iframe></div>');
	container.dialog({ 
		autoOpen: false,
		bgiframe: true,
		modal: false,
		resizable: false,
		width: 770,
		height: 770 });

	//open the modal dialog after 10 secs ie. 10000, changed to 2 secs ie. 2000
    setTimeout("openDialog();", 2000);
});
/*
 * Show the popup  
 */
function openDialog() {
	container.dialog('open');
}
