function resize(){
    try{ 
         var body = document.body;
         if(body) {
            var height = body.scrollHeight + 100;
            var width = body.scrollWidth + 20;
            self.resizeTo(width,height);            
          }
        } 
        catch (error) {
            alert(error.message);
        }
}
function hideAllMessages(){
    errorMsg.style.display = "none";
    infoMsg.style.display = "none";
    warningMsg.style.display = "none";
    confMsg.style.display = "none";
    validationMsg.style.display = "none";
    if(errorMsgSrv!=null)
        errorMsgSrv.style.display = "none";
    if(infoMsgSrv!=null)
        infoMsgSrv.style.display = "none";
    if(warningMsgSrv!=null)
        warningMsgSrv.style.display = "none";
    if(confMsgSrv!=null)
        confMsgSrv.style.display = "none";
    if(validationMsgSrv!=null)
        validationMsgSrv.style.display = "none";    
    //window.scroll(0,0);
}
function showConfMsg(message){
    hideAllMessages();
    confMsg.style.display = "";
    confMsgBody.innerHTML = message;    
    resize();
}
function showErrorMsg(message){
    hideAllMessages();
    errorMsg.style.display = "";
    errorMsgBody.innerHTML = message;
    resize();
}    
function showInfoMsg(message){
    hideAllMessages();
    infoMsg.style.display = "";
    infoMsgBody.innerHTML = message;
    resize();
}
function showWarningMsg(message){    
    hideAllMessages();
    warningMsg.style.display = "";
    warningMsgBody.innerHTML = message;
    resize();
}
function showValidationMsg(message){    
    hideAllMessages();
    validationMsg.style.display = "";
    validationMsgBody.innerHTML = message;    
    resize();
}
