	function new_wind(adrese, w, h)
	{
		width=screen.width;
		height=screen.height;
		l=(width-w)/2;
		t=(height-h)/2-50;
		window.open(adrese, "_blank", "toolbar=no, location=no, left="+l+", top="+t+", directories=no, status=yes, menubar=no, scrollbars=yes, resizable=0, fullscreen=no, width="+w+", height="+h);
	}

	function jumpScroll() 
	{
	   	window.scroll(0,150); // horizontal and vertical scroll targets
	}

	function confirmLink(theLink, theSqlQuery)
	{
		var is_confirmed = confirm(theSqlQuery);
		if (is_confirmed) 
			theLink.href += '&is_js_confirmed=1';
		return is_confirmed;
	}

	function confirml(text,l1,l2,l3,l4,l5)
	{
		var is_confirmed = confirm(text);
		if (is_confirmed) 
			StCh(l1,l2,l3,l4,l5);
		return is_confirmed;
	}

	function new_winda(adrese, w, h)
	{
		width=screen.width;
		height=screen.height;
		l=(width-w)/2;
		t=(height-h)/2-50;
		window.open(adrese, "_blank", "toolbar=ns, location=no, left="+l+", top="+t+", directories=no, status=yes, menubar=no, scrollbars=yes, resizable=1, fullscreen=no, width="+w+", height="+h);
//		window.open(adrese, "_blank", "toolbar=no, location=no, left=2, top=2, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=0, fullscreen=no, width="+w+", height="+h);
	}
	function change_visibility(elname) 
	{
		eval("eltest="+elname+".style.display");
		if (eltest == "none") 
		{
			eval(elname+".style.display = \"\"");
		}
		else
		{
			eval(elname+".style.display = \"none\"");
		}
	}

	function order()
	{
		if (document.orderform.user_name.value == "" || document.orderform.user_phone.value.length < 7)
		alert("<?=_ALERT;?>");
		else
			document.orderform.submit();
	}
	function ch_change( obj1, obj2 )
	{

		var elmm = document.getElementById(obj1).style.display;
		if(elmm=='none')
		{
			document.getElementById(obj1).style.display = "block";
			if(obj1!=obj2)
				document.getElementById(obj2).style.display = "none";
		}
		else
		{
			document.getElementById(obj1).style.display = "none";
			if(obj1!=obj2)
				document.getElementById(obj2).style.display = "block";
		}
	}


function StCh(fform,fstr,felement,floading,fclear)
{
	var ajax = new zjx();
	if(floading)
		ajax.Loading = true;
	else
	{
		ajax.otherClass = 'minip';
		ajax.otherId = 'lodch';
	}
	ajax.rFile = 'st_ref.php';
	ajax.method = 'POST';
	if(fform)
	{
		var form, elements, i, elm;
		form = document.getElementById ? document.getElementById(fform) : document.forms[fform];
		if (document.getElementsByTagName)
		{
			elements = form.getElementsByTagName("input");
			for(i=0,elm;elm=elements.item(i++);)
			{
				if(elm.getAttribute('type') == "text" || elm.getAttribute('type') == "file" || elm.getAttribute('type') == "password")
				{
//					alert(elm.getAttribute('name')+"="+elm.value);
						ajax.setVar(elm.getAttribute('name'),elm.value);
					if(fclear)
						elm.value='';
				}
				else if(elm.getAttribute('type')=="hidden")
					ajax.setVar(elm.getAttribute('name'),ajax.encodeVAR(elm.getAttribute('value')));
				else if(elm.getAttribute('type')=="checkbox" || elm.getAttribute('type')=="radio")
					if(elm.checked)
						ajax.setVar(elm.getAttribute('name'),ajax.encodeVAR(elm.getAttribute('value')));
			}   
			elm = '';
			elements = form.getElementsByTagName('textarea');
			for(i=0,elm;elm=elements.item(i++);)
			{
				if(elm.getAttribute('value'))
					ajax.setVar(elm.getAttribute('name'),elm.getAttribute('value'));
				else
					ajax.setVar(elm.getAttribute('name'),elm.value);
				if(fclear)
					elm.value='';
			}   
			elements = form.getElementsByTagName('select');
			elm = '';
			for(i=0,elm;elm=elements.item(i++);)
			{
				ajax.setVar(elm.getAttribute('name'),elm.options[elm.selectedIndex].value);
			}   
		}   
		else   
		{     
			elms = form.elements;     
			for(i=0,elm;elm=elms[i++];)     
			{       
				if (elm.type=="text" || elm.type=="file" || elm.TagName=="textarea" || elm.type=="password")
				{
					ajax.setVar(elm.name,elm.value);
					if(fclear)
						elm.value='';
				}
				else if(elm.type=="hidden")
					ajax.setVar(elm.name,ajax.encodeVAR( elm.value ));
				else if(elm.type=="checkbox" || elm.type=="radio")
					if(elm.checked)
						ajax.setVar(elm.name,ajax.encodeVAR( elm.value ));
				else if(elm.type=="select")
					ajax.setVar(elm.name,elm.options[elm.selectedIndex].value);
			}   
		} 
	}
	if(fstr)
	{
		var elm;
		fvar = fstr.split("&");
		for(i=0,elm;elm=fvar[i++];)
		{
		 	elm = elm.split("=");
			if(elm[1])
				ajax.setVar(elm[0],ajax.encodeVAR( elm[1] ));
		}
	}
	if(felement==1)
		ajax.element = 'result-center';
	else if(felement)
		ajax.element = felement;
	ajax.runZJX();
	return false;
}
