/****

****/




$('.contact_box').hover(function() {
  if ($(this).hasClass("active")) {
    $(this).animate({
      bottom: "-120px"
    });
    $(this).removeClass("active");
  } else {
    $(this).animate({
      bottom: '0',
    });
    $(this).addClass('active');
  }
});



$('.home_boxes section').hover(function() {
  if ($(this).hasClass("active")) {
    $(this).animate({
      marginTop: "+0px"
    });
    $(this).removeClass("active");
  } else {
    $(this).animate({
      marginTop: "-50px"
    });
    $(this).addClass('active');
  }
});





// Datepicker
$('.datepicker').datepicker({ changeMonth: true, dateFormat:'dd/mm/yy' });

  // Rotating Banners On Homepage  
 $('.banner_images').nivoSlider({
    directionNav: false,
	controlNav: false,
	pauseTime: 5000,
	effect: 'fade'
  });


$('.twitter_text').marquee({
	speed : 1,
	coefAcc : 8,
	eventAcc : 'down',
	clsSpeedDown : 'btDownVActive',
	clsSpeedUp : 'btUpVActive',
	clsDrag : 'onDrag',
	draggable : true,
	enableCookie : true,
	enableScroll : true,
	stepScroll : 10,
	enableAnimateScroll : true,
	animateScrollDuration : 250,
	animateScrollEasing : 'linear'
});

$(document).ready(function() {
  $(".contactsubmit").click(function(e) {
    e.preventDefault();
    $.post("/assets/php/contact_submit.php", {
      name: $("#contact_name").val(),
      company: $("#contact_company").val(),
      phone: $("#contact_telephone").val(),
      fax: $("#contact_fax").val(),
      email: $("#contact_email").val(),
      enquiry: $("#contact_enquiry").val()

    }, function(data) {
      if (data == "Success") {
        $(".contact_message").html("<p>Thank you for contacting T.James Telecoms.</p><p>One of our team will be in touch shortly.</p>");
      } else {
        //$(".footer_form_wrap").prepend("<p>Please make sure everything is correct and try again</p>");
      }
    })
    return false;
  });
  
  
  $(".contactsubmit").click(function(e) {
    e.preventDefault();
    $.post("/assets/php/contact_submit.php", {
      name: $("#contact_name").val(),
      phone: $("#contact_telephone").val(),
      email: $("#contact_email").val(),

    }, function(data) {
      if (data == "Success") {
        $(".contact_message").html("<p>Thank you for contacting T.James Telecoms.</p><p>One of our team will be in touch shortly.</p>");
      } else {
        //$(".footer_form_wrap").prepend("<p>Please make sure everything is correct and try again</p>");
      }
    })
    return false;
  });

  
  
});

$(".resetform").click(function(e) {
	$('form')[0].reset();
});

$('.contactsubmit').click(function() {
  $('#contactform').submit();
});



