// JavaScript Document

function opendeliveryWindowBill(ref, name) {
options="width=550,height=500,status=0,scrollbars=yes,toolbar=no,resize=no";
window.open(ref, name,options);
 }

function fadeItBill(direction) {
		var imageObj = new fx.Opacity('billboard'+count, {duration:1000});
		
		imageObj.setOpacity(1);
		imageObj.custom(1,0);	
		
		if(direction=='forwards') {
			if(count < total) {
				count=count+1;
			} else {
				count=1;
			}
		} else {
			if(count > 1) {
				count=count-1;
			} else {
				count=total;
			}
		}
		
		if(document.getElementById('billboard'+count).style.display!='block') {
			document.getElementById('billboard'+count).style.display='block';
		}
		
		var imageObj = new fx.Opacity('billboard'+count, {duration:1000});
		
		imageObj.setOpacity(0);
		imageObj.custom(0,1);

		showCountBill();
		scrollTimerBill();
	}
	
	function hideThemBill() {
		document.getElementById('billboard1').style.display='block';
		
		for(var loopCount = 2; loopCount <= total; loopCount++) {
			var imageObj = new fx.Opacity('billboard'+loopCount);
			imageObj.setOpacity(0);
		}
	}
	
	function showCountBill() {
		document.getElementById('paging').innerHTML=count+'/'+total;
	}
	
	scrollTime = 10000;
	
	function scrollTimerBill() {

		window.clearTimeout(tOut);
		tOut = setTimeout("fadeItBill('forwards');",scrollTime); 
	}