﻿function Enter(e,btn) {
    if(window.event){ 
        characterCode = window.event.keyCode; //character code is contained in IE's keyCode property
    }else{
        characterCode = e.which; //character code is contained in NN4's which property
    }
    if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
        //Search();//submit the form
        eval(document.getElementById(btn).href);
        return false 
    }else{
    return true 
    }
}

   function Validate(myType,myControlId,myMessage,myErrorId){

var myControlValue=document.getElementById(myControlId)
var myValue=myControlValue.value
Validation.ValidateValue(myType,myControlId,myValue,myMessage,myErrorId,OnValidateSucces,OnFailed)
}
function OnValidateSucces(result){
var myError=document.getElementById(result[2])
myError.className ="visible"
myError.alt=result[1]
myError.title=result[1]
myError.name=result[1]
if (result[1]!="ok"){
myError.src="images/fout.gif"
myError.onclick=function (){alert(result[1])}
}else{
myError.src="images/ok.gif"
myError.onclick=""
}

}
function OnFailed(error) {
   // Alert user to the error.
   if(error._statusCode>0){
    alert(error.get_message());
      CursorNormal();
   }
}

function ScrollToBottom() {
    window.scrollBy(0, document.body.clientHeight);
}