<?php
/*  ___________________________________________________________________________
    
    ProgressClass v1.0  -  (c) 2002 Boris Wylutzki/www.edv-internet.de
    ___________________________________________________________________________
*/

$key            = $this->_key;
$width          = $this->_width;
$height         = ($this->_button?106:63);
$top            = str_replace('center',"parseInt(((document.all?document.body.offsetHeight:window.innerHeight)-$height)/2)",$this->_top);
$left           = str_replace('center',"parseInt(((document.all?document.body.offsetWidth:window.innerWidth)-$width)/2)",$this->_left);
$button         = $this->_jss_single(htmlentities($this->_button));
$button_url     = $this->_jss_single($this->_button_url);
$button_target  = str_replace('_self','self',$this->_button_target);
$button_target  = str_replace('_top','top',$button_target);
$button_target  = str_replace('_parent','parent',$button_target);
$button_target  = $this->_jss_single($this->_jss_single($button_target));
$label          = $this->_jss_single($this->_jss_single($this->_label));
$visibility     = ($show?'visible':'hidden');

// ----------------------------------------------------------------------------

$js="<script type=\"text/javascript\">\n<!--\n// -------------------------------------------------------------------------\n// ProgressClass v1.0 JavaScript (c) 2002 Boris Wylutzki/www.edv-internet.de\n// -------------------------------------------------------------------------\nfunction {$key}_getObj(obj){if(document.all)return document.all['{$key}_'+obj];else return document.getElementById('{$key}_'+obj);}function {$key}_setPercent(percent){{$key}_getObj('bar').width=percent+'%';{$key}_getObj('percent').innerHTML=percent+' %';}function {$key}_setBarColor(color){{$key}_getObj('bar').bgColor=color;}function {$key}_setLabel(label){{$key}_getObj('label').innerHTML=label;}function {$key}_holdPosition(){if(document.all){document.all.{$key}_progress.style.pixelTop=document.body.scrollTop+$top;document.all.{$key}_progress.style.pixelLeft=document.body.scrollLeft+$left;}else{document.getElementById('{$key}_progress').style.top=(window.pageYOffset+$top)+'px';document.getElementById('{$key}_progress').style.left=(window.pageXOffset+$left)+'px';}}function {$key}_hideProgress(){{$key}_getObj('progress').style.visibility='hidden';}function {$key}_showProgress(){{$key}_getObj('progress').style.visibility='visible';}if(document.all){window.onscroll={$key}_holdPosition;window.onresize={$key}_holdPosition;}else setInterval('{$key}_holdPosition()',100);";$js.='document.write(\'<div id="'.$key.'_progress" style="position:absolute; z-index:1; left: \'+('.$left.')+\'px; top: \'+('.$top.')+\'px; visibility: '.$visibility.'">';if ($button)$js.='<form name="" action="">';$js.='<table width="'.$width.'" border="0" cellspacing="0" cellpadding="0" bgcolor="#D4D0C8" style="border: 1px solid; border-color: #D4D0C8 #404040 #404040 #D4D0C8"><tr><td><table width="100%" cellspacing="0" cellpadding="10" border="0" style="border: 1px solid; border-color: #FFFFFF #808080 #808080 #FFFFFF"><tr><td><table width="100%" cellspacing="0" cellpadding="0" border="0" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px"><tr><td id="'.$key.'_label">'.$label.'</td><td align="right" valign="bottom" id="'.$key.'_percent">'.$this->_percent.' %</td></tr></table><table width="100%" cellspacing="0" cellpadding="2" border="0" style="border: 1px solid; border-color: #808080 #FFFFFF #FFFFFF #808080"><tr><td><table id="'.$key.'_bar" width="'.$this->_percent.'%" height="18" border="0" cellspacing="0" cellpadding="0" bgcolor="'.$this->_barcolor.'"><tr><td></td></tr></table></td></tr></table>';if ($button)$js.='<p align="center"><input type="button" value="'.$button.'" class="text" onClick="'.$button_target.'.location.href=\\\''.$button_url.'\\\'"></p>';$js.='</td></tr></table></td></tr></table>';if ($button)$js.='</form>';$js.="</div>');\n// -->\n</script>";
echo $js;
flush();

?>