function checkPasses(one,two)
{
   var pass=document.getElementById(one).value;
   var pass2=document.getElementById(two).value;

   if(pass!=pass2)
   {
    alert ("Passwords dont match!");
   }
}

function checkMail(email,frm)
{
      var mail=document.getElementById(email).value;
      
      if(mail=="")
      {
         alert("Please, fill in valid e-mail address.");
	 return false;
      }
      
      if(mail.indexOf("@")<2||mail.indexOf(".")<5)
      {
         alert("Please, fill in valid e-mail address.");
	 return false;
      }

      document.getElementById(frm).submit();
}

function confirmAction(frm)
{
   if(confirm("Are you sure?"))
   {
      frm.submit();
   }
   return true;
}

function centerWin(filename,width,height,name)
{
   var x=(screen.availWidth-width)/2;
   var y=(screen.availHeight-height)/2-50;

   if(name="") name='win'

   newWin=window.open(filename, name,"width="+width+",height="+height+", resizable=yes,scrollbars=yes,toolbar=no,status=yes");
   try
   {
   	  newWin.moveTo(x,y); 
   }
   catch(e)
   {
	   noError=false;
   }
   if (noError) 
   { 
	   newWin.resizeTo(width,height);
   }
  
}


