

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



	function on_Load()	{$('terme').focus();}
	function on_Click()	{$('selectBox').style.display = "none";}



	var intCurrentSize = 100;


	function SetTextSize (id)
		{
		var o = $(id);

		if (o)
			{
			o.style.fontSize = intCurrentSize+'%';
			}
		}


	function DoTextResize()
		{
		if (intCurrentSize<10)
			{
			intCurrentSize=10;
			}

		SetTextSize('container');

		$('text_size_img').src = "_inc/store_text_size.php?size="+intCurrentSize;
		}


	function IncreaseTextSize()  {intCurrentSize+=10; DoTextResize();}
	function DecreaseTextSize()  {intCurrentSize-=10; DoTextResize();}




	function set_favorite()
		{
		window.external.AddFavorite (iFavorite_Link, iFavorite_Title);
		return false;
		}





	function fold(id)
		{
		var o = $(id);

		o.style.display = (o.style.display!='block')?'block':'none';
		}




	var iItem = 0;
	var iKeys = "0123456789abcdefghijklmnopqrstuvwxyz -'"
			  + String.fromCharCode( 46)		// NumPad "Delete"
			  + String.fromCharCode(109)		// NumPad "-"
			  + String.fromCharCode(  8);		// BackSpace


	function onKDown(e)
		{
		iWord = $("terme").value;

		if (iWord.length < 2)
			return;


		var evt  = window.event?event:e;
		var iKey = evt.keyCode?evt.keyCode:evt.charCode;
//		alert(iKey);


		if (iKey==40)			//	down
			{
//			alert(iItem + "/" + iItemMax);

			if (iItem < iItemMax)
				{
				if (iItem >= 1)  { $('c'+iItem).className = "a_normal";}
				iItem++;		   $('c'+iItem).className = "a_hover" ;
				}

//			$('selectBox').scroll(1,10*iItem);
			$('selectBox').style.display = "block";
			}

		if (iKey==38)			//	up
			{
//			alert(iItem + "/" + iItemMax);

			if (iItem > 1)
				{
				if (iItem <= iItemMax)	{ $('c'+iItem).className = "a_normal";}
				iItem--;				  $('c'+iItem).className = "a_hover" ;
				}

			$('selectBox').style.display = "block";
			}
		}





	function onKUp(e)
		{
		iWord = $("terme").value;

		if (iWord.length < 2)
			{
			$('selectBox').style.display = "none";
			return;
			}

		var evt  = window.event?event:e;
		var iKey = evt.keyCode?evt.keyCode:evt.charCode;
		var sKey = String.fromCharCode(iKey).toLowerCase ();

		if (iKeys.indexOf(sKey)!=-1)
			{
			$("rs_Word").value = iWord;
			document.forms["rs_form"].submit();
			}
		}

/*
	function onKey(e)
		{
		return;//////////////
		var evt  = window.event?event:e;
		var iKey = evt.keyCode?evt.keyCode:evt.charCode;

		if (evt.keyCode)
			{
			try
				{if (iKey==13)	evt.keyCode=0;}
			catch(ex) {}
			}

		if (iKey==13)  {document.f.submit();}
		}
*/





