﻿// JScript File

function RGB2HTML(red, green, blue)
{
    var decColor = red + 256 * green + 65536 * blue;
    return decColor.toString(16);
}

function strRgb2Html(sRgb)
{
    try{
        var s=new String("");
        s=sRgb;
        s=s.replace("rgb(","");
        s=s.replace(")","");
        var arr=new Array();
        arr=s.split(",");
        var red=parseInt(arr[0]);
        var green=parseInt(arr[1]);
        var blue=parseInt(arr[2]);
        sResult=new String("");
        sResult=RGB2HTML(red,green,blue);
        return sResult.toLocaleUpperCase();
    }catch(e){
        return "";
    }
}

function doViewLargeImage(sSrc)
{
    var oWin=openNewWindow("","",520,520,false,true);
    oWin.document.open(); 
    oWin.document.write('<html>');
    oWin.document.write('<title>PREVIEW</title>');
    oWin.document.write('<body style="margin:0px;overflow:hidden;">');
    oWin.document.write('<table style="width:100%;height:100%;">');
    oWin.document.write('   <tr>');
    oWin.document.write('       <td valign="middle" align="center">');
    oWin.document.write('           <img src="'+sSrc+'&w=500&h=500" onclick="window.close();" style="cursor:pointer;">');
    oWin.document.write('       </td>');
    oWin.document.write('   </tr>');
    oWin.document.write('</table>');
    oWin.document.write('</body>');
    oWin.document.write('</html>');
    oWin.document.close();
    oWin.focus();
}