  //Initialization of variables
  var left;
  var width;
  var flag;
  var c;
  var tm;
  var tot_banner;
  //Initialization of Constants
  var CONST_WIDTH;
  var CONST_COLOR_BANNER_NUMBER_LIGHT;
  var CONST_COLOR_BANNER_NUMBER_DARK;
  function slide()
  {
//      alert(left%CONST_WIDTH);
     if(tot_banner<2)
        return false;
     if(left%CONST_WIDTH==0)
    {
	  if(!flag)
	   {
	    $(".slide"+c).css("color",CONST_COLOR_BANNER_NUMBER_LIGHT);
	    c--;
		$(".slide"+c).css("color",CONST_COLOR_BANNER_NUMBER_DARK);
	   }
	   else
	   {
	     $(".slide"+c).css("color",CONST_COLOR_BANNER_NUMBER_LIGHT);
	     c++;
		 $(".slide"+c).css("color",CONST_COLOR_BANNER_NUMBER_DARK);
	   }
	}
   if(tm)
   {
    clearTimeout(tm);
   }
  
   tm=setTimeout("slide()",100);
//   alert(tot_banner);
//   alert(left);
 
   if(flag)
   {
	   left=left-349;
	   width=width+349;
   }
   else
   {
       var min_top=0;
       if(tot_banner%2!=0)
        min_top=1;
		left=left+349;
		width=width-349;
//        alert(CONST_WIDTH/(tot_banner-min_top));
   }
//   alert('left='+left);
//   alert(CONST_WIDTH);
//if(tot_banner%2!=0)
//        min_top=1;
   if(left==-(CONST_WIDTH*(tot_banner-1)))
   {
		flag= false;
   }
   if(left==0)
   {
		 flag=true;
   }
   if(left%CONST_WIDTH==0)
   {
	 if(tm)
	  {
		clearTimeout(tm);
	  } 
	
	 stay();
	}
   //---------------SLIDE--------------------
   $(".slider").css("left",left);
   $(".slider").css("width",width);
   return true;
   //------------------------------------
  }
  //****************PAUSE FUNCTION***************
  function stay()
  {
   //======    EXECUTED ONLY ONCE WHEN PAGE LOADED   ================
   if(!c)                                
   { 
       c=0;
       left=0;
       width=parseInt($(".bnr1").css("width"));
	   CONST_WIDTH=parseInt($(".bnr1").css("width"));
	   flag=true;
	   CONST_COLOR_BANNER_NUMBER_LIGHT="#CC6600";           // change the light color here
	   CONST_COLOR_BANNER_NUMBER_DARK="#666666";             // change the dark color here
	   $(".slide1").css("color",CONST_COLOR_BANNER_NUMBER_DARK);
	   c++;  
   }
   //==================================================================
	   if(tm)
	   {
		clearTimeout(tm);
	   }
	tm=setTimeout("slide()",5000);         //auto slide
  }
  //**********************************************
  function baner_slide_click(n)
  {
//      alert(n);
    if(tm)
   {
    clearTimeout(tm);
   }
   left=(n-1)*(-CONST_WIDTH);
   c=n;
   width=CONST_WIDTH+(n-1)*CONST_WIDTH;
   if(n!=tot_banner)
    flag=true;
   else
    flag=false;	
   if(left%CONST_WIDTH==0)
    {
	 for(var i=1;i<=tot_banner;i++)
	  {
	   if(i==n)
	   {
	    $(".slide"+i).css("color",CONST_COLOR_BANNER_NUMBER_DARK);
	    continue;
	   }	
	    $(".slide"+i).css("color",CONST_COLOR_BANNER_NUMBER_LIGHT);	
	  }
	}
	//************ Animate on Click on number
   $(".slider").animate(
   {
	   left:left,
	   width:width
   },200);
   //****************************************
   stay(); //pause
  }