function initialize() {
	// STEH Latitude and Longitude
	var latlng = new google.maps.LatLng(30.210813,-90.932002);
	
	// Map options
	var myOptions = {
	    zoom: 15,
	    center: latlng,
	    mapTypeId: google.maps.MapTypeId.ROADMAP
	}
	
	// Where the map should be displayed
	map = new google.maps.Map(document.getElementById("google-map"), myOptions);
	
	// Adding a marker
	var marker = new google.maps.Marker({
	    position: latlng,
	    map: map, 
	    title:"St. Elizabeth Hospital"
	});
	
	// Creating an InfoWindow
	var infowindow = new google.maps.InfoWindow({
	    content: '<h2>St. Elizabeth Hospital</h2><address>1125 W Highway 30<br />Gonzales, LA 70737-5004</address><p><a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=ST+Elizabeth+Hospital,+Gonzales,+LA&amp;sll=30.210813,-90.932002&amp;sspn=0.006889,0.012574&amp;g=1125+West+Highway+30+gonzales&amp;ie=UTF8&amp;hq=ST+Elizabeth+Hospital,&amp;hnear=Gonzales,+LA&amp;ll=30.224588,-90.926456&amp;spn=0.053249,0.100594&z=14&amp;iwloc=A" target="_blank">Get Directions</a></p>'
	});
	
	// Adding a click event to the marker
	google.maps.event.addListener(marker, 'click', function() {
		// Opening the InfoWindow
	    infowindow.open(map, marker);
	});
}
// Skip setup because we are setting it manually
//Shadowbox.init({
//    skipSetup: true
//});

// Append class="selected" into <a>
// <a href="#">1</a> to <a href="#" class="selected">1</a>
function highlight(carousel, obejctli,liindex,listate){
     jQuery('.controls a:nth-child('+ liindex +')').attr("class","current");
}
// it will remove last selected slide from <a>
// <a href="#" class="selected">1</a> to <a href="#">1</a>
function removehighlight(carousel, obejctli,liindex,listate){
     jQuery('.controls a:nth-child('+ liindex +')').removeAttr("class","current");
}

/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback(carousel) {
    jQuery('.controls a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });

    jQuery('.controls select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
}
	
jQuery(document).ready(function() {
	jQuery('#carousel').jcarousel({
		// itemLoadCallback: mycarousel_itemLoadCallback,
		// initCallback: mycarousel_initCallback,
		itemVisibleInCallback:  highlight,
		itemVisibleOutCallback: removehighlight,
		buttonNextHTML: null,
		buttonPrevHTML: null,
		auto: 5,
		scroll: 1,
		animation: 1000,
		wrap: 'last'
	});
	
	var videoclip= '' ;
	
	jQuery("a[href$=.flv], a[href$=.mp4]").fancybox({
		autoDimensions	: false,
		height			: 360,
		width			: 640,
		content			: '<p id="mediaspace">The videos on this site require Flash Player 10.1. Please <a href="http://get.adobe.com/flashplayer/" target="_blank">click here</a> to update your Flash player.</p>',
		onComplete		: function() {
			videoclip = jQuery(this).attr('href');
			jQuery('#fancybox-inner').html('<p id="mediaspace">The videos on this site require Flash Player 10.1. Please <a href="http://get.adobe.com/flashplayer/" target="_blank">click here</a> to update your Flash player.</p>');
			var flashvars = { file:''+videoclip+'',autostart:'true' };
 			var params = { allowfullscreen:'true', allowscriptaccess:'always', wmode:'opaque' };
 			var attributes = { id:'mediaspace', name:'mediaspace' };
 			if (swfobject.hasFlashPlayerVersion("10")) {
			  swfobject.embedSWF('/jw/player.swf','mediaspace','640','360','10','false',flashvars, params, attributes);
			}
			else {
				jQuery('#fancybox-inner').html('<video id="mediaspace" src="'+videoclip+'" width="640" height="360" autoplay controls><p id="mediaspace">The videos on this site require Flash Player 10.1. Please <a href="http://get.adobe.com/flashplayer/" target="_blank">click here</a> to update your Flash player.</p></video>');
			}
		},
		onClosed		: function() {
			videoclip = '';
			jQuery('#fancybox-inner').html('');
		}
	});
	
	/*jQuery("a[href$=.mp4]").fancybox({
		autoDimensions	: false,
		height			: 384,
		width			: 640,
		content			: '<video id="myplayer" src="" width="640" height="360"></video>',
		onComplete		: function() {
			videoclip = jQuery(this).attr('href');
			jQuery('#fancybox-inner').html('<video id="myplayer" src="'+videoclip+'" width="640" height="360"></video>');
			jQuery('#myplayer').jwplayer({
				flashplayer	: '/jw/player.swf',
				skin		: '/jw/five/five.xml'
			});
		},
		onClosed		: function() {
			videoclip = '';
			jQuery('#fancybox-inner').html('');
		}
	}); */
	
	jQuery("a[href$=.jpg]").fancybox();
	
	// Sorting by Specialty
	$('#physician-specialties').hide();
	$('ul.specialty a').click(function(){
		$('ul.specialty li').toggleClass('open');
		$('#physician-specialties').slideToggle();
		return false;
	});
	// Click row to go to physician
	$('.find-a-physician table tr').click(function(){ 
		var href = $(this).find('a').attr('href');
		window.location=href; 
	});
	
	// Google Maps
	/* $("#google-map").gMap({
			markers: [{
				latitude: 30.210813,
				longitude: -90.932002,
				html: '<h2>St. Elizabeth Hospital</h2><address>1125 W Highway 30<br />Gonzales, LA 70737-5004</address><p><a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=ST+Elizabeth+Hospital,+Gonzales,+LA&amp;sll=30.210813,-90.932002&amp;sspn=0.006889,0.012574&amp;g=1125+West+Highway+30+gonzales&amp;ie=UTF8&amp;hq=ST+Elizabeth+Hospital,&amp;hnear=Gonzales,+LA&amp;ll=30.224588,-90.926456&amp;spn=0.053249,0.100594&z=14&amp;iwloc=A" target="_blank">Get Directions</a></p>',
				popup: false
			}],
			zoom: 15
		}); */

});
// Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17815124-1']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

