function chm(value)
{
	if(value!='1')
	{
		document.getElementById('tr_en').className = 'deactive';
		document.getElementById('en_tr').className = 'active';
	}
	else
	{
		document.getElementById('en_tr').className = 'deactive';
		document.getElementById('tr_en').className = 'active';
	}
	document.getElementById('search_type').value = value;
}

function addchar(field,char)
{
	if (document.selection)
	{
		var lenght;
		field.focus();
		sel=document.selection.createRange();
		lenght=sel.text.lenght;
		sel.text=char;
		if(char.length==0)
		{
			sel.moveStart('character',char.length);
			sel.moveEnd('character',char.length);
		}
		else
		{
			sel.moveStart('character',-char.length+lenght);
		}
		sel.select();
	}
	else if(field.selectionStart||field.selectionStart=='0')
	{
		var start=field.selectionStart;
		var end=field.selectionEnd;
		field.value=field.value.substring(0,start)+char+field.value.substring(end,field.value.length);
		field.selectionStart=start+char.length;
		field.selectionEnd=start+char.length;
		field.focus();
	}
	else
	{
		field.value+=char;
	}
}