pax.load.onloaded( function() {

	pax.event.bind( pax.$( 'modal1' ), 'click', function() {
		pax.widget.modal.init( { 
			message: "This is a message with buttons in the footer",
			footerMessage: "" +
				" <button type='button' onclick='pax.widget.modal.hide();alert(\"You clicked Cancel\");'>Cancel</button>" +
				" <button type='button' onclick='pax.widget.modal.hide();alert(\"You clicked OK\");'>OK</button>"
		} );
	} );

	pax.event.bind( pax.$( 'modal2' ), 'click', function() {
		//	Ajax
		pax.widget.modal.init( {
			url: "../examples/demo_modal_ajax.htm",
			contentDisplay: 'block',
			width: 800,
			height: 400
		} );
	} );

	pax.event.bind( pax.$( 'modal3' ), 'click', function() {
		//	Flash
		pax.widget.modal.init( {
			width: 504,
			height: 355,
			message: '<object height="355" width="504"><param name="movie" value="http://www.youtube.com/v/XtBY7_3gj6o&amp;rel=1"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/XtBY7_3gj6o&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" height="355" width="504"></object>',
			footerMessage: 'You can use any ordinary flash object you like!'
		} );
	} );

	pax.event.bind( pax.$( 'modal4' ), 'click', function() {
		//	Image
		pax.widget.modal.init( {
			message: '<img src="../examples/demo_modal_image1.jpg" style="width: 400px; height: 300px"/>',
			footerMessage: 'It\'s Mooodal!',
			width: 400,
			height: 300
		} );
	} );

	//	iFrame with custom template that uses the message parameter.
	pax.event.bind( pax.$( 'modal5' ), 'click', function() {
		pax.widget.modal.init( {
			src: "../",
			message: "Showing paxjs.com!",
			//width: 416,
			width: 800,
			height: 400,
			template: 
				"<div id='templatePaxModalBox'>" +
				"	<div id='templatePaxModalBoxFooter'>" +
				"		<a href='javascript:pax.widget.modal.hide();'>Close this</a> [:= message :]" +
				"	</div>" +
				"	<div id='templatePaxModalBoxContent'>[:= content :]</div>" +
				"</div>"
		} );
	} );
	
} );