$(function()
{	
	$('#treatments > ul > li').each(function(i)
	{
		if (i % 2 == 0)
		{
			var $this = $(this);
			
			var $group = $this.add($this.next());
			
			$group.equalizeCols();
		}
	});
	
	$('a[href^="http://"]').click(function()
	{
		var href = $(this).attr('href');
		
		if (href.indexOf('adamocheva.com') == -1)
		{
			window.open(href);
			return false;
		}
	});
	
	Map.init();
});

var Map =
{
	init:function()
	{
		if ($('#location-page #map').size())
		{
			Map.init_contact_page_map();
		}
	},
	
	init_contact_page_map:function()
	{
		if (GBrowserIsCompatible())
		{
			var map = new GMap2(document.getElementById("map"));
						
			var coordinates = new GLatLng(59.336954, 18.061942)
			
			map.setMapType(G_PHYSICAL_MAP);
			
			map.addControl(new GSmallZoomControl3D());
			
			map.setCenter(coordinates, 14);
			
			map.addOverlay(new GMarker(coordinates));
		}
	}
};


/**
 *
 * Copyright (c) 2007 Tom Deater (http://www.tomdeater.com)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 */
 
(function($) {
	/**
	 * equalizes the heights of all elements in a jQuery collection
	 * thanks to John Resig for optimizing this!
	 * usage: $("#col1, #col2, #col3").equalizeCols();
	 */
	 
	$.fn.equalizeCols = function(){
		var height = 0,
			reset = $.browser.msie ? "1%" : "auto";
  
		return this
			.css("height", reset)
			.each(function() {
				height = Math.max(height, this.offsetHeight);
			})
			.css("height", height)
			.each(function() {
				var h = this.offsetHeight;
				if (h > height) {
					$(this).css("height", height - (h - height));
				};
			});
			
	};
	
})(jQuery);