
var d=document, l=location, imageIndex=0,step=1;
//BANNER_IDLE_TIME=8000
//pauseBanner=false
//BANNER_MOVING_TIME=500

//var clearT;

var obj1, obj2, obj3, obj4, obj5, obj6, obj7,obj8, button1, button2, button3, button4, button5, button6, button7, button8;   

var bannerImg2, bannerLink2;

var bannerImages = numberOfBanner;

var graySmallButton ="/web/flash/banners/01_home/buttons/dot_gray_small.gif";

var blackButton = "/web/flash/banners/01_home/buttons/dot_black_big.gif";

var grayBigButton ="/web/flash/banners/01_home/buttons/dot_gray_big.gif";
 

function getImgStep(id){

    index2 = id.substr(9,1) - 0;

    return index2;

}

 

function moveOneStep(){
       if(bannerImages==1){
       } else if(bannerImages==2){

           moveOneStep2(step);

       }else if(bannerImages==3){

           moveOneStep3(step);

       }else if(bannerImages==4){

           moveOneStep4(step);

       }else if(bannerImages==5){

           moveOneStep5(step);

       }else if(bannerImages==6){

           moveOneStep6(step);         

       }else if(bannerImages==7){

           moveOneStep7(step);         

       }else if(bannerImages==8){

           moveOneStep8(step);         

       }else{

           alert("Wrong information! Please refresh the page!");

       }

}

 

function moveOneStep2(step1){

    if(step1 == 1){

    $("#img2").animate({left:'785px'},10);

       $("#img1").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

       button1.src = graySmallButton;

       button2.src = blackButton;       

    }else if(step1 == 2){

    $("#img1").animate({left:'785px'},10);

       $("#img2").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img1").animate({left:'0px'},BANNER_MOVING_TIME); 

       button2.src = graySmallButton;            

       button1.src = blackButton;              

    }else{

       alert("Please reload your page!");

    }

    step++;

    if(step> bannerImages){

       step = step - bannerImages;

    }

}

 

function moveOneStep3(step1){

    if(step1 == 1){

    $("#img2").animate({left:'785px'},10);

       $("#img1").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

       button1.src = graySmallButton;

       button2.src = blackButton;

    //  step = 2;         

    }else if(step1 == 2){

    $("#img3").animate({left:'785px'},10);

       $("#img2").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img3").animate({left:'0px'},BANNER_MOVING_TIME);

       button2.src = graySmallButton;

       button3.src = blackButton;

    //  step = 3;         

    }else if(step1 == 3){

    $("#img1").animate({left:'785px'},10);

       $("#img3").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img1").animate({left:'0px'},BANNER_MOVING_TIME); 

       button3.src = graySmallButton;            

       button1.src = blackButton;

    //  step = 1;            

    }else{

       alert("Please reload your page!");

    }

    step++;

    if(step> bannerImages){

       step = step - bannerImages;

    }

}

 

function moveOneStep4(step1){

    if(step1 == 1){

       $("#img2").animate({left:'785px'},10);

       $("#img1").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

       button1.src = graySmallButton;

       button2.src = blackButton;       

    }else if(step1 == 2){

       $("#img3").animate({left:'785px'},10);

       $("#img2").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img3").animate({left:'0px'},BANNER_MOVING_TIME);

       button2.src = graySmallButton;

       button3.src = blackButton;   

    }else if(step1 == 3){

       $("#img4").animate({left:'785px'},10);

       $("#img3").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img4").animate({left:'0px'},BANNER_MOVING_TIME); 

       button3.src = graySmallButton;            

       button4.src = blackButton;       

    }else if(step1 == 4){

       $("#img1").animate({left:'785px'},10);

       $("#img4").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img1").animate({left:'0px'},BANNER_MOVING_TIME); 

       button4.src = graySmallButton;            

       button1.src = blackButton;       

    }else{

       alert("Please reload your page!");

    }

    step++;

    if(step> bannerImages){

       step = step - bannerImages;

    }

}

 

