function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}



function Toggle(item) {
   obj=document.getElementById(item);
   visible=(obj.style.display!="none")
   if (visible) {
     obj.style.display="none";
   } else {
      obj.style.display="block";
   }
}

function SearchInfo() {   objbox=document.getElementById('searchbox');
   objbox.style.background="#ff5442";
   obj=document.getElementById('searchsourceblock');
   obj.innerHTML='Èñêàòü&nbsp;â&nbsp;<b>Ñïðàâêå</b>&nbsp;èëè&nbsp;â&nbsp;<a id="search_yandex" style="text-decoration: underline;" href="javascript:SearchYandex()">ßíäåêñå</a>';
   objform=document.getElementById('searchform');
   objform.action='/address/search/';
   objform.target='_self';
   objlabel=document.getElementById('searchlabel');
   objlabel.innerHTML='<a href="/address/" ><img src="/pic/info_search70_45_02.png" alt="Ñïðàâêà" style="border:none;" align="left" hspace="0" vspace="0" border="0" /></a>';

}

function SearchYandex() {
   objbox=document.getElementById('searchbox');
   objbox.style.background="#f4db4a";
   obj=document.getElementById('searchsourceblock');
   obj.innerHTML='Èñêàòü&nbsp;â&nbsp;<a id="search_yandex" style="text-decoration: underline;" href="javascript:SearchInfo()">Ñïðàâêå</a>&nbsp;èëè&nbsp;â&nbsp;<b>ßíäåêñå</b>';
   objform=document.getElementById('searchform');
   objform.action='http://yandex.ru/sitesearch';
   objform.target='_blanc';
   objlabel=document.getElementById('searchlabel');
   objlabel.innerHTML='<a href="http://yandex.ru/" target="_blanc" ><img src="/pic/yandex_logo70_45.png" alt="ßndex" style="border:none;" align="left" hspace="0" vspace="0" border="0" /></a>';

}


function hashLoginPassword01042009(doForm, cur_session_id)
{

	// Compatibility.
	if (cur_session_id == null)
		cur_session_id = smf_session_id;

	if (typeof(hex_sha1) == "undefined")
		return;
	// Are they using an email address?
	if (doForm.login.value.indexOf("@") != -1)
		return;

	// Unless the browser is Opera, the password will not save properly.
	if (typeof(window.opera) == "undefined")
		doForm.password.autocomplete = "off";

	doForm.hash_passwrd.value = hex_sha1(hex_sha1(doForm.login.value.php_to8bit().php_strtolower() + doForm.password.value.php_to8bit()) + cur_session_id);

	// It looks nicer to fill it with asterisks, but Firefox will try to save that.
	//if (navigator.userAgent.indexOf("Firefox/") != -1)
	//	doForm.password.value = "";
	//else
		doForm.password.value = doForm.password.value.replace(/./g, "*");

}

function OnCheckEnabled(CheckName,BlockName) {
   chk=document.getElementById(CheckName);
   obj=document.getElementById(BlockName);
   if(chk.checked)
   {   	 obj.style.display="block";
   }else
   {   	 obj.style.display="none";
   }

}
