// We don't want the modal in the admin
if (!document.getElementById("edit-bar")) {
	
	// Mootools needs to play nice
	jQuery.noConflict();
	
	(function($){							

		$(function(){
	        
			// jQuery UI Dialog    
			$('#dial').dialog({
	           	autoOpen: false,
	           	width: 400,
	           	modal: false,
	           	resizable: false,
	           	buttons: {
	               	"Cancel": function() {
	                   	$(this).dialog("close");
	               	}
	           	}
	        });

	        $('form#testconfirmJQ').submit(function(){
	           	$("#dialog-radios").html($("select#radios").val());
				var fileName;
				fileName = $('select#radios option:selected').val();
			
				// Set the appropriate vars for swfobject
				var flashvars = {
					file: "http://bedzzz.dufresne.ca/resources/catalogue_20/radios/" + fileName + ".mp3",										
				};
				
				var params = {};
				var attributes = {};

				swfobject.embedSWF("http://www.dufresne.ca/promotion/radioplayer.swf", "player96861", "250", "160", "9.0.0", "http://bedzzz.dufresne.ca/templates/bedzzz/scripts/expressinstall.swf", flashvars, params, attributes);

	            $('#dial').dialog('open');
	            return false;
	        });
		});
	})(jQuery);
}
