// JavaScript Document

$(document).ready(function(){
  
  $('#slides').cycle({
    fx: 'fade',
	timeout: 5000
  });
  
  var path = location.pathname.substring(1);
  if (path)
	if (path == 'contact.html')
	  $('#navigation-wrapper ul li a[@href$="' + path + '"]').addClass('selected');
	else
	  var splitPath = path.split("/");
	  var slashPath = '/';
	  var newPath = splitPath[0] + slashPath;
	  $('#navigation-wrapper ul li a[@href$="' + newPath + '"]').addClass('selected');
  
  var subpath = location.pathname.substring(1);
  $('#menu li ul li[@href$="' + subpath + '"]').addClass('active');
  
});

function jumble(){
  var a,b,c,d,e,f,g,h,i
  a='<a href=\"mai'
  b='info'
  c='\">'
  a+='lto:'
  b+='@'
  e='</a>'
  f=''
  b+='williamslakealliance.com'
  g='<img src=\"'
  h=''
  i='\" alt="Email us." border="0">'
  
  if (f) d=f
  else if (h) d=g+h+i
  else d=b
  
  document.write(a+b+c+d+e)
}

(function() {
  window.onload = function(){
    var latlng = new google.maps.LatLng(52.12534051978346, -122.14293975830078);
	var options = {
	  zoom: 14,
	  center: latlng,
	  mapTypeId: google.maps.MapTypeId.ROADMAP
	}; 
	var map = new google.maps.Map(document.getElementById('map'), options);
	var marker = new google.maps.Marker({
      position: latlng, 
      map: map,
      title: "Williams Lake Alliance Church"
    });
  }
})();

