 $(document).ready(function() {
	$('.propertymap').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(1000, 1);
	  }, function () {
	    $span.stop().fadeTo(1000, 0);
	  });
	});
});
 
$(document).ready(function () {

	//Append a div with hover class to all the LI
	$('#navMenu li').append('<div class="hover"><\/div>');

	$('#navMenu li').hover(
		
		//Mouseover, fadeIn the hidden hover class	
		function() {
			
			$(this).children('div').fadeIn('200');	
		
		}, 
	
		//Mouseout, fadeOut the hover class
		function() {
		
			$(this).children('div').fadeOut('200');	
		
	}).click (function () {
	
		//Add selected class if user clicked on it
		$(this).addClass('selected');
		
	});

});

$(document).ready(function () {

	//Append a div with hover class to all the LI
	$('#subNavMenu li').append('<div class="hover"><\/div>');

	$('#subNavMenu li').hover(
		
		//Mouseover, fadeIn the hidden hover class	
		function() {
			
			$(this).children('div').fadeIn('200');	
		
		}, 
	
		//Mouseout, fadeOut the hover class
		function() {
		
			$(this).children('div').fadeOut('200');	
		
	}).click (function () {
	
		//Add selected class if user clicked on it
		$(this).addClass('selected');
		
	});

});

$(document).ready(function() {
	$('.about-us').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(1000, 1);
	  }, function () {
	    $span.stop().fadeTo(1000, 0);
	  });
	});
});

$(document).ready(function() {
	$('.portfolio').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(1000, 1);
	  }, function () {
	    $span.stop().fadeTo(1000, 0);
	  });
	});
});

$(document).ready(function() {
	$('.development').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(1000, 1);
	  }, function () {
	    $span.stop().fadeTo(1000, 0);
	  });
	});
});

$(document).ready(function() {
	$('.partnerships').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(1000, 1);
	  }, function () {
	    $span.stop().fadeTo(1000, 0);
	  });
	});
});



// when the object gains focus by the user
function handleFocus(element, value, textcolour)  {
     if (element.value == value) {
           element.value = '';
           element.style.color = textcolour;
     }
} 

//when a user loses focus of a form element
function handleBlur(element, value, textcolour) {
      if (element.value == '') {
            element.value = value;
            element.style.color = textcolour;
      }
}

//Confirm delete function
function confirmDelete(text) {
  return confirm(text)      
}

//Used for the hover div

function mouseX(evt) {
      if (!evt) evt = window.event; 
      if (evt.pageX) return evt.pageX; 
      else if (evt.clientX) return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft); 
      else return 0;
}

function mouseY(evt) {
      if (!evt) evt = window.event; 
      if (evt.pageY) return evt.pageY; 
      else if (evt.clientY) return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); 
      else return 0;
}

function followInfo(evt) {
      var offX = 20;       // X offset from mouse position
      var offY = -100;         // Y offset from mouse position      
      
      if (document.getElementById) {
            var obj = document.getElementById('infoDiv').style;                   
            obj.left = (parseInt(mouseX(evt))+offX) + 'px';
            obj.top = (parseInt(mouseY(evt))+offY) + 'px';            
      }
 
}

function show_Div(evt, text, w) {   
      offX = -(w / 2);
      
      document.onmousemove=followInfo;       
      
      if (w == 'auto') { //auto is set for images that are varying widths
            document.getElementById('infoDiv').style.width=w;
      } else {
            document.getElementById('infoDiv').style.width=w+'px';
      }
      
      document.getElementById('infoDiv').style.visibility='visible';
      document.getElementById('infoDiv').innerHTML=text 
}

function hide_Div() {
      document.getElementById('infoDiv').style.visibility='hidden'; 
      document.onmousemove=mouseY;
}

//Confirm delete function
function confirmDelete(text) {
  return confirm(text)      
}

function toUpperCase(id, element) {
    document.getElementById(id).value = element.toUpperCase();
}
