$('.map').each(function() {
	var myLatlng = new google.maps.LatLng(42.999971, -81.335564);
	var myOptions = {
		zoom: 5,
		center: myLatlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	var map = new google.maps.Map(this, myOptions);

	var marker = new google.maps.Marker({
		position: myLatlng,
		map: map,
		title: '31-1615 North Routledge Park London, Ontario N6H 5N5, Canada'
	});
});

//equalizing columns
//if($(".main").height() > $(".side").height())
//	$(".side").height($(".main").height());

//removing and restoring default input values

$(":text,textarea:not('.nodefault')").each(function(){
	this.defaultText = this.value;
	$(this)
		.focus(function() { if (this.value == this.defaultText) this.value = ""; })
		.blur(function() { if (this.value == "" && this.defaultText) this.value = this.defaultText; });
});

//pretty photo lightbox plugin init
 $("a[rel^='r']").prettyPhoto({theme: 'dark_rounded', show_title: false});

//the slider
var AniTimerInterval;

$("ul.slider").each(function() {
	var $list = $(this);

	$list.width($list.children().length * 770).wrap('<div class="clip"></div>').parent().wrap('<div class="header-slider"></div>').before('<p class="left"><a>&lt;</a></p>').after('<p class="right"><a>&gt;</a></p>');

	// fix transparent PNG files in IE6
	if ($.browser.msie && $.browser.version <= 6)
		$list.find("img[src$='.png']").each(function() { $(this).css("visibility", "hidden").closest("li").css("filter", 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + $(this).attr("src") + '", sizingMethod = "crop");'); });

	var $prev = $list.closest("div.header-slider").find("p.left a"), $next = $list.closest("div.header-slider").find("p.right a");

	$next.click(function(event, data)
	{
		if (data !== true && $list.data("timer")) {
			clearInterval($list.data("timer"));
			$list.data("timer", false);
		}

		if ($list.is(":animated"))
			return false;

		$list.animate({ left: "-770px" }, 750, function() {
			$list.children("li:first").clone(true).appendTo($list);
			$list.children("li:first").remove();
			$list.css("left", "0");
		});

		return false;
	});

	$prev.click(function(event, data) {
		if (data !== true && $list.data("timer")) {
			clearInterval($list.data("timer"));
			$list.data("timer", false);
		}

		if ($list.is(":animated"))
			return false;
		$list.children("li:last").clone(true).prependTo($list);
		$list.children("li:last").remove();
		$list.css("left", "-770px")
		$list.animate({ left: "0px" }, 750);
		return false;
	});

	$list.data("timer", setInterval(function() { $next.trigger("click", true); }, 10750));
	AniTimerInterval =$list.data("timer");
});

