
function edheight(){ 
var browser=navigator.appName
hd=document.getElementById('v-header');  
if (hd!=null){
fd=document.getElementById('v-footer'); 
b=document.getElementById('v-body');
cd=document.getElementById('v-container');
ct=document.getElementById('v-content');
hdivHeight=hd.offsetHeight;
if (fd!=null){
fdivHeight=fd.offsetHeight;
contHeight=cd.offsetHeight + fdivHeight;
}else{
contHeight=cd.offsetHeight;
}
bodyHeight=b.clientHeight;
if ((fd==null)&&(browser.indexOf("Microsoft")>=0))
    cd.style.height="100%";
else
    ct.style.overflow="hidden";

if (contHeight>=b.clientHeight){  
    cd.style.height="100%";
if (browser.indexOf("Microsoft")>=0)
    ct.style.height="100%";
    ct.style.overflow="auto";
    ct.style.position="absolute";
    ct.style.top=hdivHeight;
    hd.style.position="absolute";

if (fd!=null){
    fd.style.bottom="0";	
    fd.style.position="absolute";
    ct.style.height=bodyHeight-fdivHeight-hdivHeight;
}else{
    ct.style.height=bodyHeight-hdivHeight;
}
}
}
} 

function edheight2(){ 
var browser=navigator.appName
hd=document.getElementById('v-header');  
if (hd!=null){
b=document.getElementById('v-body');
cd=document.getElementById('v-container');
ct=document.getElementById('v-content');
fd=document.getElementById('v-footer'); 
hdivHeight=hd.offsetHeight;
if (fd!=null){
fdivHeight=fd.offsetHeight;
contHeight=cd.offsetHeight + fdivHeight;
}else{
contHeight=cd.offsetHeight;
}
bodyHeight=b.clientHeight;
if (document.documentElement.clientHeight)
  winHeight=document.documentElement.clientHeight;
else
  winHeight=document.body.clientHeight;
if ((fd==null)&&(browser.indexOf("Microsoft")>=0))
    cd.style.height="100%";
else
    ct.style.overflow="hidden";
if (contHeight>=b.clientHeight){  
    cd.style.height="100%";
//if (browser.indexOf("Microsoft")>=0)
//    ct.style.height="100%";
    if (fd!=null)
      cd.style.height=eval(winHeight-fd.style.height)+"px";
    else
      cd.style.height=eval(winHeight)+"px";
    ct.style.overflow="auto";
    ct.style.position="absolute";
    ct.style.top=hdivHeight;
    hd.style.position="absolute";

if (fd!=null){
    fd.style.bottom="0";	
    fd.style.position="absolute";
    ct.style.height=eval(b.clientHeight-fd.offsetHeight-hd.offsetHeight)+"px";
}else{
    ct.style.height=eval(b.clientHeight-hd.offsetHeight)+"px";
}
}
}
} 

function lheight(id){ 

var browser=navigator.appName
var nAgent = navigator.userAgent;

hd=document.getElementById('l-header');  
lhd=document.getElementById('x-header');  
lfd=document.getElementById('x-footer');
b=document.getElementById('v-body');
lb=document.getElementById('x-body');
cd=document.getElementById('l-container');

if (id==0 || id==null){

sbWidth=b.offsetWidth - cd.clientWidth;
sbHeight=cd.offsetHeight - b.clientHeight;
if (hd!=null){
ibHeight=b.clientHeight - hd.offsetHeight;
mbHeight=b.clientHeight - hd.offsetHeight;
if (lfd!=null)
lbHeight=cd.offsetHeight - hd.offsetHeight - lhd.offsetHeight - lfd.offsetHeight;
else
lbHeight=cd.offsetHeight - hd.offsetHeight - lhd.offsetHeight;
}else{
ibHeight=b.clientHeight;
mbHeight=b.clientHeight;
if (lfd!=null)
lbHeight=cd.offsetHeight - lhd.offsetHeight - lfd.offsetHeight;
else
lbHeight=cd.offsetHeight - lhd.offsetHeight;
}


if (nAgent.indexOf("Firefox/2")>=0 || nAgent.indexOf("Firefox/3")>=0)
{

if (lb.offsetWidth>b.clientWidth){
if (lb.offsetHeight>lbHeight)
    lb.style.height=lbHeight - sbHeight - sbWidth; 
else
    lb.style.height=lb.offsetHeight; 
}else{
if (lb.offsetHeight>lbHeight)
    lb.style.height=lbHeight - sbHeight; 
else
    lb.style.height=lb.offsetHeight; 
}
    cd.style.height=mbHeight;
    cd.style.overflowY='hidden';

}else{
if (lfd!=null){
if (lb.offsetWidth>cd.clientWidth)
    lfd.style.height='40';
else
    lfd.style.height='20';
}
    cd.style.height=ibHeight;

}
//alert(lb.offsetHeight);
}else{

lb.style.height='auto';
lbHeight='auto';
cd.style.height='auto';
cdHeight='auto';
cd.style.overflowY='visible';
//alert(lb.clientHeight);

}
}

