/*
 * SimpleModal Basic Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2010 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: basic.js 254 2010-07-23 05:14:44Z emartin24 $
 */

jQuery(function ($) {
	// Load dialog on page load
	//$('#basic-modal-content').modal();

	// Load dialog on click
	/*$('#basic-modal .basic').click(function (e) {
		$('#basic-modal-content').modal();

		return false;
	});*/
        $('#basic-modal').click(function (e) {
            $('#basic-modal-content').modal({
                autoResize:true
            });

            return false;
	});
		
	$('#basic-modal2').click(function (e) {
            $('#basic-modal-content2').modal({
                autoResize:true,
                onClose: function (dialog) {
                    //ocultamos los prompts(bocadillos) y despues cerramos
                    $('#formContacta').validationEngine('hideAllFast');
                    $.modal.close(); // must call this!                                    
                }
            });

            return false;
	});
	$('#basic-modal3').click(function (e) {
		$('#basic-modal-content3').modal({//
                    //autoResize:true,
					minWidth:830,
					minHeight:620,            
                    position:["2%","2%"],    
                    //autoPosition: true, 
					onShow: function (dialog) {
                            // Access elements inside the dialog
                            // Useful for binding events, initializing other plugins, etc.

                            // For example:
                            /*$("a", dialog.data).click(function () {
                                    // do something
                                    alert('lalala');
                                    return false;
                            });*/
                            dialog.data.html('<iframe id="contenidos" frameborder="0" src="contenido-scorm/default.html" width="810" height="610" align="middle"></iframe>');
                    }
                }
                );

		return false;
	});
	$('#basic-modal4').click(function (e) {
		$('#basic-modal-content4').modal({//
                    //autoResize:true,
					minWidth:660,
					minHeight:500,
                    //position:["8%","22%"], 
                    autoPosition: true,  
					onShow: function (dialog) {
                            // Access elements inside the dialog
                            // Useful for binding events, initializing other plugins, etc.

                            // For example:
                            /*$("a", dialog.data).click(function () {
                                    // do something
                                    alert('lalala');
                                    return false;
                            });*/
                            dialog.data.html('<iframe src="http://www.agrupacionvertice.com/plataforma.html" height="480" width="640" scrolling="no" noresize="noresize" frameborder="0" style="border:0"></iframe>');
                    }
                }
                );

		return false;
	});
});
