/*
 *
 * Copyright (c) 2008 George Bonnes (george@olm1.com)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Version 1.0.1
 *
 * $LastChangedDate$
 * $Rev$
 *
 */




$(document).ready(function() {
    // initialize our loading div to listen for $.ajax broadcasts
    $("#loading").bind("ajaxSend", function(){
        $("#loading").centerElement()
                     .vCenterElement()
                     .jqmShow();
     }).bind("ajaxComplete", function(){
         if (ajax_error == 0) {
            $("#loading").jqmHide();
         }
     });            
     
     $("#loading").jqm({overlay: 30, trigger: false});
     
     $('.hide_on_load').css('display', 'none');
     $('.show_on_load').css('display', 'block');

    $('.header_photos').cycle({ 
         fx: 'fade', 
         speed: 1300,
         pause: 1,
         random: 0
         });
     
     

    return false;
    
});  // end $(document).ready()


function load_fullsize_result_photos(photo_id) {
	ajax_update('result_fullsize_photo_container', '/photos/id/' + photo_id);
	return false;
}

function result_fullsize_photo_attach_jqm() {

    $("#result_fullsize_photo_container").jqm({overlay: 50, trigger: false, toTop: true, zIndex: 50001, 
        onHide: function(hash) { $('#result_fullsize_photo_container').css('display', 'none'); hash.o.remove(); hash.w.hide(); }});

    //$("#result_fullsize_photo_container").jqm({overlay: 50, trigger: false});

    $("#result_fullsize_photo_container").centerElement()
                                         .vCenterElement();
    $("#result_fullsize_photo_container").jqmShow();	
	
}

function result_fullsize_photo_close() {
	$("#result_fullsize_photo_container").jqmHide();
}