﻿
function keyCheck(e,from) {
    var key;
     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox


    if (key == 13)
    {
     
        return false;
   //  document.form2.submit();
    }

}

function getScreenWidth() {

    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    return myWidth;
}
function getPositionY() {
    var top = document.body.scrollTop
          || window.pageYOffset 
          || (document.body.parentElement
              ? document.body.parentElement.scrollTop
              : 0
              );
    return top;
}
var scrolldelay=null;
function scrollDown() {
    
    distance = myScreenPosY;
    duration = 26;
    perStep = parseFloat(distance/duration);

    if (getPositionY() >=myScreenPosY) {
    
        clearTimeout(scrolldelay);
        return;
    }
   
    window.scrollBy(0,perStep); // horizontal and vertical scroll increments
	scrolldelay = setTimeout('scrollDown()',duration)
}
