    function olscreen(div,bgcolor,opacity,zIndex) {
      if (div===undefined) {
        alert('You must specify a div to display');
        exit;
      }
      if (bgcolor===undefined) {
        bgcolor='#DDDDDD';
      }
      if (opacity===undefined) {
        opacity='65';
      }
      if (zIndex===undefined) {
        zIndex=100;
      }
      var showdiv=document.getElementById(div);
      if (!showdiv) {
        return;
      }
      if (document.getElementById('stoldiv')) {
        document.body.removeChild(document.getElementById('stoldiv'));
      }
      var stdiv = document.createElement('div');
      stdiv.setAttribute('id','stoldiv');
      stdiv.style.position='absolute';
      stdiv.style.zIndex=parseInt(zIndex);
      if (document.documentElement && document.documentElement.clientWidth) {
        stdiv.style.width=parseInt(document.documentElement.clientWidth)+'px';
      } else {
        stdiv.style.width=parseInt(document.body.clientWidth)+'px';
      }
      if (document.documentElement && document.documentElement.clientHeight) {
        stdiv.style.height=parseInt(document.documentElement.clientHeight)+'px';
      } else {
        stdiv.style.height=parseInt(document.body.clientHeight)+'px';
      }
      if (document.documentElement && document.documentElement.scrollTop) {
        stdiv.style.top=parseInt(document.documentElement.scrollTop)+'px';
      } else {
        stdiv.style.top=parseInt(document.body.scrollTop)+'px';
      }
      if (document.documentElement && document.documentElement.scrollLeft) {
        stdiv.style.left=parseInt(document.documentElement.scrollLeft)+'px';
      } else {
        stdiv.style.left=parseInt(document.body.scrollLeft)+'px';
      }
      stdiv.style.backgroundColor=bgcolor;
      stdiv.style.filter='alpha(opacity='+opacity+')';
      stdiv.style.opacity='0.'+opacity;
      stdiv.style.mozOpacity='.'+opacity;
      stdiv.innerHTML='';
      stdiv.style.display='block';
      document.body.appendChild(stdiv);
      showdiv.style.position='absolute';
      showdiv.style.zIndex=-1;
      showdiv.style.display='block';
      if (!isNaN(parseInt(getStyle(div,'width'))) && !isNaN(parseInt(getStyle(div,'height'))) ){
        showdiv.style.top=parseInt(stdiv.style.top)+((parseInt(stdiv.style.height)-parseInt(getStyle(div,'height')))/2)+'px';
        showdiv.style.left=parseInt(stdiv.style.left)+((parseInt(stdiv.style.width)-parseInt(getStyle(div,'width')))/2)+'px';
      } else if (showdiv.offsetHeight && showdiv.offsetWidth) {
        showdiv.style.top=parseInt(stdiv.style.top)+((parseInt(stdiv.style.height)-parseInt(showdiv.offsetHeight))/2)+'px';
        showdiv.style.left=parseInt(stdiv.style.left)+((parseInt(stdiv.style.width)-parseInt(showdiv.offsetWidth))/2)+'px';
      } else {
        //alert('could not get div size');
        showdiv.style.top=parseInt(document.body.scrollTop)+200+'px';
        showdiv.style.left=parseInt(document.body.scrollLeft)+200+'px';
      }
      showdiv.style.zIndex=parseInt(zIndex)+1;
    }   
    function getStyle(el,styleProp) {
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
    }

    function clearolscreen(div) {
      var showdiv=document.getElementById(div);
      showdiv.style.display='none';
      document.body.removeChild(document.getElementById('stoldiv'));
    }
    function findPos(obj) {
      var curleft = curtop = 0;
      if (obj.offsetParent) {
        do {
          curleft += obj.offsetLeft;
          curtop += obj.offsetTop;
        } while (obj = obj.offsetParent);
	return [curleft,curtop];
      }
    }

    function setCookie(c_name,value,expiredays) {
      var exdate=new Date();
      exdate.setDate(exdate.getDate()+expiredays);
      document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
    }

    function getCookie(c_name) {
      if (document.cookie.length>0) {
        c_start=document.cookie.indexOf(c_name + "=");
        if (c_start!=-1) {
          c_start=c_start + c_name.length+1;
          c_end=document.cookie.indexOf(";",c_start);
          if (c_end==-1) c_end=document.cookie.length;
          return unescape(document.cookie.substring(c_start,c_end));
        }
      }
      return false;
    }


