// Google Map API and Custom Marker Code
	
var latlng = new google.maps.LatLng(53.6282,-1.8524136); //exact points of location http://itouchmap.com/latlong.html
var point = new google.maps.LatLng(53.6282,-1.8524136);
var myOptions = {
  zoom: 12,
  center: latlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP //can use ROADMAP, TERRAIN, SATELLITE or HYBRID 
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

var image = new google.maps.MarkerImage(
  'assets/img/map-image.png',
  new google.maps.Size(46,60),
  new google.maps.Point(0,0),
  new google.maps.Point(23,60)
);

var shadow = new google.maps.MarkerImage(
  'assets/img/map-shadow.png',
  new google.maps.Size(80,60),
  new google.maps.Point(0,0),
  new google.maps.Point(23,60)
);

var shape = {
  coord: [26,1,27,2,31,3,32,4,33,5,35,6,36,7,37,8,38,9,39,10,40,11,41,12,41,13,41,14,41,15,41,16,42,17,44,18,44,19,44,20,44,21,44,22,44,23,43,24,43,25,42,26,41,27,39,28,37,29,36,30,36,31,35,32,33,33,31,34,28,35,27,36,25,37,24,38,18,39,18,40,18,41,18,42,17,43,17,44,17,45,17,46,17,47,16,48,16,49,16,50,16,51,16,52,16,53,16,54,16,55,11,55,11,54,10,53,10,52,11,51,11,50,11,49,11,48,11,47,11,46,11,45,11,44,11,43,11,42,11,41,12,40,12,39,12,38,12,37,12,36,13,35,11,34,9,33,7,32,5,31,4,30,2,29,0,28,0,27,0,26,0,25,0,24,7,23,7,22,7,21,7,20,7,19,8,18,8,17,8,16,9,15,8,14,8,13,7,12,7,11,8,10,11,9,11,8,11,7,12,6,13,5,15,4,15,3,16,2,17,1,26,1],
  type: 'poly'
};

var marker = new google.maps.Marker({
  draggable: false,
  raiseOnDrag: false,
  icon: image,
  shadow: shadow,
  shape: shape,
  map: map,
  position: point
});
	
// Make contact form error and success messages that are absolutely positioned fade in and out.
	
$('ul#error-message').fadeIn(1000).delay(8 * 1000);

$('p#success-message').fadeIn(1000).delay(8 * 1000).slideUp(1000);
  
// Remove default values from contact form inputs on click, and re-insert them if values left empty.
	
$('input[type=text]').each( function(i) {
  var t = jQuery(this);
  var thisval = t.val();
  t.blur( function() {
	  if (t.val() == '') t.val(thisval);
  }); // end blur function
  t.focus( function() {
	  if (t.val() == thisval) t.val('');
  });// end focus function
}); //END each function

$('textarea').each( function(i) {
  var t = jQuery(this);
  var thisval = t.val();
  t.blur( function() {
	  if (t.val() == '') t.val(thisval);
  }); // end blur function
  t.focus( function() {
	  if (t.val() == thisval) t.val('');
  });// end focus function
}); //END each function	

