//����� ������
function logout()
{
		var url = 'auth.inc.php';
    var div='login_div';
    //$(div).innerHTML = "<center><img src='./images/loading.gif' align=absmiddle> ���� �������� ������, ��������� �������...</center>";
		var pars = 'mode=logout';
		var myAjax = new Ajax.Request(
					url,
					{method: 'post', parameters: pars, onComplete: showResponse}
					);

    function showResponse(originalRequest)
    {
		  //put returned XML in the textarea
		  $(div).innerHTML = originalRequest.responseText;
      //alert(originalRequest.responseText);
    }
}
//����� �����
//����������� ������
function auth(login,pass)
{
		var url = 'auth.inc.php';
    var div='login_div';
    //$(div).innerHTML = "<center><img src='./images/loading.gif' align=absmiddle> ���� �������� ������, ��������� �������...</center>";
		var pars = 'login=' + login + '&pass='+pass+'&mode=check_login';
		var myAjax = new Ajax.Request(
					url,
					{method: 'post', parameters: pars, onComplete: showResponse}
					);

    function showResponse(originalRequest)
    {
		  //put returned XML in the textarea
		  $(div).innerHTML = originalRequest.responseText;
      //alert(originalRequest.responseText);
    }
}
//����������� �����


function subscribe(mail)
{
  new Ajax.Request('./subscribe.php',
  {
    method: 'get',
    parameters: {email: mail},
    onComplete: finish_request,
    div: 'subscribe'
  });
}

function finish_request(request)
{
	alert(request.responseText);
}

function plus_minus(imgid,host)
{
  host = 'http://' + 'kvminfo.ru';//location.hostname;
  minus	= host+'/images/minus2.jpg';
  plus	= host+'/images/plus2.jpg';
  if(document.getElementById(imgid).src==minus)document.getElementById(imgid).src=plus; else document.getElementById(imgid).src=minus;
}
function selectStatus() {
if (document.registration.status.value == '1') menu2.style.display = "none";
if (document.registration.status.value == '2') menu2.style.display = "";
}

function show_hide(elmnt)
{
 document.getElementById(elmnt).style.display=(document.getElementById(elmnt).style.display != 'block' ? 'block' : 'none');
}

function showLogin(){
 document.getElementById('login').style.display=(document.getElementById('login').style.display != 'block' ? 'block' : 'none');
}

function showdate()
{
  today=new Date();// Build an array initializer
  function isnArray()
  {
    argnr=isnArray.arguments.length
    for (var i=0;i<argnr;i++)
    {
      this[i+1] = isnArray.arguments[i];
    }
  }
  // And months and day arrays
  var isnMonths=new   isnArray("������","�������","�����","������","���","����","����","�������","��������","�������","������","�������");
  var thisyear = today.getFullYear(); // varies in JavaScript and JScript

  var isnDays=new   isnArray("�����������","�����������","�������","�����","�������","�������","�������");
  var thisday = today.getDay(); // varies in JavaScript and JScript

  document.write(" "+isnDays[today.getDay()+1]+",  "+today.getDate()+" "+isnMonths[today.getMonth()+1]+"  "+thisyear+" �.")
}

function ChangeImg() {
 if(document.images) {
  eval("document."+ChangeImg.arguments[0]+
  ".src=('"+ChangeImg.arguments[1]+"')");
 }
}

function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible"
}
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility="hidden"
}

v=0;

function ShowMap(path,w,h)
{
	if (v!=0) v.close();
	h+=30;
	v=window.open ('', 'view', 'scrolling=no,height='+h+',width='+w);
	with (v.document)
	{
	    open ();
	       write('<html><head><title>����� �������</title></head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 ><table cellspacing="0" cellpadding="0" border="0"><tr><td align><img src="'+path+'" border=0></td></tr><tr><td align="center" valign="middle" height="30"><a href="javascript:;" onClick="window.close()">[ ������� ���� ]</a></td></tr></table></body></html>');
	    close ();
	}
	return false;
}

v=0;
function ShowPhoto(path,w,h,name)
{
  if (v!=0) v.close();
  //h=130;
  v=window.open ('', 'view', 'scrolling=no,height='+h+',width='+w);
  with (v.document)
{
 open ();
  write('<html><head><title>'+name+'</title></head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 bgcolor="white"><table cellspacing="0" cellpadding="0" border="0"><tr><td align><img src="'+path+'"     border=0></td></tr></table></body></html>');
  close ();
}
	return false;
}








