// JavaScript Document

$(document).ready(function() {
						   
	$('.service-main:last').css('margin-right','0px');
	
	$('.service-main h2').append('<span></span>');
	
	var serviceLengthFirst = $('.service-main h2:first').text().length;
		serviceULWidthFirst = serviceLengthFirst * 5 + 'px';
		serviceLengthLast = $('.service-main h2:last').text().length;
		serviceULWidthLast = serviceLengthLast * 5 + 'px';
		
	$('.service-main h2:first span').css('width',serviceULWidthFirst);
	$('.service-main h2:last span').css('width',serviceULWidthLast);
	
	//footer margin function------------------------------------------------------------------------------
	  function footMarg(){
	  
		 //vars for footer margin
		 var windowHeight = $(window).height();
		 var headerHeight = $('#header').outerHeight();
		 var bodyHeight = $('#content').outerHeight();
		 var footerHeight = windowHeight - headerHeight - bodyHeight;
			 
			 if (footerHeight <= 268){
				 footerHeight = 268 }
			  
		  //adding footer margin
		  $('#footer').css('height',footerHeight + 'px');
	  
	  }
	  
	  footMarg();
	  
	  //resize window... refire function
	  $(window).resize(footMarg);
	

	
	
	
});	
