/*
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
code language:		javascript 1.8
folder name:            files/dclib_5.05/dcjs_5.0
class name:             dcjs_html
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_html(){this.f_construct();}

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

///*    class properties /////////////////////////////////////////////////////////////////////////////////////
	DCJS_html.__i_uid = 0;					///h : stores unique id index

///*    class system init ////////////////////////////////////////////////////////////////////////////////////
	DCJS_html.f_initSystem = function()
		{
		}

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

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

///*	------------------------------------------------------------------------------------------------------
	/**
	 * get unique id
	 * getting a unique id which consists of a unique index which is counted up each time function is
	 * called and a date string encoded as base 32.
	 *
	 * @access public static
	 * @param string $s_prefix
	 * @return string
	 *
	*/
	DCJS_html.f_getUniqueID = function($s_pefix)
		{
		return('uid_' + (DCJS_html.__i_uid++).toString(32) + String(new Date().getTime()).substr(6));
		}

///*	------------------------------------------------------------------------------------------------------
	/**
	 * get scrollbar width
	 * getting the width of the browser scrollbar.
	 *
	 * @access public static
	 * @return string
	 *
	*/
	DCJS_html.f_getScrollbarWidth = function()
		{
		///h : properties
		var $jqo_div = null;		///h : stores temp div
		var $i_width_0 = -1;		///h : stores temp width
		var $i_width_1 = -1;		///h : stores temp width

		///h _ append and remove div
		$jqo_div = jQuery('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div>');
		jQuery('body').append($jqo_div);
		$i_width_0 = $('div', $jqo_div).innerWidth();
		$jqo_div.css('overflow-y', 'scroll');
		$i_width_1 = $('div', $jqo_div).innerWidth();
		jQuery($jqo_div).remove();

		///h : return scrollbar width
		return ($i_width_0 - $i_width_1);
		}

///*	------------------------------------------------------------------------------------------------------
	/**
	 * get class var
	 * returns a var value stored in the dom class attribute. helpfull because attributes can directly
	 * associated with dom objects.
	 *
	 * @access public static
	 * @param jquery_object $jqo_base
	 * @param string $s_var_name
	 * @return string
	 *
	*/
	DCJS_html.f_getClassVar = function($jqo_base, $s_var_name)
		{
		///h : properties
		var $s_class = null;		///h : stores class attribute string
		var $s_var_value = null;	///h : strores var value
		var $i_index = -1;		///h : stores index

		///h : get relevant class attribute
		try
			{
			$s_class = $jqo_base.attr('class');
			}
		catch($o_error)
			{
			}
		if($s_class == null)
			{
			return null;
			}
		
		///h : check if var name existing in class string
		$i_index = $s_class.indexOf($s_var_name);
		if($i_index > -1)
			{
			///h : getting var value
			$s_var_value = $s_class.substr($i_index + $s_var_name.length + 1);
			if($s_var_value.indexOf(' ') > -1)
				{
				$s_var_value = ($s_var_value.substr(0, $s_var_value.indexOf(' ')));
				}
			}

		///h : return var value
		return($s_var_value);
		}

///*	------------------------------------------------------------------------------------------------------
	/**
	 * get meta data
	 * get a meta data tag content by its title.
	 *
	 * @access public static
	 * @param string $s_title
	 * @return string
	 *
	*/
	DCJS_html.f_getMetaData = function($s_title)
		{
		///h : get title
		$s_title = $s_title.replace(':', '\\:');
		return(jQuery('meta[name=' + $s_title + ']').attr('content'));
		}

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

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

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

///*    init class ///////////////////////////////////////////////////////////////////////////////////////////

/*
--------------------------------------------------------------------------------------------------------------
description:
--------------------------------------------------------------------------------------------------------------
dcjs_html is the part of the dclib js framework
it contains some helpfull functions when dealing with html constructs.
--------------------------------------------------------------------------------------------------------------

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

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

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