function init(){
  updateClock(); }


// CLOCK
function updateClock ( ) {
  var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=setclock',0);
  gReturn = get.get();
  get = null;
  document.getElementById("time").firstChild.nodeValue = gReturn;}


// NEW BC WINDOW
function bcWindow (url,width,height) {
  newwindow=window.open(url,'bcWindow','width=' + width + ',height=' + height + ',resizable=1');
  if (window.focus) {newwindow.focus()}}


// AJAX HELP
function AJAX_HELP(pThis,pId){   
    this.dTimeout;   
    clearTimeout(this.dTimeout);   
    this.dGet = dGet;   
    this.dShow = dShow;   
    this.dCancel = dCancel;   
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=AJAX_ITEM_HELP',0);   
    this.dGet();   
    return;   
       
    function dGet(){   
      get.add('TEMPORARY_ITEM',pId);   
      get.add('TEMPORARY_PAGE_ID',$x('pFlowStepId').value);   
        get.GetAsync(dShow);   
    }   
       
    function dShow(){   
        $x_Hide('rollover');   
        if(p.readyState == 1){   
        }else if(p.readyState == 2){   
        }else if(p.readyState == 3){   
        }else if(p.readyState == 4){   
            $x('rollover_content').innerHTML = p.responseText;   
            $x_Show('rollover');   
            htmldb_IE_Select_Item_Fix($x('rollover'));   
$x_Style('rollover','left',findPosX(pThis)+pThis.offsetWidth+5);   
            $x_Style('rollover','top',findPosY(pThis)-($x('rollover').offsetHeight/2)+($x(pThis).offsetHeight/2));  
            document.onclick = function(e){   
            dCheckClick(e);   
            }   
        }else{return false;}   
    }   

    function dCheckClick(e){   
        var elem = html_GetTarget(e);   
        try{   
                var lTable = $x_UpTill(elem,"DIV");   
                if(lTable.id!='rollover_content'){dCancel();}   
                else{}   
        }catch(err){dCancel();}}   
       
    function dCancel(){   
        $x_Hide('rollover');   
        document.onclick = null;   
        get = null;}   
}   

function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}

