	var adno=0;
	var addcount=0;
	
	var currenth='';
	var currentp='';
	var currentimg='';
	var currentlink='';
	var isfirsttime=true;
	var firstimage='';
	
	function showbanner(z)
	{
	
		opacity("sloganh1",100,0,500);
		opacity("sloganp",100,0,700);
		opacity("sloganlink",100,0,900);
		
		
		if (z!=-1)
			{
			opacity("sloganimg",100,0,1500);
			window.setTimeout("showbanner2(0);",1700);
			
			}
		else			
			window.setTimeout("showbanner2(-1);",1100);
			
			
		
		var xcss="";
		for (var i=1;i<=addcount;i++)
		{
			if (i==adno) { xcss="active" } else { xcss="" }
			document.getElementById("bannerbutton"+i).setAttribute("class",xcss)
			document.getElementById("bannerbutton"+i).setAttribute("className",xcss)
		}
	}
	
	function showbanner2(x)
	{
	
			document.getElementById("sloganh1").innerHTML=currenth;
			document.getElementById("sloganlink").innerHTML=currentlink;
			document.getElementById("sloganp").innerHTML="" ;
			
			if (x==0)
			{
			document.getElementById("sloganimg").src=currentimg ;
			opacity("sloganimg",0,100,500);
			}
				
			
			window.setTimeout("showbanner3();",500);
			
			
									
	}
	
	function showbanner3()
	{
	opacity("sloganh1",0,100,500);
	window.setTimeout("showbanner4();",500);
	}
	function showbanner4()
	{
		changeOpac(100,"sloganp");
		var st=currentp;
		
		for (i=0;i<st.length;i++)
		{
			window.setTimeout("typead('"+st.charAt(i)+"');",i*20)
			
		}	
		
		window.setTimeout("showbanner5();",st.length*20);
	}
	
	function showbanner5()
	{
	opacity("sloganlink",0,100,500);
	window.setTimeout("nextadd();",6000);
	}
	
	function nextadd()
	{
		adno++;
		if (adno>addcount) adno=1;


		z=getxml("nextad.asp?o="+adno);
		
		currenth = gettag(z,"h1");
		currentp = gettag(z,"p");
		currentimg = gettag(z,"img");
		currentlink = gettag(z,"link");
	
		
		
		if (isfirsttime)
			{			
			document.getElementById("sloganh1").innerHTML=currenth;
			document.getElementById("sloganp").innerHTML=currentp ;
			
			
			
			document.getElementById("sloganimg").style.display="block";
			
			if (currentlink != "")
				document.getElementById("sloganlink").innerHTML=currentlink;
			else
				document.getElementById("sloganlink").innerHTML="";
			
			
			
				document.getElementById("sloganimg").src=currentimg ;
				firstimage=currentimg 
				
			
			isfirsttime=false;
			
			window.setTimeout("nextadd();",10000);
		
			}
		else
			{
				if (currentimg == "") currentimg ="A";
				
				document.getElementById("sloganimgx").src=currentimg ;
			}


		//opacity("sloganh1",100,0,500);
		//opacity("sloganp",100,0,800);
		//opacity("sloganimg",100,0,800);

		
		
		
		
	//	
		
	}
	
	function typead(c)
	{
		o=document.getElementById("sloganp");
		o.innerHTML+=c;
	}
	
	
	var banner_total=0;
	var banner_current=0;


function startanimation()
{
	lastanimhandler=window.setTimeout("gonext();",4000);
}

var lastanimhandler=-1;
var SmoothMovementDemonstration = new SmoothMovement(0, 0);

function SmoothMovementDemonstrationGoTo(index){

  // update the target
  SmoothMovementDemonstration.target = -770 * index;

  // animate the movement
  SmoothMovementDemonstration.animate(
      5,
      function(position){

        // move the background image
        document.getElementById('banneripanel').style.left = position + 'px';

      },
      function(){

      });

}


	function checkbutton()
	{
		if (banner_current==banner_total-1)
			{
				document.getElementById('gorightbutton').setAttribute("class","gorightdisable");
				document.getElementById('gorightbutton').setAttribute("className","gorightdisable");				
			}
			else
			{
				document.getElementById('gorightbutton').setAttribute("class","goright");
				document.getElementById('gorightbutton').setAttribute("className","goright");				
			}
			
		if (banner_current==0)
			{
				document.getElementById('goleftbutton').setAttribute("class","goleftdisable");
				document.getElementById('goleftbutton').setAttribute("className","goleftdisable");				
			}
			else
			{
				document.getElementById('goleftbutton').setAttribute("class","goleft");
				document.getElementById('goleftbutton').setAttribute("className","goleft");				
			}			
	}

	function gonext()
	{
		banner_current++;
		if (banner_current>=banner_total) banner_current=0;
		
		SmoothMovementDemonstrationGoTo(banner_current);
		
		lastanimhandler=window.setTimeout("gonext();",5000);
		
		checkbutton();
	}
	
	function setbannerleft(i)
	{
	
		document.getElementById("banneripanel").style.left=i;
		//document.getElementById("ibanner"+banner_current).style.left=i;
		
	}
	
	function goright()
	{
		banner_current++;
		if (banner_current<banner_total)
					SmoothMovementDemonstrationGoTo(banner_current);
		else
				banner_current=banner_total-1;
				
		if (lastanimhandler!=-1) window.clearTimeout(lastanimhandler);	
		lastanimhandler=window.setTimeout("gonext();",15000);
		
		checkbutton();
	}
	
	function goleft()
	{
		banner_current--;
		if (banner_current>=0)
				SmoothMovementDemonstrationGoTo(banner_current);
			else
				banner_current=0;
		if (lastanimhandler!=-1) window.clearTimeout(lastanimhandler);	
		
		
		lastanimhandler=window.setTimeout("gonext();",15000);
		
		checkbutton();
	}	
	