function moveOneStep5(step1){

    if(step1 == 1){

       $("#img2").animate({left:'785px'},10);

       

       $("#img1").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

       button1.src = graySmallButton;

       button2.src = blackButton;       

    }else if(step1 == 2){

       $("#img3").animate({left:'785px'},10);

       

       $("#img2").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img3").animate({left:'0px'},BANNER_MOVING_TIME);

       button2.src = graySmallButton;

       button3.src = blackButton;       

    }else if(step1 == 3){

       $("#img4").animate({left:'785px'},10);

       

       $("#img3").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img4").animate({left:'0px'},BANNER_MOVING_TIME); 

       button3.src = graySmallButton;            

       button4.src = blackButton;          

    }else if(step1 == 4){

       $("#img5").animate({left:'785px'},10);

       

       $("#img4").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img5").animate({left:'0px'},BANNER_MOVING_TIME); 

       button4.src = graySmallButton;            

       button5.src = blackButton;          

    }else if(step1 == 5){

       $("#img1").animate({left:'785px'},10);

       

       $("#img5").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img1").animate({left:'0px'},BANNER_MOVING_TIME); 

       button5.src = graySmallButton;            

       button1.src = blackButton;          

    }else{

       alert("Please reload your page!");

    }

    step++;

    if(step> bannerImages){

       step = step - bannerImages;

    }

}

 

function moveOneStep6(step1){

    if(step1==5){

       $("#img6").animate({left:'785px'},10);

       

       $("#img5").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img6").animate({left:'0px'},BANNER_MOVING_TIME); 

       button5.src = graySmallButton;            

       button6.src = blackButton;   

       step++;

       if(step> bannerImages){

           step = step - bannerImages;

       }

    }else if(step1==6){

       $("#img1").animate({left:'785px'},10);

       

       $("#img6").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img1").animate({left:'0px'},BANNER_MOVING_TIME); 

       button6.src = graySmallButton;            

       button1.src = blackButton;

       step++;

       if(step> bannerImages){

           step = step - bannerImages;

       }          

    }else{

       moveOneStep5(step1);

    }

}

 

function moveOneStep7(step1){

    if(step1==6){

       $("#img7").animate({left:'785px'},10);

       

       $("#img6").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img7").animate({left:'0px'},BANNER_MOVING_TIME); 

       button6.src = graySmallButton;            

       button7.src = blackButton;   

       step++;

       if(step> bannerImages){

           step = step - bannerImages;

       }

    }else if(step1==7){

       $("#img1").animate({left:'785px'},10);

       

       $("#img7").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img1").animate({left:'0px'},BANNER_MOVING_TIME); 

       button7.src = graySmallButton;            

       button1.src = blackButton;

       step++;

       if(step> bannerImages){

           step = step - bannerImages;

       }          

    }else{

       moveOneStep6(step1);

    }

}

 

function moveOneStep8(step1){

    if(step1==7){

       $("#img8").animate({left:'785px'},10);

       

       $("#img7").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img8").animate({left:'0px'},BANNER_MOVING_TIME); 

       button7.src = graySmallButton;            

       button8.src = blackButton;   

       step++;

       if(step> bannerImages){

           step = step - bannerImages;

       }

    }else if(step1==8){

       $("#img1").animate({left:'785px'},10);

       

       $("#img8").animate({left:'-785px'},BANNER_MOVING_TIME);

       $("#img1").animate({left:'0px'},BANNER_MOVING_TIME); 

       button8.src = graySmallButton;            

       button1.src = blackButton;

       step++;

       if(step> bannerImages){

           step = step - bannerImages;

       }          

    }else{

       moveOneStep7(step1);

    }

}

  

