$(document).ready(function(){
  
    $("#arrow_right").click(function(){
      $("#thumb_container").scrollTo( '+=735px', 1000, {axis:'x'} )
    });
    
    $("#arrow_left").click(function(){
      $("#thumb_container").scrollTo( '-=735px', 1000, {axis:'x'} )
    });	  
  
    $('#enquiry_form a').click(function() {
      $('#request_info_hidden').toggle('slow', function() {});
      return false;
    });
  
    if($("#mldlyr-mldlyr").val() != ''){
        $("#mldlyr-mldlyr").css('background-image', 'none');     
     }
    
    $("#mldlyr-mldlyr").focus(function () {
        $("#mldlyr-mldlyr").css('background-image', 'none');       
    });    
    
    var i = "1";
    var j = "1";
    
    $('#s1').cycle({ 
    pager:  '.news_items',
    timeout:  7000,
    before: onBefore
    });
    
    $('#news_ticker').cycle({ 
      timeout:  5000,
      delay:  2500 
    });

function onBefore() {    
       
    link_text = this.title;
    alt_text = this.alt;
    
    link_html = '<a href="' + link_text + '">' + alt_text + '</a>';
    
    $('#title').html(link_html); 
    
    if (j != "3") {
      j = i - 1;
    } else {
      j = 4;
    }
    
    $('#thumb' + j).removeClass("current");   
    $('#thumb' + i).addClass("current");
    
    
    if (j == "4") {
      j = "1";
    }
    
    if (i == "4") {
      i = "1";
    } else {
      i++;
    }  

};


    $('#testimonial_rotation').cycle({ 
    timeout:  7000
    });

    $('#test_rotate').cycle({ 
    timeout:  7000
    });
    

// $("tr:nth-child(odd)").addClass("odd");

});
