var VH_ExtForms = {
	
	Init: function()
	{
		// initialization lists
		this._InitUL();
	},
	
	
	_InitUL: function()
	{
		var uls = document.getElementsByTagName('ul');
		for ( var i=0; i < uls.length; i++ )
		{
			
		}
	},
	
	
	FIE: function(){}
};


var VH_Global = {
	
	ShowLangs: function(id)
	{
		var layer = document.getElementById(id);
		layer.className = layer.className == 'showed' ? 'hided' : 'showed';
		VH_Control._control_dd = id;
	},
	
	
	ShowLayer: function(id)
	{
		var layer = document.getElementById(id);
		layer.style.display = layer.style.display == 'none' ? 'block' : 'none';
		VH_Control._control_layer = id;
	},
	
	
	ShowLayerId: function(id)
	{
		document.getElementById(id).style.display='block';
	},
	
	
	HideLayerId: function(id)
	{
		document.getElementById(id).style.display='none';
	},
	
	FIE: function(){}
};


/******************
 * © Visual Hotels
 * @author: Fedorov Artem
 * @description: объект по управлению формами, слоаями и прочими фиговинами на сайте
 *
 */
var VH_Control = {
	
	/**
	 * @description: активные слои
	 */
	_ActiveLayers: 0,
	
	
	_to_control_dd: true,
	_control_dd: '',
	
	_to_control_layer: true,
	_control_layer: '',
	
	
	/**
	 * init drop down
	 */
	_InitDropDown: function(dds)
	{
		var dd = document.getElementById(dds);
		var divs = dd.getElementsByTagName('div');
		for ( var i = 0; i < divs.length; i++ )
		{
			if ( divs[i].className == 'drop-icon' )
			{
				divs[i].onmouseover = function(){VH_Control._to_control_dd = false;}
				divs[i].onmouseout = function()	{VH_Control._to_control_dd = true; }
			}
		}
	},
	
	
	/**
	 * to hide drop down
	 */
	_HideDropDown: function(dds_ul)
	{
		var layer = document.getElementById(dds_ul);
		layer.className = 'hided';
	},
	
	
	/**
	 * to init layers
	 */
	_InitLayers: function(layers)
	{
		var _layers = document.getElementById(layers);
		_layers.onmouseover = function(){VH_Control._to_control_layer = false;}
		_layers.onmouseout = function()	{VH_Control._to_control_layer = true; }
	},
	
	
	/**
	 * to hide layer
	 */
	_HideLayer: function(layer_id)
	{
		//alert(layer_id);
		var layer = document.getElementById(layer_id);
		layer.style.display = 'none';
	},
	
	
	/**
	 * @description: initialization
	 */
	Init: function(dds, layers)
	{
		/*this._InitDropDown(dds);
		this._InitLayers(layers);
		
		VH_ExtForms.Init();
		document.onclick = function()
		{
			// to control drop down
			if ( (VH_Control._control_dd != '') && VH_Control._to_control_dd )
			{
				VH_Control._HideDropDown(VH_Control._control_dd);
			}
			
			// to control layers
			if ( (VH_Control._control_layer != '') && VH_Control._to_control_layer )
			{
				//alert('asd');
				VH_Control._HideLayer(VH_Control._control_layer);
			}
		}*/
	},
	
	FIE: function(){}
};