$(document).ready(function() {


function mouseOverAboutUs() {
  this.src = 'images/about_hover8.png';
  $("#aboutus").css("cursor", "hand");
}
function mouseOutAboutUs() {
  this.src = 'images/about_normal8_1.png';
  $("#aboutus").css("cursor", "pointer");
}

function mouseOverServices() {
  this.src = 'images/services_hover8.png';
  $("#services").css("cursor", "hand");
}
function mouseOutServices() {
  this.src = 'images/services_normal8_1.png';
  $("#services").css("cursor", "pointer");
}
function mouseOverTeam() {
  this.src = 'images/team_hover8.png';
  $("#team").css("cursor", "hand");
}
function mouseOutTeam() {
  this.src = 'images/team_normal8_1.png';
  $("#team").css("cursor", "pointer");
}

// otherwise use this
$('#aboutus').bind('mouseover', mouseOverAboutUs).bind('mouseout', mouseOutAboutUs);
$('#services').bind('mouseover', mouseOverServices).bind('mouseout', mouseOutServices);
$('#team').bind('mouseover', mouseOverTeam).bind('mouseout', mouseOutTeam);
/*
  $("#readmore").hover(
    function () {
      //this.src = "images/read_more_hover.jpg";
      $("#readmore").css("cursor", "hand");
    }, 
    function () {
      //this.src = "images/read_more.png";
      $("#readmore").css("cursor", "pointer");
    }
*/
  $(".left").hover(
    function () {
      this.src = "images/left_arrow_hover_1.png";
    }, 
    function () {
      this.src = "images/left_arrow_1.png";
    }
  );

  $(".right").hover(
    function () {
      alert('dfdfd');   
      this.src = "images/right_arrow_hover_1.png";
    }, 
    function () {
      alert("dfdfsfsffdfdsf");
      this.src = "images/right_arrow_1.png";
    }
  );

$("#aboutus").click(function (e) {
  e.preventDefault();
  $("#preview2").remove();


      $.ajax({
        url : "?q=about_us",
        success : function (data) {

          $("#main_content").html(data);

        }
      });

  $('#aboutus').unbind('mouseover', mouseOverAboutUs).unbind('mouseout', mouseOutAboutUs);

  this.src = "images/about_hover8.png"; 
  $('#services').bind('mouseover', mouseOverServices).bind('mouseout', mouseOutServices);
  $("#services").attr('src', "images/services_normal8_1.png");
  $('#team').bind('mouseover', mouseOverTeam).bind('mouseout', mouseOutTeam);
  $("#team").attr('src', "images/team_normal8_1.png");
});

$("#services").click(function (e) {
  e.preventDefault();
  $("#preview2").remove();

      $.ajax({
        url : "?q=services",
        success : function (data) {
          $("#main_content").html(data);

        }
      });

  $('#services').unbind('mouseover', mouseOverServices).unbind('mouseout', mouseOutServices);

  this.src = "images/services_hover8.png"; 
  $('#aboutus').bind('mouseover', mouseOverAboutUs).bind('mouseout', mouseOutAboutUs);
  $("#aboutus").attr('src', "images/about_normal8_1.png");
  $('#team').bind('mouseover', mouseOverTeam).bind('mouseout', mouseOutTeam);
  $("#team").attr('src', "images/team_normal8_1.png");
});

$("#team").click(function (e) {
  e.preventDefault();
  $("#preview2").remove();

      $.ajax({
      url : "?q=team",
      success : function (data) {
        $("#main_content").html(data);

      }
      });

  $('#team').unbind('mouseover', mouseOverTeam).unbind('mouseout', mouseOutTeam);

  this.src = "images/team_hover8.png"; 
  $('#services').bind('mouseover', mouseOverServices).bind('mouseout', mouseOutServices);
  $("#services").attr('src', "images/services_normal8_1.png");
  $('#aboutus').bind('mouseover', mouseOverAboutUs).bind('mouseout', mouseOutAboutUs);
  $("#aboutus").attr('src', "images/about_normal8_1.png");
});


$('#chweb_logo').click(function() {
  $("#preview2").remove();
  $.ajax({
     url : "?q=main_content",
        success : function (data) {
          $("#main_content").html(data);
        }
     });
});

$("#chweb_logo").hover(
    function () {
      $("#chweb_logo").css("cursor", "hand");
    },
    function () {
      $("#chweb_logo").css("cursor", "pointer");
    }
);


}); // end onReady