function mouseClick(id){

    img = d.getElementById(id);

    index = (img.src).indexOf('black');

    index2 = getImgStep(id);

    if(index==-1){

       if(step==1){

           if(index2==2){

              moveOneStep(step);

           }else if(index2==3){

              $("#img2").animate({left:'785px'},10);

              $("#img3").animate({left:'1570px'},10);

              

              $("#img1").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'0px'},BANNER_MOVING_TIME);

              button1.src = graySmallButton;

              button3.src = blackButton;

              step = 3;

           }else if(index2==4){

              $("#img2").animate({left:'785px'},10);

              $("#img3").animate({left:'1570px'},10);

              $("#img4").animate({left:'2355px'},10);

              

              $("#img1").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'0px'},BANNER_MOVING_TIME);

              button1.src = graySmallButton;

              button4.src = blackButton;

              step = 4;

           }else if(index2==5){

              $("#img2").animate({left:'785px'},10);

              $("#img3").animate({left:'1570px'},10);

              $("#img4").animate({left:'2355px'},10);

              $("#img5").animate({left:'3140px'},10);              

              

              $("#img1").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'0px'},BANNER_MOVING_TIME);

              button1.src = graySmallButton;

              button5.src = blackButton;

              step = 5;

           }else if(index2==6){ 

              $("#img2").animate({left:'785px'},10);

              $("#img3").animate({left:'1570px'},10);

              $("#img4").animate({left:'2355px'},10);

              $("#img5").animate({left:'3140px'},10);   

              $("#img6").animate({left:'3925px'},10);

              

              $("#img1").animate({left:'-3925px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'0px'},BANNER_MOVING_TIME);

              button1.src = graySmallButton;

              button6.src = blackButton;

              step = 6;

           }else if(index2==7){ 

              $("#img2").animate({left:'785px'},10);

              $("#img3").animate({left:'1570px'},10);

              $("#img4").animate({left:'2355px'},10);

              $("#img5").animate({left:'3140px'},10);   

              $("#img6").animate({left:'3925px'},10);

              $("#img7").animate({left:'4710px'},10);

              

              $("#img1").animate({left:'-4710px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'-3925px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'0px'},BANNER_MOVING_TIME);

              button1.src = graySmallButton;

              button7.src = blackButton;

              step = 7;

           }else if(index2==8){ 

              $("#img2").animate({left:'785px'},10);

              $("#img3").animate({left:'1570px'},10);

              $("#img4").animate({left:'2355px'},10);

              $("#img5").animate({left:'3140px'},10);   

              $("#img6").animate({left:'3925px'},10);

              $("#img7").animate({left:'4710px'},10);

              $("#img8").animate({left:'5495px'},10);              

              

              $("#img1").animate({left:'-5495px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'-4710px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-3925px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img8").animate({left:'0px'},BANNER_MOVING_TIME);           

              button1.src = graySmallButton;

              button8.src = blackButton;

              step = 8;

           }

       }else if(step==2){

           if(index2==3){

              moveOneStep(step);

           }else if(index2==1){

              //obj1.setAttribute("style","position:absolute; "+"left: "+"-785px;");

              $("#img1").animate({left:'-785px'},10);   

                         

              $("#img1").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'1570px'},BANNER_MOVING_TIME);

              button2.src = graySmallButton;

              button1.src = blackButton;

              step = 1;

           }else if(index2==4){

              $("#img3").animate({left:'785px'},10);

              $("#img4").animate({left:'1570px'},10);

              

              $("#img2").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'0px'},BANNER_MOVING_TIME);

              button2.src = graySmallButton;

              button4.src = blackButton;

              step = 4;

           }else if(index2==5){

              $("#img3").animate({left:'785px'},10);

              $("#img4").animate({left:'1570px'},10);

              $("#img5").animate({left:'2355px'},10);          

              

              $("#img2").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'0px'},BANNER_MOVING_TIME);

              button2.src = graySmallButton;

              button5.src = blackButton;

              step = 5;

           }else if(index2==6){

              $("#img3").animate({left:'785px'},10);

              $("#img4").animate({left:'1570px'},10);

              $("#img5").animate({left:'2355px'},10);          

              $("#img6").animate({left:'3140px'},10);   

              

              $("#img2").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'0px'},BANNER_MOVING_TIME);

              

              button2.src = graySmallButton;

              button6.src = blackButton;

              step = 6;

           }else if(index2==7){ 

              $("#img3").animate({left:'785px'},10);

              $("#img4").animate({left:'1570px'},10);

              $("#img5").animate({left:'2355px'},10);

              $("#img6").animate({left:'3140px'},10);   

              $("#img7").animate({left:'3925px'},10);

              

              $("#img2").animate({left:'-3925px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'0px'},BANNER_MOVING_TIME);

              button2.src = graySmallButton;

              button7.src = blackButton;

              step = 7;

           }else if(index2==8){

              $("#img3").animate({left:'785px'},10);

              $("#img4").animate({left:'1570px'},10);

              $("#img5").animate({left:'2355px'},10);

              $("#img6").animate({left:'3140px'},10);   

              $("#img7").animate({left:'3925px'},10);

              $("#img8").animate({left:'4710px'},10);       

               

              $("#img2").animate({left:'-4710px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'-3925px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img8").animate({left:'0px'},BANNER_MOVING_TIME);           

              button2.src = graySmallButton;

              button8.src = blackButton;

              step = 8;

           }

       }else if(step==3){

           if(index2==2){

              //obj2.setAttribute("style","position:absolute; "+"left: "+"-785px;");    

              $("#img2").animate({left:'-785px'},10);   

                  

              $("#img1").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'785px'},BANNER_MOVING_TIME);

              button3.src = graySmallButton;

              button2.src = blackButton;

              step = 2;

           }else if(index2==1){

              $("#img1").animate({left:'-1570px'},10);

              $("#img2").animate({left:'-785px'},10);

              

              $("#img1").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'1570px'},BANNER_MOVING_TIME);

              button3.src = graySmallButton;

              button1.src = blackButton;

              step = 1;            

           }else if(index2==4){

              moveOneStep(step);

           }else if(index2==5){

              $("#img4").animate({left:'785px'},10);

              $("#img5").animate({left:'1570px'},10);       

              

              $("#img3").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'0px'},BANNER_MOVING_TIME);

              button3.src = graySmallButton;

              button5.src = blackButton;

              step = 5;

           }else if(index2==6){

              $("#img4").animate({left:'785px'},10);

              $("#img5").animate({left:'1570px'},10);          

              $("#img6").animate({left:'2355px'},10);   

              

              $("#img3").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'0px'},BANNER_MOVING_TIME);

              button3.src = graySmallButton;

              button6.src = blackButton;

              step = 6;

           }else if(index2==7){ 

              $("#img4").animate({left:'785px'},10);

              $("#img5").animate({left:'1570px'},10);

              $("#img6").animate({left:'2355px'},10);

              $("#img7").animate({left:'3140px'},10);   

              

              $("#img3").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'0px'},BANNER_MOVING_TIME);

              button3.src = graySmallButton;

              button7.src = blackButton;

              step = 7;

            }else if(index2==8){

              $("#img4").animate({left:'785px'},10);

              $("#img5").animate({left:'1570px'},10);

              $("#img6").animate({left:'2355px'},10);

              $("#img7").animate({left:'3140px'},10);   

              $("#img8").animate({left:'3925px'},10);

              

              $("#img3").animate({left:'-3925px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img8").animate({left:'0px'},BANNER_MOVING_TIME);            

              button3.src = graySmallButton;

              button8.src = blackButton;

              step = 8;

           }

       }else if(step==4){

           if(index2==1){

              $("#img1").animate({left:'-2355px'},10);  

              $("#img2").animate({left:'-1570px'},10);

              $("#img3").animate({left:'-785px'},10);

              

              $("#img1").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'2355px'},BANNER_MOVING_TIME);            

              button4.src = graySmallButton;

              button1.src = blackButton;

              step = 1;         

           }else if(index2==2){

              $("#img2").animate({left:'-1570px'},10);

              $("#img3").animate({left:'-785px'},10);

              

              $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'1570px'},BANNER_MOVING_TIME);     

              button4.src = graySmallButton;

              button2.src = blackButton;

              step = 2;         

           }else if(index2==3){

              $("#img3").animate({left:'-785px'},10);

              

              $("#img3").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'785px'},BANNER_MOVING_TIME);

              button4.src = graySmallButton;

              button3.src = blackButton;

              step = 3;  

           }else if(index2==5){

              moveOneStep(step);

           }else if(index2==6){

              $("#img5").animate({left:'785px'},10);        

              $("#img6").animate({left:'1570px'},10);   

              

              $("#img4").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'0px'},BANNER_MOVING_TIME);

              button4.src = graySmallButton;

              button6.src = blackButton;

              step = 6;

           }else if(index2==7){ 

              $("#img5").animate({left:'785px'},10);

              $("#img6").animate({left:'1570px'},10);

              $("#img7").animate({left:'2355px'},10);

              

              $("#img4").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'0px'},BANNER_MOVING_TIME);

              button4.src = graySmallButton;

              button7.src = blackButton;

              step = 7;

           }else if(index2==8){ 

              $("#img5").animate({left:'785px'},10);

              $("#img6").animate({left:'1570px'},10);

              $("#img7").animate({left:'2355px'},10);

              $("#img8").animate({left:'3140px'},10);   

              

              $("#img4").animate({left:'-3140px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img8").animate({left:'0px'},BANNER_MOVING_TIME);           

              button4.src = graySmallButton;

              button8.src = blackButton;

              step = 8;

           }

       }else if(step==5){

           if(index2==1){

              $("#img1").animate({left:'-3140px'},10);         

              $("#img2").animate({left:'-2355px'},10);  

              $("#img3").animate({left:'-1570px'},10);

              $("#img4").animate({left:'-785px'},10);

              

              $("#img1").animate({left:'0px'},BANNER_MOVING_TIME);

               $("#img2").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'2355px'},BANNER_MOVING_TIME);            

              $("#img5").animate({left:'3140px'},BANNER_MOVING_TIME); 

              button5.src = graySmallButton;

              button1.src = blackButton;

              step = 1;         

           }else if(index2==2){

              $("#img2").animate({left:'-2355px'},10);  

              $("#img3").animate({left:'-1570px'},10);

              $("#img4").animate({left:'-785px'},10);

              

              $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'1570px'},BANNER_MOVING_TIME); 

              $("#img5").animate({left:'2355px'},BANNER_MOVING_TIME);                   

              button5.src = graySmallButton;

              button2.src = blackButton;

              step = 2;         

           }else if(index2==3){

              $("#img3").animate({left:'-1570px'},10);

              $("#img4").animate({left:'-785px'},10);

              

              $("#img3").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'1570px'},BANNER_MOVING_TIME);               

              button5.src = graySmallButton;

              button3.src = blackButton;

              step = 3;

           }else if(index2==4){

              $("#img4").animate({left:'-785px'},10);

              

              $("#img4").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'785px'},BANNER_MOVING_TIME);             

              button5.src = graySmallButton;

              button4.src = blackButton;

              step = 4;  

           }else if(index2==6){

              moveOneStep(step);

           }else if(index2==7){ 

              $("#img6").animate({left:'785px'},10);

              $("#img7").animate({left:'1570px'},10);

              

              $("#img5").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'0px'},BANNER_MOVING_TIME);

              button5.src = graySmallButton;

              button7.src = blackButton;

              step = 7;

           }else if(index2==8){ 

              $("#img6").animate({left:'785px'},10);

              $("#img7").animate({left:'1570px'},10);

              $("#img8").animate({left:'2355px'},10);

              

              $("#img5").animate({left:'-2355px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img8").animate({left:'0px'},BANNER_MOVING_TIME);           

              button5.src = graySmallButton;

              button8.src = blackButton;

              step = 8;

           }

       }else if(step==6){

           if(index2==1){

              $("#img1").animate({left:'-3925px'},10);         

              $("#img2").animate({left:'-3140px'},10);  

              $("#img3").animate({left:'-2355px'},10);

              $("#img4").animate({left:'-1570px'},10);

              $("#img5").animate({left:'-785px'},10);

              

              $("#img1").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'2355px'},BANNER_MOVING_TIME);            

              $("#img5").animate({left:'3140px'},BANNER_MOVING_TIME); 

              $("#img6").animate({left:'3925px'},BANNER_MOVING_TIME); 

              button6.src = graySmallButton;

              button1.src = blackButton;

              step = 1;         

           }else if(index2==2){

              $("#img2").animate({left:'-3140px'},10);  

              $("#img3").animate({left:'-2355px'},10);

              $("#img4").animate({left:'-1570px'},10);

              $("#img5").animate({left:'-785px'},10);

              

              $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'1570px'},BANNER_MOVING_TIME); 

              $("#img5").animate({left:'2355px'},BANNER_MOVING_TIME); 

              $("#img6").animate({left:'3140px'},BANNER_MOVING_TIME);               

              button6.src = graySmallButton;

              button2.src = blackButton;

              step = 2;         

           }else if(index2==3){

              $("#img3").animate({left:'-2355px'},10);

              $("#img4").animate({left:'-1570px'},10);

              $("#img5").animate({left:'-785px'},10);

              

              $("#img3").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'1570px'},BANNER_MOVING_TIME);               

              $("#img6").animate({left:'2355px'},BANNER_MOVING_TIME); 

              button6.src = graySmallButton;

              button3.src = blackButton;

              step = 3;  

           }else if(index2==4){

              $("#img4").animate({left:'-1570px'},10);

              $("#img5").animate({left:'-785px'},10);

              

              $("#img4").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'785px'},BANNER_MOVING_TIME);  

              $("#img6").animate({left:'1570px'},BANNER_MOVING_TIME);

              button6.src = graySmallButton;

              button4.src = blackButton;

              step = 4;  

           }else if(index2==5){

              $("#img5").animate({left:'-785px'},10);

              

              $("#img5").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'785px'},BANNER_MOVING_TIME);  

              button6.src = graySmallButton;

              button5.src = blackButton;

              step = 5;  

           }else if(index2==7){

              moveOneStep(step);

           }else if(index2==8){ 

              $("#img7").animate({left:'785px'},10);

              $("#img8").animate({left:'1570px'},10);

              

              $("#img6").animate({left:'-1570px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'-785px'},BANNER_MOVING_TIME);

              $("#img8").animate({left:'0px'},BANNER_MOVING_TIME);           

              button6.src = graySmallButton;

              button8.src = blackButton;

              step = 8;

           }

       }else if(step==7){

           if(index2==1){

              $("#img1").animate({left:'-4710px'},10);         

              $("#img2").animate({left:'-3925px'},10);  

              $("#img3").animate({left:'-3140px'},10);

              $("#img4").animate({left:'-2355px'},10);

              $("#img5").animate({left:'-1570px'},10);

              $("#img6").animate({left:'-785px'},10);

              

              $("#img1").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'2355px'},BANNER_MOVING_TIME);            

              $("#img5").animate({left:'3140px'},BANNER_MOVING_TIME); 

              $("#img6").animate({left:'3925px'},BANNER_MOVING_TIME); 

              $("#img7").animate({left:'4710px'},BANNER_MOVING_TIME);

              button7.src = graySmallButton;

              button1.src = blackButton;

              step = 1;         

           }else if(index2==2){        

              $("#img2").animate({left:'-3925px'},10);  

              $("#img3").animate({left:'-3140px'},10);

              $("#img4").animate({left:'-2355px'},10);

              $("#img5").animate({left:'-1570px'},10);

              $("#img6").animate({left:'-785px'},10);

              

              $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'2355px'},BANNER_MOVING_TIME);            

              $("#img6").animate({left:'3140px'},BANNER_MOVING_TIME); 

              $("#img7").animate({left:'3925px'},BANNER_MOVING_TIME); 

              button7.src = graySmallButton;

              button2.src = blackButton;

              step = 2;         

           }else if(index2==3){            

              $("#img3").animate({left:'-3140px'},10);

              $("#img4").animate({left:'-2355px'},10);

              $("#img5").animate({left:'-1570px'},10);

              $("#img6").animate({left:'-785px'},10);

              

              $("#img3").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'2355px'},BANNER_MOVING_TIME);            

              $("#img7").animate({left:'3140px'},BANNER_MOVING_TIME); 

              button7.src = graySmallButton;

              button3.src = blackButton;

              step = 3;         

           }else if(index2==4){            

              $("#img4").animate({left:'-2355px'},10);

              $("#img5").animate({left:'-1570px'},10);

              $("#img6").animate({left:'-785px'},10);

              

              $("#img4").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'2355px'},BANNER_MOVING_TIME);            

              button7.src = graySmallButton;

              button4.src = blackButton;

              step = 4;         

           }else if(index2==5){            

              $("#img5").animate({left:'-1570px'},10);

              $("#img6").animate({left:'-785px'},10);

               

              $("#img5").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'1570px'},BANNER_MOVING_TIME);            

              button7.src = graySmallButton;

              button5.src = blackButton;

              step = 5;     

           }else if(index2==6){            

              $("#img6").animate({left:'-785px'},10);

              

              $("#img6").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'785px'},BANNER_MOVING_TIME);         

              button7.src = graySmallButton;

              button6.src = blackButton;

              step = 6;     

           }else if(index2==8){

              moveOneStep(step);

           }

       }else if(step==8){

           if(index2==1){

              $("#img1").animate({left:'-5495px'},10);         

              $("#img2").animate({left:'-4710px'},10);  

              $("#img3").animate({left:'-3925px'},10);

              $("#img4").animate({left:'-3140px'},10);

              $("#img5").animate({left:'-2355px'},10);

              $("#img6").animate({left:'-1570px'},10);

              $("#img7").animate({left:'-785px'},10);

              

              $("#img1").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img2").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'2355px'},BANNER_MOVING_TIME);            

              $("#img5").animate({left:'3140px'},BANNER_MOVING_TIME); 

              $("#img6").animate({left:'3925px'},BANNER_MOVING_TIME); 

              $("#img7").animate({left:'4710px'},BANNER_MOVING_TIME);

              $("#img8").animate({left:'5495px'},BANNER_MOVING_TIME);

              button8.src = graySmallButton;

              button1.src = blackButton;

              step = 1;         

           }else if(index2==2){        

              $("#img2").animate({left:'-4710px'},10);  

              $("#img3").animate({left:'-3925px'},10);

              $("#img4").animate({left:'-3140px'},10);

              $("#img5").animate({left:'-2355px'},10);

              $("#img6").animate({left:'-1570px'},10);

              $("#img7").animate({left:'-785px'},10);

              

              $("#img2").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img3").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'2355px'},BANNER_MOVING_TIME);            

              $("#img6").animate({left:'3140px'},BANNER_MOVING_TIME); 

              $("#img7").animate({left:'3925px'},BANNER_MOVING_TIME); 

              $("#img8").animate({left:'4710px'},BANNER_MOVING_TIME);

              button8.src = graySmallButton;

              button2.src = blackButton;

              step = 2;         

           }else if(index2==3){            

              $("#img3").animate({left:'-3925px'},10);

              $("#img4").animate({left:'-3140px'},10);

              $("#img5").animate({left:'-2355px'},10);

              $("#img6").animate({left:'-1570px'},10);

              $("#img7").animate({left:'-785px'},10);

              

               $("#img3").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img4").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'2355px'},BANNER_MOVING_TIME);            

              $("#img7").animate({left:'3140px'},BANNER_MOVING_TIME); 

              $("#img8").animate({left:'3925px'},BANNER_MOVING_TIME); 

              button8.src = graySmallButton;

              button3.src = blackButton;

              step = 3;         

           }else if(index2==4){            

              $("#img4").animate({left:'-3140px'},10);

              $("#img5").animate({left:'-2355px'},10);

              $("#img6").animate({left:'-1570px'},10);

              $("#img7").animate({left:'-785px'},10);

              

              $("#img4").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img5").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'2355px'},BANNER_MOVING_TIME);            

              $("#img8").animate({left:'3140px'},BANNER_MOVING_TIME);                   

              button8.src = graySmallButton;

              button4.src = blackButton;

              step = 4;         

           }else if(index2==5){            

              $("#img5").animate({left:'-2355px'},10);

              $("#img6").animate({left:'-1570px'},10);

              $("#img7").animate({left:'-785px'},10);

               

              $("#img5").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img6").animate({left:'785px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'1570px'},BANNER_MOVING_TIME);

              $("#img8").animate({left:'2355px'},BANNER_MOVING_TIME);                      

              button8.src = graySmallButton;

              button5.src = blackButton;

              step = 5;     

           }else if(index2==6){            

              $("#img6").animate({left:'-1570px'},10);

              $("#img7").animate({left:'-785px'},10);

              

              $("#img6").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img7").animate({left:'785px'},BANNER_MOVING_TIME);  

              $("#img8").animate({left:'1570px'},BANNER_MOVING_TIME);     

              button8.src = graySmallButton;

              button6.src = blackButton;

              step = 6;     

           }else if(index2==7){            

              $("#img7").animate({left:'-785px'},10);

              

              $("#img7").animate({left:'0px'},BANNER_MOVING_TIME);

              $("#img8").animate({left:'785px'},BANNER_MOVING_TIME);      

              button8.src = graySmallButton;

              button7.src = blackButton;

              step = 7;     

           }

       }

       setT();

    }

}

 

