// JavaScript Document
var Obj;
var strBackgroundColor;

function changeOpac(opacity, id) {
var object = document.getElementById(id).style; 
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
object.filter = "alpha(opacity=" + opacity + ")";
}

function ShowUpdateWin(BodyId,TableId,WinId){ 
ObjBody=document.getElementById(BodyId);
ObjWin=document.getElementById(WinId); 
//ObjInnerWin=ObjWin.document.getElementById("innerTable");
//ObjInnerTD=ObjWin.document.getElementById("innerTD");
ObjInnerWin=document.getElementById("innerTable");
ObjInnerTD=document.getElementById("innerTD");
//ObjInnerTD.style.height=ObjBody.document.body.scrollTop+100;
ObjInnerTD.style.height=ObjBody.scrollTop+100;

ObjBody.style.backgroundColor=getDarkColor("#E4E4E4");
changeOpac(50,TableId);
ObjWin.style.zIndex=1000;
ObjWin.style.height=ObjBody.scrollHeight;
ObjInnerWin.style.height=ObjBody.scrollHeight;
ObjWin.style.visibility="visible";
}

function HideUpdateWin(BodyId,TableId,WinId){ 
ObjBody=document.getElementById(BodyId);
ObjWin=document.getElementById(WinId);

ObjWin.style.visibility="hidden";
ObjWin.style.zIndex=-1;
changeOpac(100,TableId);
ObjBody.style.backgroundColor='';//strBackgroundColor;
} 

function d2h(d) {return d.toString(16);}

function h2d(h) {return parseInt(h,16);} 

function getDarkColor(strColor){
if(strColor.charAt(0) == '#')
  { strColor = strColor.substr(1,6); }
r_dec = h2d(strColor.substr(0,2)); g_dec = h2d(strColor.substr(2,2)); b_dec = h2d(strColor.substr(4,2));
r_dark=((r_dec - 100)<=0)? 0 : (r_dec - 100); g_dark=((g_dec - 100)<=0)? 0 : (g_dec - 100); b_dark=((b_dec - 100)<=0)? 0 : (b_dec - 100);
r = d2h(r_dark); g = d2h(g_dark); b = d2h(b_dark); 
if (r.length == 1) r = '0' + r; if (g.length == 1) g = '0' + g; if (b.length == 1) b = '0' + b;
return "#"+r+g+b;
}