$(document).ready(function(){

						   

	$('a[rel=external]').attr('target','_blank');

	

	// Automatic image and input[type=image] roll-over initiation

	// Grabs all <img> tags and <input type="image"> tags with the "rollOver" class

	// and sets up rollOver and active states. Image name syntaxing:

	// image_i.gif : (_i) idle image

	// image_o.gif : (_o) over image

	// image_a.gif : (_a) active image

	$('img.rollOver, input[type=image].rollOver').mouseover(function(){

		src = $(this).attr('src');

		$(this).attr('src',src.replace('_i.','_o.'));

		

	}).mouseout(function(){

		preSrc = '_o.';

		src = $(this).attr('src');

		if($(this).attr('src').indexOf('_a.') != -1) {

			preSrc = '_a.';

		}

		$(this).attr('src',src.replace(preSrc,'_i.'));

	}).not('img').mousedown(function(){

		src = $(this).attr('src');

		$(this).attr('src',src.replace('_o.','_a.'));

	}).mouseup(function(){

		src = $(this).attr('src');

		$(this).attr('src',src.replace('_a.','_i.'));

	});

	

	if($('a#cat_more')) {

		$('a#cat_more').click(function(event){

			if($('ul#category_links').is(':hidden')) {

				$('ul#category_links').slideDown();

			} else {

				$('ul#category_links').slideUp();

			}

		});

	}

	

	if($('featured_info')) {

		$('a.featureButton').click(function(event){

			if(!$(this).parent().hasClass('active')) {

				event.preventDefault();

			}

			

			var featureID = this.id.split('_')[1]

			$('#featured_images .active').add('#featured_info .active').removeClass('active');

			$('a#feature_'+featureID+'_image_link').add('#feature_'+featureID+'_info').addClass('active');

		});

	}

});



function showMedium(elem){

	var imgId = elem.id.split("_")[1];

	$('a.galleryImgMed').css('display', 'none');

	$('a#galleryImg_' + imgId).css('display', 'block');

}





var locations = new Array();

		locations.push([

		'{title}',

		'{address}',

		'{city}',

		'{state}',

		'{zipcode}',

		'{neighborhood}',

		'{phone}',

		'{website}',

		'{rating_overall}',

		'{rating_fun-factor}',

		'{rating_sweat-factor}',

		'{rating_difficulty}',

		'{rating_price}'

		]);



function createMarkers() {

  for(var i=0;i<locations.length;i++){

    if(locations[i][1] != "") {

      geocoder.getLatLng(

        [locations[i][1], locations[i][2], locations[i][3], locations[i][4]].join(" "),

        function(point){

          var marker = new GMarker(point);



          map.addOverlay(marker);



          var markerString = '<div class="gMarkerWindow">';

          markerString += '<h4 class="locationTitle">'+locations[i][0]+'</h4>';

          markerString += '<ul class="locationInformation">';

          markerString += '<li>'+locations[i][1]+'</li>';

          if(locations[i][2] != "" && locations[i][3] != "" && locations[i][4] != "") {

            markerString += '<li>'+locations[i][2]+', '+locations[i][3]+' '+locations[i][5]+'</li>';

          }

          markerString += '</ul></div>';



          marker.openInfoWindowHtml(markerString);

        }

      );

    }

  }

}