function setT(){

    if(clearT!=null){

       clearTimeout(clearT);

    }

    clearT = setTimeout("bannerRotate()", BANNER_IDLE_TIME);

}

function mouseOver(id){

    img = d.getElementById(id);

    pauseBanner = true;

    index = (img.src).indexOf('black');

    if(index==-1){

       img.src = grayBigButton;

    }

}

function mouseOut(id){

    img = d.getElementById(id);

    index = (img.src).indexOf('black');    

    if(index==-1){    

       img.src = graySmallButton;

    }

    pauseBanner = false;

    //setTimeout("bannerRotate()", BANNER_IDLE_TIME);

    setT();

}

function bannerMoving() {

    if(!pauseBanner){

       moveOneStep();

    }

    setT();

}

 

function bannerStepMM() {

    link1 = d.getElementById('bannerLink');

    var bannerLinks = new Array();

    bannerLinks[0] = "/shopping/PrsShpInt_NewAccess.page?int=isp_sa_Q3_WirelessHomeNet_hmpg_tile1_np_fr_Sept30&amp;userType=NEW";

    bannerLinks[1] = "/shopping/PrsShpTv_Dth_Equipment_Landing.page?INT=XVU_SA_Q3_RECORD_BAN_HMPG_til2_np_EN_Aug25";

    bannerLinks[2] = "http://www.socializer.ca/?INT=MOB_SA_Q3_SAMINST_BAN_HMPG_tile3_np_EN_Sept30";

    bannerLinks[3] = "http://smbcontest.bell.ca/en?BTCID=EN_MAKEOVER_BELLCA";
    
    bannerMoving();

    

}

 

