﻿		var zxcVObj,zxcHObj,zxcTO,zxcX,zxcY;
		var zxcEvt=0;
		var zxcCursor=(document.all)?'hand':'pointer';
		
		function zxcMse(event){
		 if(!event) var event=window.event;
		 if (event.clientY){ return [event.clientX+zxcDocS()[0],event.clientY+zxcDocS()[1]]; }
		 else { return [zxcMseX=event.pageX,zxcMseY=event.pageY]; }
		}
		
		function zxcDocS(){
		 var zxcsx,zxcsy;
		 if (!window.innerHeight){ zxcsx=document.documentElement.scrollLeft; zxcsy=document.documentElement.scrollTop; }
		 else { zxcsx=document.body.scrollLeft; zxcsy=document.body.scrollTop; }
		 return [zxcsx,zxcsy];
		}
		
		function zxcMseUp(){
		 zxcVObj=false;
		 zxcHObj=false;
		 clearTimeout(zxcTO);
		}
		
		function zxcClearTimeout(){
		 clearTimeout(zxcTO);
		}
		
		function zxcEventAdd(zxco,zxct,zxcf) {
		 if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ zxco[zxcf](e);}, false); }
		 else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ zxco[zxcf](e); }); }
		 else {
		  var zxcPrev=zxco["on" + zxct];
		  if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
		  else { zxco['on'+zxct]=zxco[zxcf]; }
		 }
		}
		
		function zxcAddEvt(zxco,zxcfun,zxcevt){
		 if (zxco['zxc'+zxcfun+zxcevt]){ return; }
		 zxco['zxcaddEvt'+zxcEvt]=window[zxcfun];
		 zxco['zxc'+zxcfun+zxcevt]=true;
		 zxcEventAdd(zxco,zxcevt,'zxcaddEvt'+zxcEvt);
		 zxcEvt++;
		}
		
		// ** Required for Vertical  Applications
		function zxcVerticalScroll(){
		 var zxcargs=zxcVerticalScroll.arguments;
		 var zxcslide=document.getElementById(zxcargs[0]);
		 if (!zxcslide){ return; }
		 var zxccont;
		 zxccont=document.getElementById(zxcargs[1]);  
		 if (zxcargs[2]!='mousedown'&&zxcargs[2]!='mouseover'){ zxcargs[2]='mousedown'; }
		 zxcAddEvt(document,'zxcVScrollBar','mousemove');
		 var zxcbar=zxcslide.parentNode;
		 zxcAddEvt(zxcslide,'zxcVSrtScroll','mousedown');
		 zxcAddEvt(document,'zxcMseUp','mouseup');
		 zxcslide.style.cursor='n-resize';
		 //zxcslide.onmouseout=function(event){ zxcVObj=false; }
		 var zxcdivs=zxcbar.childNodes;
		 var zxcm=zxcbar.offsetHeight/2;
		 for (var zxc0=0;zxc0<zxcdivs.length;zxc0++){
		  if (zxcdivs[zxc0]!=zxcslide&&zxcdivs[zxc0].nodeType==1){
		   zxcdivs[zxc0].style.cursor=zxcCursor;
		   zxcdivs[zxc0].slide=zxcslide;
		   zxcAddEvt(zxcdivs[zxc0],'zxcClearTimeout','mouseup');
		   //zxcAddEvt(zxcdivs[zxc0],'zxcClearTimeout','mouseout');
		   if (zxcdivs[zxc0].offsetTop>zxcm){ zxcdivs[zxc0].vdir=-1; zxcAddEvt(zxcdivs[zxc0],'zxcVButton',zxcargs[2]); }
		   if (zxcdivs[zxc0].offsetTop<zxcm){ zxcdivs[zxc0].vdir=1; zxcAddEvt(zxcdivs[zxc0],'zxcVButton',zxcargs[2]); }
		  }
		 }
		 var zxcct;
		 if (typeof(zxccont)=='object'){
			  zxcct=zxccont.scrollHeight-zxccont.offsetHeight;
			  ///////
  			  var par = zxcbar.parentNode;
			  var prevpad = '0';
			  if(document.all){
			  	prevpad =  par.currentStyle.padding;
			  }else{
			  	var cstyle = document.defaultView.getComputedStyle(par,null);
			  	prevpad = cstyle.getPropertyValue('padding-top') + ' ' + 
			  		cstyle.getPropertyValue('padding-right') + ' ' + 
			  		cstyle.getPropertyValue('padding-bottom') + ' ' +
			  		cstyle.getPropertyValue('padding-left');
			  }
			  par.style.padding='0';
			  par.removeChild(zxcbar);
			  //alert(zxccont.scrollHeight+' - '+zxccont.offsetHeight);
			  if(zxccont.scrollHeight>zxccont.offsetHeight){
			  	par.appendChild(zxcbar);
			  	par.style.padding=prevpad;
			  	//alert(zxccont.scrollHeight+' - '+zxccont.offsetHeight);
			  	zxccont.scrollTop='0'; zxcslide.style.width=zxcslide.offsetWidth+'px'; zxcslide.style.height=zxcbar.offsetHeight/(zxccont.scrollHeight/zxccont.offsetHeight)+'px'; 
			  }
			  else { 
				  	//zxcbar.style.visibility='hidden'; 
				  	//par.style.padding='0';
				  	//par.removeChild(zxcbar);
				  	
					var count=0;
				  	while((zxccont.offsetHeight>zxccont.scrollHeight)&&(count<zxccont.offsetHeight)){
					  	zxccont.style.height = zxccont.offsetHeight-1 +'px';
					  	//zxccont.childNodes[0].style.height = zxccont.offsetHeight-10 +'px';
					  	count++;
					}
					//zxccont.style.height = zxccont.offsetHeight +'px'; //+10
			  }
		 }
		 if (!zxcslide.vdata){ zxcslide.vdata=[parseInt(zxcslide.style.top),parseInt(zxcbar.style.height)-parseInt(zxcslide.style.height),zxccont,zxcct,zxcargs[3]||100]; }
		 
		}
		
		function zxcVSrtScroll(zxcevt){
		 zxcVObj=this;
		 this.vdata[0]=parseInt(this.style.top);
		 zxcY=zxcMse(zxcevt)[1];
		}
		
		function zxcVScrollBar(zxcevt){
		 if (!zxcVObj){ return; }
		 zxcpos=zxcMse(zxcevt)[1]-zxcY;
		 zxcVContent(zxcVObj,zxcVObj.vdata[0],zxcpos);
		}
		
		function zxcVContent(zxcobj,zxcdata,zxcpos){
		 if (zxcdata+zxcpos>=0&&zxcdata+zxcpos<zxcobj.vdata[1]){ zxcobj.style.top=(zxcdata+zxcpos)+'px'; }
		 var zxcratio=Math.max((parseInt(zxcobj.style.top))/zxcobj.vdata[1],0);
		 if (typeof(zxcobj.vdata[2])=='object'){ zxcobj.vdata[2].scrollTop=zxcobj.vdata[3]*zxcratio; }
		 else if (window[zxcobj.vdata[2]]){ window[zxcobj.vdata[2]](zxcratio); }
		}
		
		function zxcVButton(zxcevt,zxcobj,zxcspd){
		 if (!zxcobj){ zxcobj=this; zxcspd=zxcobj.slide.vdata[4]; }
		 if (zxcspd>10){ zxcspd--; }
		 var zxcpos=parseInt(zxcobj.slide.style.top)-zxcobj.vdir;
		 zxcVContent(zxcobj.slide,0,zxcpos);
		 zxcTO=setTimeout(function(){zxcVButton('',zxcobj,zxcspd)},zxcspd);
		}
