/*
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
code language:		javascript 1.8
folder name:            files/dclib_5.05/dcjs_5.0
class name:             dcjs_events
class type:             static
version:                1.0
date:                   20120108
copyright:              massimo cardascia
url:                    www.plustic.de / www.dot-control.com
code style:		whitesmiths style variant - 8 spaces tab - http://en.wikipedia.org/wiki/indent_style
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
*/

///*	class definition /////////////////////////////////////////////////////////////////////////////////////
function DCJS_events(){this.f_construct();}

///*    class versioning /////////////////////////////////////////////////////////////////////////////////////
	DCJS_events.__s_classVersion = '5.00';			///h : dclib intern class version
	DCJS_events.__s_className = 'DCJS_events';		///h : dclib intern class name
	DCJS_events.__s_classType = 'class';			///h : dclib intern class type

///*    class properties /////////////////////////////////////////////////////////////////////////////////////
	DCJS_events.__b_window_load_complete = false;		///h : stores window load complete status

///*    class system init ////////////////////////////////////////////////////////////////////////////////////
	DCJS_events.f_initSystem = function()
		{
		///h : window loading status
		jQuery(window).bind('load', {}, function(){DCJS_events.__b_window_load_complete = true;});
		}

///*    class constructor ////////////////////////////////////////////////////////////////////////////////////
	DCJS_events.prototype.f_construct = function()
		{
		}

///*    public static functions //////////////////////////////////////////////////////////////////////////////

///*    ------------------------------------------------------------------------------------------------------
	/**
	 * bind event to an objet
	 * binding an event to an object using the jquery event model. additionally events are dispatched
	 * directly if the event was dispatched before. this makes sense if loading events are completed.
	 *
	 * @access public
	 * @param object $o_base
	 * @param string $s_event
	 * @param object $o_data
	 * @param object $o_function
	 * @return void
	 *
	 */
	DCJS_events.f_bind = function($o_base, $s_event, $o_data, $o_function)
		{
		///h : bind
		jQuery($o_base).bind($s_event, $o_data, $o_function);
		jQuery($o_base).bind($s_event + '_intern', $o_data, $o_function);

		///h : special case
		if(DCJS_events.__b_window_load_complete == true)
			{
			///h : window load event : delayed
			if(($o_base[0] == window) && ($s_event == 'load'))
				{
				jQuery($o_base).trigger('load_intern');
				}
			}
		}

///*    public functions /////////////////////////////////////////////////////////////////////////////////////

///*    pivate static functions //////////////////////////////////////////////////////////////////////////////

///*    private functions ////////////////////////////////////////////////////////////////////////////////////

///*    init class ///////////////////////////////////////////////////////////////////////////////////////////
jQuery(document).bind('ready', {}, function(){DCJS_events.f_initSystem();});

/*
--------------------------------------------------------------------------------------------------------------
description:
--------------------------------------------------------------------------------------------------------------
dcjs_events is the part of the dclib js framework.
the class provides additional event handling and is based on the jquery event model.
--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------
events:
--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------
getter properties:
--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------
usage:
--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
*/
