// JavaScript Document

function opendeliveryWindowPic(ref, name) {
options="width=550,height=500,status=0,scrollbars=yes,toolbar=no,resize=no";
window.open(ref, name,options);
 }

function fadeItPic(direction) {
		var imageObj = new fx.Opacity('pic'+Charcount, {duration:1000});
		//var headerObj = new fx.Opacity('header'+count, {duration:1000});
		//var textObj = new fx.Opacity('text'+count, {duration:1000});
		
		//textObj.setOpacity(1);
		//textObj.custom(1,0);	
		
		//headerObj.setOpacity(1);
		//headerObj.custom(1,0);	
		
		imageObj.setOpacity(1);
		imageObj.custom(1,0);	
		
		if(direction=='forwards') {
			if(Charcount < Chartotal) {
				Charcount=Charcount+1;
			} else {
				Charcount=1;
			}
		} else {
			if(Charcount > 1) {
				Charcount=Charcount-1;
			} else {
				Charcount=Chartotal;
			}
		}
		
		if(document.getElementById('pic'+Charcount).style.display!='block') {
			document.getElementById('pic'+Charcount).style.display='block';
		}
		
		/*if(document.getElementById('image'+count).style.display!='block') {
			document.getElementById('image'+count).style.display='block';
		}
		
		if(document.getElementById('header'+count).style.display!='block') {
			document.getElementById('header'+count).style.display='block';
		}*/
				
		var imageObj = new fx.Opacity('pic'+Charcount, {duration:1000});
		/*var headerObj = new fx.Opacity('header'+count, {duration:1000});
		var textObj = new fx.Opacity('text'+count, {duration:1000});*/
		
		/*textObj.setOpacity(0);
		textObj.custom(0,1);	
		
		headerObj.setOpacity(0);
		headerObj.custom(0,1);	*/
		
		imageObj.setOpacity(0);
		imageObj.custom(0,1);
		
		//showCountPic();
		//scrollTimerPic();
	}
	
	function hideThemPic() {
		document.getElementById('pic1').style.display='block';
		/*document.getElementById('image1').style.display='block';
		document.getElementById('header1').style.display='block';*/
		
		for(var loopCount = 2; loopCount <= Chartotal; loopCount++) {
			/*var textObj = new fx.Opacity('text'+loopCount);
			textObj.setOpacity(0);
			var headerObj = new fx.Opacity('header'+loopCount);
			headerObj.setOpacity(0);*/
			var imageObj = new fx.Opacity('pic'+loopCount);
			imageObj.setOpacity(0);
		}
	}
	
	function showCountPic() {
		document.getElementById('paging').innerHTML=Charcount+'/'+Chartotal;
	}
	
	scrollTime = 10000;
	
	function scrollTimerPic() {

		window.clearTimeout(tOut);
		tOut = setTimeout("fadeItPic('forwards');",scrollTime); 
	}
