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(mail)
{
      
      
      if(mail=="")
      {
         alert("Please, fill in valid e-mail address.");
	 return false;
      }
      
      if(mail.indexOf("@")<2||mail.indexOf(".")<1)
      {
         alert("Please, fill in valid e-mail address.");
	 return false;
      }

      return true;
}

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=10,height=10, scrollbars=yes");
   newWin.moveTo(x,y);
   newWin.resizeTo(width,height);
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


function centerElt(eid,w,h)
{  
    var scrolls= getScrollXY();  

    elt=document.getElementById(eid);        
    var centerY= Math.floor(Math.round(screen.height/2));
    var centerX= Math.floor(Math.round(screen.width/2));
   
   centerY+=scrolls[1];
   
    elt.style.top=(centerY-Math.floor(Math.round(h/2))-100)+"px";
    elt.style.left=(centerX-Math.floor(Math.round(w/2)))+"px";      
   
   elt.style.zIndex=2;
    elt.style.display='block';   
}