/*
* SimpleModal Confirm Modal Dialog
* http://www.ericmmartin.com/projects/simplemodal/
* http://code.google.com/p/simplemodal/
*
* Copyright (c) 2009 Eric Martin - http://ericmmartin.com
*
* Licensed under the MIT license:
*   http://www.opensource.org/licenses/mit-license.php
*
* Modified By Byzet for The Pros
* 
* Notes on additional functionality from the Eric Martin Site:
* [Callbacks] 
* Callbacks allow advanced customization of jqModal dialogs. Each callback is passed the "hash" object consisting of the following properties; 
* w: (jQuery object) The dialog element 
* c: (object) The config object (dialog's parameters) 
* o: (jQuery object) The overlay 
* t: (DOM object) The triggering element 
* onShow (callback) 
* Called when a dialog is to be shown. Be sure to show (set visible) the dialog. 
* // onShow : show+make the window translucent 
* var myOpen=function(hash){ hash.w.css('opacity',0.88).show(); }; 
* $('#dialog').jqm({onShow:myOpen}); 
* 
* 
* (function|false) - default: false
* 
* onHide (callback) 
* Called when a dialog is to be hidden. Be sure to remove the overlay (if enabled). 
* // onHide : fade the window out, remove overlay after fade. 
* var myClose=function(hash) { hash.w.fadeOut('2000',function(){ hash.o.remove(); }); }; 
* $('#dialog').jqm({onHide:myClose}); 
* 
* 
* (function|false) - default: false
* 
* onLoad (callback) 
* Called right after ajax content is loaded. 
* // onLoad : assign Mike Alsup's most excellent ajaxForm plugin to the returned form element(s). 
* var myLoad = function(hash){ $('form',hash.w).ajaxForm(); }; 
* $('#dialog').jqm({onLoad:myLoad}); 
* 
* 
* (function|false) - default: false
* 
* 
*
*/
/*
$().ready(function() {
// This function executes when the DOM doc is ready and loops through all jqmWindow classed elements and links the triggers
// NOTE you need to make sure that the a tag IDs correspond to the associate div.jqmWindow element IDs with a 'Link' appended.
var $jqmWindowCol = $('div').filter(".jqmWindow");
var jqmWindowColLength = $jqmWindowCol.length;
for (var i = 0; i < jqmWindowColLength; i++) {
    var element = $jqmWindowCol[i];
    $('#' + element.id).jqm({ ajax: '@href', trigger: '#' + element.id + 'Link' });
} 
});
*/

$().ready(function() {
    // This function executes when the DOM doc is ready and loops through all jqmWindow classed elements and links the triggers
    // NOTE you need to make sure that the a tag IDs correspond to the associate div.jqmWindow element IDs with a 'Link' appended.
    var $jqmWindowCol = $('div').filter(".jqmWindow");
    var jqmWindowColLength = $jqmWindowCol.length;
    for (var i = 0; i < jqmWindowColLength; i++) {
        var windowelement = $jqmWindowCol[i];
        var linkelements = $('a[id$=' + windowelement.id + 'Link]');
        //alert('a[id$=' + windowelement.id + 'Link]');
        //alert(linkelements[0].id);
        $('#' + windowelement.id).jqm({ ajax: '@href', trigger: '#' + linkelements[0].id });
    }
});
