	
	var ajax_val = new Array();

	function $(id) {
		return document.getElementById(id);
	}
	
	var submenu_status1;
	function showSubmenu1(type, action)
	{
		if(action == 'over')
		{
			submenu_status1 = 'block';
			$('submenu_' + type).style.display = 'block';
			$('submenu_' + type).style.zIndex = 102;
		}
		else
		{
			$('submenu_' + type).style.zIndex = 100;
			submenu_status1 = 'none';
			var submenu_name = 'submenu_' + type
			setTimeout("hide1('" + submenu_name + "')", 2000);
			
		}
	}
	
	function hide1(name)
	{
		$(name).style.display = submenu_status1;
	}
	
	
	var submenu_status2;
	function showSubmenu2(type, action)
	{
		if(action == 'over')
		{
			submenu_status2 = 'block';
			$('submenu_' + type).style.display = 'block';
			$('submenu_' + type).style.zIndex = 102;
		}
		else
		{
			$('submenu_' + type).style.zIndex = 100;
		
			submenu_status2 = 'none';
			var submenu_name = 'submenu_' + type
			setTimeout("hide2('" + submenu_name + "')", 2000);
			
		}
	}
	
	function hide2(name)
	{
		$(name).style.display = submenu_status2;
	}
	
	var submenu_status3;
	function showSubmenu3(type, action)
	{
		if(action == 'over')
		{
			submenu_status3 = 'block';
			$('submenu_' + type).style.display = 'block';
			$('submenu_' + type).style.zIndex = 102;
		}
		else
		{
			$('submenu_' + type).style.zIndex = 100;
			submenu_status3 = 'none';
			var submenu_name = 'submenu_' + type
			setTimeout("hide3('" + submenu_name + "')", 2000);
			
		}
	}
	
	function hide3(name)
	{
		$(name).style.display = submenu_status3;
	}
	
	



	function List()
	{
		var current_row_bgcolor;
		var current_row_id;
		
		this.over = function(obj)
		{
			current_row_bgcolor = obj.style.backgroundColor;
			current_row_id = obj.id;
			
			$(obj.id).style.backgroundColor = '#FF4E00';
		}
		
		this.out = function(obj)
		{
			$(current_row_id).style.backgroundColor = current_row_bgcolor;
		}
	}

	
	function Language()
	{
		this.switchLg = function(field_name, type, lg)
		{
			if(type == 'input')
			{
			
				for (var idx in supp_lg)
				{
					if( supp_lg[idx] == lg )
					{
						$('switch_lg_' + field_name + '_' + supp_lg[idx]).style.fontWeight = 'bold';
						$('switch_lg_' + field_name + '_' + supp_lg[idx]).style.textDecoration = 'underline overline';
						$(field_name + '_' + supp_lg[idx] + '_field_box').style.display = 'block';
					}
					else
					{
						$('switch_lg_' + field_name + '_' + supp_lg[idx]).style.fontWeight = 'normal';
						$('switch_lg_' + field_name + '_' + supp_lg[idx]).style.textDecoration = 'none';
						$(field_name + '_' + supp_lg[idx] + '_field_box').style.display = 'none';
					}
				}
				
			}
			else
			{
				var actual_lg = $(field_name + '_active').value;
				var oEditor = FCKeditorAPI.GetInstance(field_name);
				
				if( $('switch_lg_' + field_name + '_' + actual_lg) )
				{
					$('switch_lg_' + field_name + '_' + actual_lg).style.fontWeight = 'normal';
					$('switch_lg_' + field_name + '_' + actual_lg).style.textDecoration = 'none';
				}
				$(field_name + '_' + actual_lg).value = oEditor.GetHTML();

				if( $('switch_lg_' + field_name + '_' + lg) )
				{
					$('switch_lg_' + field_name + '_' + lg).style.fontWeight = 'bold';
					$('switch_lg_' + field_name + '_' + lg).style.textDecoration = 'underline overline';
				}
				oEditor.SetHTML( $(field_name + '_' + lg).value );
			}
			
			
			$(field_name + '_active').value = lg;
		}
	
	
		this.copyValToAllLg = function(field_name)
		{
			var lg = $(field_name + '_active').value;
			var val = $(field_name + '_' + lg).value;
			
			for (var idx in supp_lg)
			{
				$(field_name + '_' + supp_lg[idx]).value = val;
			}
		}
	}
	
	

  function setDelAddr() {
  	if($('same_inv_address').checked)
  		$('box_inv_addr').style.display = 'none';
  	else
  		$('box_inv_addr').style.display = 'block';
  }
	

	function formatNumber(n, c, d, t ) 
	{
		if(!c) c = 0;
		if(!d) d = ',';
		if(!t) t = '.';
		
		var m = ( c = Math.abs( c ) + 1 ? c : 2, d = d || ",", t = t || ".", /(\d+)(?:(\.\d+)|)/.exec( n + "" ) ), x = m[1].length % 3;
		return ( x ? m[1].substr( 0, x ) + t : "" ) + m[1].substr( x ).replace( /(\d{3})(?=\d)/g, "$1" + t ) + ( c ? d + ( +m[2] ).toFixed( c ).substr( 2 ) : "" );
	};

	
	function intoArray(string)
	{
		var res_string = new Array();
		
		var tmp_string = string.split(";");
		for(var i=0; i < tmp_string.length; i++) 
		{
			var arr_string = tmp_string[i].split("=");
			
			res_string[ arr_string[0] ] = arr_string[1];
		}
	
		return res_string;
	}


	function alertController(id) {

		if(id != 'alert_add_to_basket') $('alert_add_to_basket').style.display = 'none';
		if(id != 'alert_login') $('alert_login').style.display = 'none';
		if(id != 'alert_reg') $('alert_reg').style.display = 'none';
		if(id != 'alert_logout') $('alert_logout').style.display = 'none';
		if(id != 'alert_buy') $('alert_buy').style.display = 'none';
	}
	
	function closeAlert(id) {
		
		alertController(id);
	
		$(id).style.display = 'none';
	}
	
	function openAlert(id) {
	
		alertController(id);
	
		$(id).style.display = 'block';
	}



  function openPopup(link, name, width, height, resizable) 
  {
    if(!width)  width=400;
    if(!height) height=400;
    if(resizable!=0) resizable=1;

    win = window.open(link, name, 'toolbar=0,location=0,status=1,resizable='+ resizable +',scrollbars=1,width='+ width +',height='+ height +',top=100,left=180');
    win.focus();
    
    return win;
  }
  
	function hoverMenu(name, sufix) 
	{
		$(name).src = $('server_www').value+'img/'+name+'_'+sufix+'.gif';
	}
	

function getm(name,domain){
  location.href='mailto:' + name + '@' + domain;
}
	
	