function bannerRotate() {

    if(!pauseBanner){

       imageIndex++;

       if(imageIndex>=bannerImages){

          imageIndex = imageIndex - bannerImages;          

        }

        bannerStepMM();          
 
    }

}

 

function isGomez() {

    return navigator.userAgent.toLowerCase().indexOf("gomez") >= 0

}

 

function onloadMethod(){

    obj1 = d.getElementById('img1');

    obj2 = d.getElementById('img2');

    obj3 = d.getElementById('img3');

    obj4 = d.getElementById('img4');   

    obj5 = d.getElementById('img5');

    obj6 = d.getElementById('img6');

    obj7 = d.getElementById('img7');   

    obj8 = d.getElementById('img8');          

    button1 = d.getElementById('buttonImg1');

    button2 = d.getElementById('buttonImg2');

    button3 = d.getElementById('buttonImg3');

    button4 = d.getElementById('buttonImg4'); 

    button5 = d.getElementById('buttonImg5'); 

    button6 = d.getElementById('buttonImg6');

    button7 = d.getElementById('buttonImg7'); 

    button8 = d.getElementById('buttonImg8'); 

    bannerImg2 = d.getElementById('bannerImg2');

    bannerLink2 = d.getElementById('bannerLink2'); 

 

    if(!isGomez()){

       //setTimeout(getBannerImageUrl, 2000);

       setTimeout(bannerRotate, BANNER_IDLE_TIME);

    }

    loadImages();

}

 

// Load images

function loadImages(){

    var submitImage = d.getElementById('submit_image');

    if(submitImage !=null){

    submitImage.src = "/web/images/en/bt_loginSubmit.gif";

}

}

 

function getBannerImageUrl() {

 

}

 

