var zBox,zStep=0,zLink

function doZoomPlus() {
    zStep+=1;zPct=(10-zStep)/10
 if(document.layers) {
	zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));
	zBox.document.open();
	zBox.document.write("<table width='"+mW*(1-zPct)+"' height="+mH*(1-zPct)+" border="+zThick+" bordercolor="+zColor+" cellspacing=0><tr><td "+CLR+">&nbsp;</td></tr></table>");
	zBox.document.close()}else{
	zBox.style.border=""+zThick+"px solid "+zColor+"";
	zBox.style.left=toX+zPct*(fromX-toX);
	zBox.style.top=toY+zPct*(fromY-toY);
	zBox.style.width=mW*(1-zPct);
	zBox.style.height=mH*(1-zPct);
	}zBox.style.visibility="visible";
  if(zStep < 10) setTimeout("doZoomPlus("+fromX+","+fromY+","+toX+","+toY+")",30);else{
     zBox.style.visibility='hidden';zBox.style.left=0;zBox.style.top=0;zStep=0;
  if(zLink){var win=window.open(''+ zLink + '',''+name+'','width='+mW+',height='+mH+',left='+adjX+',top='+adjY+',scrollbars='+Sbar+',toolbar='+Tbar+',location='+Lbar+',status='+Xbar+',menubar='+Mbar+',resizable');
  }  win.focus();
 }
}

function Lvl_ZoomPlus(evt,zlink,name,maxw,maxh,tox,toy,sc,tb,lb,sb,mb,clr,zclr,zthk,ctr) {
	var d=document,w=window;
 if(arguments.length>2)
    scrollH=(w.pageYOffset!=null)?w.pageYOffset:d.body.scrollTop;
    mW=maxw?maxw:w.innerWidth?innerWidth:d.body.clientWidth;
    mH=maxh?maxh:w.innerHeight?innerHeight:d.body.clientHeight;
  toX=(ctr==1)?screen.width*.5-maxw/2:tox?tox:0;
  toY=(ctr==1)?screen.height*.5-maxh/1.30:(toy?toy:0)+scrollH;
    fromX=evt.pageX?evt.pageX:evt.clientX;
    fromY=(evt.pageY?evt.pageY:evt.clientY)+(d.all?scrollH:0);
  adjX=(ctr==1)?(screen.width-maxw)/2:toX+evt.screenX-fromX;
  adjY=(ctr==1)?(screen.height-maxh)*.40:toY+evt.screenY-fromY;
	 
 if(d.createElement&&d.body.appendChild&&!zBox){
	zBox=d.createElement("div");
	zBox.style.position="absolute";
	d.body.appendChild(zBox)}else 
 if(d.all&&!zBox){d.all[d.all.length-1].outerHTML+='<div id="zBoxDiv" style="position:absolute"></div>';
    zBox=d.all.zBoxDiv}else if(d.layers&&!zBox){zBox=new Layer(mW);zBox.style=zBox}
  Sbar =(sc == 'y')?'yes':'no';
  Tbar =(tb == 'y')?'yes':'no';
  Lbar =(lb == 'y')?'yes':'no';
  Xbar =(sb == 'y')?'yes':'no';
  Mbar =(mb == 'y')?'yes':'no';
    bColor=clr;CLR=(d.layers && !clr)?'':"bgcolor="+bColor+"";
    zLink=zlink;zBox.style.background=clr;zColor=zclr;zThick=zthk;doZoomPlus();
}

function Lvl_openWin(u,n,w,h,l,t,c,f) { //v1.0 4LevelWebs
  var ww=((screen.width-w)/2);if(c==1){l=ww;t=(screen.height-h)/2;}if(c==2){l=ww}
	f+=',top='+t+',left='+l;LvlWin = window.open(u,n,f);LvlWin.focus();
}

function kc_showHide(e) {
	var theDiv = document.getElementById(e);
	if (theDiv.style.display == 'block') {
		theDiv.style.display = 'none';
	} else {
		theDiv.style.display = 'block';
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//used on the binaryConversion page to show/hide the processing message
//theID = ID of the element (usually a <div>) being manipulated
//what = the display property to change: none or block 
function showMe(theID,what) {
	document.getElementById(theID).style.display = what; 
}
