// JavaScript Document
	  var duration = 1000;  /* 1000 millisecond fade = 1 sec */
      var steps = 20;       /* number of opacity intervals   */
      var delay =5000;     /* 5 sec delay before fading out */
      /*var counter=0;*/
function change_img_banner(a,b,pos,counter){
	//a is array name image
	//b is array link of image
	//pos is position banner
	var img = document.getElementById(pos);
	var level=0.5;
	if(a.length>1)
	{
		 var curri=document.getElementById(pos).alt;
		/*alert(counter+'----'+curri+'---'+a.length);*/
		 if(curri>=a.length-1) counter=0;
		   else counter=counter+1;	
	    document.getElementById(pos).src=a[counter];	
		document.getElementById('link'+pos).href=b[counter];
		document.getElementById(pos).alt=counter;		

	}

}
/*var element = document.getElementById('top');*/
     
      /* set the opacity of the element (between 0.0 and 1.0) */
      function setOpacity(level,pos) {		
        pos.style.opacity = level;
        pos.style.MozOpacity = level;
        pos.style.KhtmlOpacity = level;
        pos.style.filter = "alpha(opacity=" + (level * 100) + ");";
      }

      function fadeIn(){
        for (i = 0; i <= 1; i += (1 / steps)) {
          setTimeout("setOpacity(" + i + ")", i * duration);
        }
        setTimeout("fadeOut()", delay);
      }

      function fadeOut() {
        for (i = 0; i <= 1; i += (1 / steps)) {
          setTimeout("setOpacity(" + (1 - i) + ")", i * duration);
        }
        setTimeout("fadeIn()", duration);
      }

      /* start the effect */
      /*fadeIn();*/
