﻿function openModalDialog(sUrl, vArguments, iWidth, iHeight){
    var iVersion = GetIEVersion();
    switch(iVersion){
        case "5":
            iWidth += 0;
            iHeight += 0;
            break;
        case "6":
            iWidth += 10;
            iHeight += 30;
            break;
        default:
    }
    var sWidth = iWidth + "px";
    var sHeight = iHeight + "px";
    var sFeatures = "dialogWidth:" + sWidth + ";" + 
                            "dialogHeight:" + sHeight + ";" + 
                            "center:yes;" + 
                            "edge:raised;" + 
                            "resizable:yes;" + 
                            "scroll:no;" + 
                            "status:no;" + 
                            "unadorned:no";
    return window.showModalDialog(sUrl, vArguments, sFeatures);
}

function openModelessDialog(sUrl, vArguments, iWidth, iHeight){
    var iVersion = GetIEVersion();
    switch(iVersion){
        case "5":
            iWidth += 0;
            iHeight += 0;
            break;
        case "6":
            iWidth += 10;
            iHeight += 30;
            break;
        default:
    }
    var sWidth = iWidth + "px";
    var sHeight = iHeight + "px";
    var sFeatures = "dialogWidth:" + sWidth + ";" + 
                            "dialogHeight:" + sHeight + ";" + 
                            "center:yes;" + 
                            "edge:raised;" + 
                            "resizable:yes;" + 
                            "scroll:yes;" + 
                            "status:no;" + 
                            "unadorned:no";
    return window.showModelessDialog(sUrl, vArguments, sFeatures);
}

function showBigImg(sUrl, vArguments, iWidth, iHeight){
    var iVersion = GetIEVersion();
    switch(iVersion){
        case "5":
            iWidth += 0;
            iHeight += 0;
            break;
        case "6":
            iWidth += 10;
            iHeight += 30;
            break;
        default:
    }
    var sWidth = iWidth + "px";
    var sHeight = iHeight + "px";
    var sFeatures = "dialogWidth:" + sWidth + ";" + 
                            "dialogHeight:" + sHeight + ";" + 
                            "center:yes;" + 
                            "edge:raised;" + 
                            "resizable:yes;" + 
                            "scroll:yes;" + 
                            "status:no;" + 
                            "unadorned:no";
    return window.showModelessDialog(sUrl, vArguments, sFeatures);
}

function ShowIEScroll()
{    
    var iVersion = GetIEVersion();
   if (iVersion < 7) 
   {
       document.body.scroll = "yes";
   }
}

function GetIEVersion(){
    var strAgent = clientInformation.userAgent;
    //alert(strAgent);
    var strMsie = "MSIE";
    var iVersion = 0;
    if(strAgent.indexOf(strMsie) > 0){
        var nFindMsie = strAgent.search(strMsie);
        iVersion = strAgent.substring(nFindMsie+5,nFindMsie+6);
    }
    //alert(iVersion);
    return iVersion;
}
