// JavaScript Document
// For preview pop up feature on homepage

this.imagePreview = function(){  
xOffset = 10;
yOffset = 30;
$(".imghover").hover(function(e){
  this.t = this.title;
  this.title = "";  
  var c = (this.t != "") ? "<br/>" + this.t : "";
  var dd = $(this).attr('rel');
  $("body").append("<p id='preview'><img src='"+ $(this).attr('rel') +"' alt='Image preview' />"+ c +"</p>");                
  $("#preview")
  .css("top",(e.pageY - xOffset) + "px")
  .css("left",(e.pageX + yOffset) + "px")
  .fadeIn("fast");            
},
function(){
  this.title = this.t;  
  $("#preview").remove();
}); 
$("a.preview").mousemove(function(e){
$("#preview")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px");
});     
};


// starting the script on page load
$(document).ready(function(){
      imagePreview();
	  // starting the script on page load
$(document).ready(function(){
imagePreview();
$('#map-about').hover(function() {$('#nav-about').css('color', '#e5b11e')}, function() {$('#nav-about').css('color', '#fff')});
$('#map-services').hover(function() {$('#nav-services').css('color', '#e5b11e')}, function() {$('#nav-services').css('color', '#fff')});
$('#map-contact').hover(function() {$('#nav-contact').css('color', '#e5b11e')}, function() {$('#nav-contact').css('color', '#fff')});
$('#map-properties').hover(function() {$('#nav-properties').css('color', '#e5b11e')}, function() {$('#nav-properties').css('color', '#fff')});
});
      });

