// JavaScript Document

$(document).ready(function(){
  
// Services Tabs
$('#tabs').tabs();



//HIDDEN FORM
  $(function() {
	  
	  $('#getQoute').click(function() {
		  $('#getQoute').css({backgroundColor: "#e8aa17"})
		  $('#qouteForm').delay(700).slideDown( 500, 'linear');
	  });
	  $('#butSlideUp').click(function() {
		  $('#getQoute').css({backgroundColor: "#ed1c24"})
		  $('#qouteForm').delay(1000).slideUp( 1000, 'linear');
	  });
	  $('a[href=#scrolldown]').click(function() {
		  $.scrollTo('#footer', 1000);
	  });
	  $('a[href=#scrollup]').click(function() {
		  $.scrollTo(0, 1000);
	  });

  });
//END OF HIDDEN FORM

//WEBSITE GALLERY SLIDESHOW
  setInterval("rotateWebsiteImg()", 5000);
  
//WEBSITE GALLERY DESCRIPTION  
  setInterval("rotateWebsiteText()", 5000);
  
//service description slide-ups  
var slideTextWeb = $("<p>Web design is what defines how your web site will look to users. It is web design that helps create the first (and overall!) impression of business and your services. That's why I work closely with my clients to develop web sites which suits their requirements and implements the latest innovations in design techniques. </p>");

$('#serviceWebDesign').hover(function(){
    
   // Mouse over function
   $('#addInfo1').show();
   $('#addInfo1').animate(
      {marginTop: "135px", height: "144px", opacity: "0.8"}, 400, "linear" );
   $('#addInfo1').html(slideTextWeb.html()).css({paddingTop: "6px", paddingLeft: "10px", paddingRight: "10px"});
	}, function() { 
   // Mouse out function
   $('#addInfo1').delay(300).animate(
     {marginTop: "279px", height: "0px", opacity: "0.8"}, 400, "linear" );
   $('#addInfo1').fadeOut(50);
    });

// SERVICE BRANDING

var slideTextBranding = $("<p>Logos help to build up your image and make you recognisable as a brand. Many factors should be taken into account when creating a logo and an individual style and this can prove difficult if not handled correctly.  I produced up to 6 different concept designs based on clients likes and dislikes. Then when the clients chooses the concept they like I produced a final polished logo that they can use for their business.</p>");

$('#serviceBranding').hover(function(){
    
   // Mouse over function
   $('#addInfo2').show();
   $('#addInfo2').animate(
      {marginTop: "135px", height: "144px", opacity: "0.8"}, 400, "linear" );
   $('#addInfo2').html(slideTextBranding.html()).css({paddingTop: "6px", paddingLeft: "10px", paddingRight: "10px"});
	}, function() { 
   // Mouse out function
   $('#addInfo2').delay(300).animate(
     {marginTop: "279px", height: "0px", opacity: "0.8"}, 400, "linear" );
   $('#addInfo2').fadeOut(50);
    });


// SERVICE E-COMMERCE

var slideTextEcommerce = $("<p>You need to make sure that you get the best out of your E-commerce website design. You want your visitors to be able to navigate around your store easily, to find your products and to do business with you online. Lewis Design Online will help your E-commerce website achieve this, promoting your best selling and latest items combined with featured and related products to give an unrivalled service from your online store.</p>");

$('#serviceEcommerce').hover(function(){
    
   // Mouse over function
   $('#addInfo3').show();
   $('#addInfo3').animate(
      {marginTop: "135px", height: "144px", opacity: "0.8"}, 400, "linear" );
   $('#addInfo3').html(slideTextEcommerce.html()).css({paddingTop: "6px", paddingLeft: "10px", paddingRight: "10px"});
	}, function() { 
   // Mouse out function
   $('#addInfo3').delay(300).animate(
     {marginTop: "279px", height: "0px", opacity: "0.8"}, 400, "linear" );
   $('#addInfo3').fadeOut(50);
    });

// Get current year for copyright info
var thisYear = new Date();
var year = thisYear.getFullYear();
var year_span = document.getElementById("currentYear");
year_span.innerHTML = year;


// validate contact form
//


 



  

//END OFDOCUMENT READY  
});






//WEBSITE GALLERY SLIDESHOW
    function rotateWebsiteImg() {
    
    var currPhoto = $('#websites_slideshow div.current');
    var nxtPhoto = currPhoto.next();
      if (nxtPhoto.length == 0)
	nxtPhoto = $('#websites_slideshow div:first');
	
    currPhoto.removeClass('current').addClass('previous');
    nxtPhoto.css({opacity:0.0}).addClass('current').animate({opacity:1.0}, 1000,
	function() {
	    currPhoto.removeClass('previous');

	});
    };

//WEBSITE GALLERY DESCRIPTION 
  function rotateWebsiteText() {
    
  var currText = $('#text div.current');
  var nxtText = currText.next();
      if (nxtText.length == 0)
	nxtText = $('#text div:first');
	
    currText.removeClass('current').addClass('previous');
    nxtText.addClass('current');
    currText.removeClass('previous');
    
/*    nxtText.css({opacity:0.0}).addClass('current').animate({opacity:1.0}, 1000,
	function() {
	    currText.removeClass('previous');

	});  */  
  };    
    
    
    
    

	    
    

  
  /*

  $('#services').hover(function(){ 
    // Mouse over function
	  $('.addInfo').css({opacity:1.0}).animate(
      {height: "100px"}, 1000, "swing" );
  }, function() { 
	  // Mouse out function
	  var leftPosition = $('#nav a.selected').position().left;
	  $('#nav_blob').animate(
      {width: $('#nav li:first a').width() + 20},
			{duration:'slow', easing: 'easeOutCirc', queue:false}
		).animate({left: leftPosition}, 'fast' );
  });
   */




