<!--
hs.graphicsDir = 'images/graphics/';
hs.outlineType = 'rounded-white';
hs.restoreTitle = 'Щракнете за да затворите прозореца.';
hs.loadingText = 'Зареждане...';


function $(elem)
{
	return document.getElementById(elem);
}

function SwapStyle(the_id,the_type,the_state)
{
	if(the_state==1)
	{
		$('menu'+the_id).className = 'menu_'+the_type+'_act';
	}
	else
	{
		$('menu'+the_id).className = 'menu_'+the_type;
	}
}

function chkAlpha(obj)
{
	reg = /[^0-9]/g;
	obj.value = obj.value.replace(reg,"");
}

function ShowHideSearch()
{
	if($('srch_row').style.display=='none')
	{
		$('srch_row').style.display = '';
	}
	else
	{
		$('srch_row').style.display = 'none';
	}
}

function ajaxSend(ajaxMethod, ajaxUrl, ajaxDiv, ajaxOutput, ajaxParams)
{
	function ajaxObject()
	{
		var obj = null;
		
		if(window.XMLHttpRequest)
		{
			obj = new XMLHttpRequest();	
		}
		else if(window.ActiveXObject)
		{
			try
			{
				obj = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
			
			}
		}
		return obj;
	}

	var ajaxHttp = ajaxObject();
	
	if(ajaxHttp==null)
	{
		alert('Your browser does not support AJAX!');	
	}

	ajaxHttp.open(ajaxMethod, ajaxUrl, true);
	
	ajaxHttp.onreadystatechange = function()
	{
		// 4: complete - the request is complete and the resultant data is safe to use
		if(ajaxHttp.readyState == 4)
		{
			try
			{
				var ajaxResponse = ajaxHttp.responseText;
				if (ajaxOutput == "innerHTML")
				{
					document.getElementById(ajaxDiv).innerHTML = ajaxResponse;
				}
				else if (ajaxOutput == "value")
				{
					document.getElementById(ajaxDiv).value = ajaxResponse;
				}
			}
			catch(e)
			{
				alert(e);	
			}
		}
	}
	if(ajaxMethod=='GET')
	{
		ajaxHttp.send(null);
	}
	else if(ajaxMethod=='POST')
	{
		ajaxHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ajaxHttp.setRequestHeader("Content-length", ajaxParams.length);
		ajaxHttp.setRequestHeader("Connection", "close");

		ajaxHttp.send(ajaxParams);
	}
}

function LoadSelectBox(fld_id,filter_value,select_value,dest_id)
{
	var str_params = 'field='+fld_id+'&filter='+filter_value+'&select='+select_value+'&sid='+Math.floor(Math.random()*1000000);
	ajaxSend('POST','modules/catalogue/ajax_price_select.php',dest_id,'innerHTML',str_params);
}
-->