function mlheight(){ 
var browser=navigator.appName
var nAgent = navigator.userAgent;

hd=document.getElementById('l-header');  
lhd=document.getElementById('x-header-1');  
lfd=document.getElementById('x-footer-1');
b=document.getElementById('v-body');
lb=document.getElementById('x-body-1');
cd=document.getElementById('l-container-1');
tbl=document.getElementById('x-table-1');

sbWidth=b.offsetWidth - cd.clientWidth;
sbHeight=cd.offsetHeight - b.clientHeight;
ibHeight=b.clientHeight - hd.offsetHeight;
mbHeight=b.clientHeight - hd.offsetHeight;
if (lfd!=null)
lbHeight=cd.offsetHeight - hd.offsetHeight - lhd.offsetHeight - lfd.offsetHeight;
else
lbHeight=cd.offsetHeight - hd.offsetHeight - lhd.offsetHeight;


if (nAgent.indexOf("Firefox/2")>=0 || nAgent.indexOf("Firefox/3")>=0)
{
/*
if (lb.offsetWidth>b.clientWidth){
if (lb.offsetHeight>lbHeight)
    lb.style.height=lbHeight - sbHeight - sbWidth; 
else
    lb.style.height=lb.offsetHeight; 
}else{
if (lb.offsetHeight>lbHeight)
    lb.style.height=lbHeight - sbHeight; 
else
    lb.style.height=lb.offsetHeight; 
}*/
    //cd.style.height=mbHeight;
    cd.style.overflowY='hidden';

}else{
if (lfd!=null){
if (lb.offsetWidth>cd.clientWidth)
    lfd.style.height='40';
else
    lfd.style.height='20';
}
    cd.style.height=tbl.style.height;
}
}





function cuswid()
{
fc=document.getElementById('f-container'); 
if (fc!=null){

count=2;
while (count<10){
str="td"+count;

cusw2=document.getElementsByName(str); 
if (cusw2!=null){

custbWidth=fc.offsetWidth;
cusWidth2=(custbWidth - 134 * count) / count ;
if(cusWidth2>0)
  for (i=0;i<cusw2.length;i++){
    if (cusw2[i])
      cusw2[i].style.width=cusWidth2;
  }
}
count++;
}}

}




function dropm(id,cmd)
{
i=document.getElementById(id);
if (cmd=="d")
i.style.display="block";
else
i.style.display="none";
}
function hltitem(id,cmd)
{
i=document.getElementById(id);
if (cmd=="h")
i.className="nav-item-top-o";
else
i.className="nav-item-top";
}
function hlmitem(id,cmd)
{
i=document.getElementById(id);
if (cmd=="h")
i.className="nav-item-drop-o";
else
i.className="nav-item-drop";
}




var menuwidth='165px' //default menu width
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?
var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" class="DropNav" style="visibility:hidden;width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")-5+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+6+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu


//---help drop down script---

function getloc(obj)
{
ob=document.getElementById(obj); 
var curleft = curtop = 0;

if (ob.offsetParent) {
do {
curleft += ob.offsetLeft;
curtop += ob.offsetTop;

} 
while (ob = ob.offsetParent);
return [curtop,curleft];

}
}

document.write('<div id=drophelp class="text-help" onmouseover="return showhelp(1);" onmouseout="keephidedrop(0)"></div>');

function showhelp(flag,msg,hp) 
{
var browser=navigator.appName
var dh=document.getElementById('drophelp');
h=document.getElementById(hp); 

var tloc=parseInt(getloc(hp)[0]) + parseInt(h.offsetHeight);
var lloc=parseInt(getloc(hp)[1]);

if (flag==1){

dh.innerHTML=msg;
dh.style.top=tloc+'px';
dh.style.left=lloc+'px';
dh.style.display="block";
}else{
dh.innerHTML='';
dh.style.top='0px';
dh.style.left='0px';
dh.style.display="none";
}
if (dh.offsetHeight > 120)
dh.style.height=120;

}



function keephidedrop(id)
{
var dh = document.getElementById("drophelp");
if (id==1)
dh.style.display="block";
else
dh.style.display="none";
}




function showlock(locktype,msg,id)
{
  if(locktype==1)
   msg+="&nbsp;<input onclick='_forcecheckin();' type=button value='Undo Check Out' class=Button>";
if (id==1)
document.write('<table style="width:100%;position:relative;background-color:#FCDC02;z-Index:200;opacity:1;filter:alpha(opacity=100);padding:4px;border:1px #FF0000 solid"><tr><td><img src="/images/text_lock.png" align="top" style="margin-right:4px"><b>'+msg+'</b></td></tr></table>');
else
document.write('<div id="v-footer" class="v-footer" style="padding:0px;margin:0px"><table style="width:100%;position:relative;background-color:#FCDC02;z-Index:200;opacity:1;filter:alpha(opacity=100);padding:4px;border:1px #FF0000 solid"><tr><td><img src="/images/text_lock.png" align="top" style="margin-right:4px"><b>'+msg+'</b></td></tr></table></div>');


}
/*
try{
jQuery(document).ready(function() {

	jQuery("td a").imgPreview({
            		containerID: 'imgPreviewWithStyles',
            		imgCSS:{height: 150,width: '200px'},
            		onShow: function(link){
        			// Animate link:
        			jQuery(link).stop().animate({opacity:0.4});
        			// Reset image:
        			jQuery('img', this).stop().css({opacity:0});
    		},
    		// When image has loaded:
    		onLoad: function(){
        			// Animate image
        			jQuery(this).animate({opacity:1}, 300);
    		},
    		// When container hides: 
    		onHide: function(link){
        			// Animate link:
        			jQuery(link).stop().animate({opacity:1});
    		}
        	});

});
}catch (err){}
*/
