	  function initializeMap(mapID){
		var latlng = new google.maps.LatLng(40.199872,-75.118127);
		var myOptions = {
		  zoom: 12,
		  center: latlng,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById(mapID),
			myOptions);
			
		 var marker = new google.maps.Marker({
			position: latlng,
			title:"Hello World!"
		});

		// To add the marker to the map, call setMap();
		marker.setMap(map)
	  }
	  
$(document).ready(function(){
	if($('.slider').length){
		$('.slider')
		.cycle({ 
			speed:  1000,
			fx: 'fade',
			timeout: 9000,
			pause: 1,
			delay: 5000,
			pager:  '#slider-control',
			cleartype:  true
		});
		$('#slider-control a').each(function(e){
			$(this).text(e+1).css("text-align","center").css("padding-top","0px").css("height","20px").css("width","12px");
			$(this).css({'text-decoration':'none','color':'#000','background-color':'#fff','font-family':'sans-serif'});			
		});
	}

	$('form').validate();
/**/
	//Font Resizer
	var originalFontSize = $('.content-slider').css('font-size');
	
	function fontSizeReset(){
		 $('.content-slider').css('font-size', originalFontSize);
	}

	function fontSizeIncrease(){
		var currentFontSize = $('.content-slider').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum * 1.5;
		$('.content-slider').css('font-size', newFontSize);
		return false;		
	}

	function fontSizeDecrease(){
		var currentFontSize = $('.content-slider').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum * 0.8;
		$('.content-slider').css('font-size', newFontSize);
		return false;			
	}
	
	$('.content-slider h3:first-child').prepend('<p id="sizer">Resize Text:&nbsp;&nbsp;&nbsp;&nbsp;<span id="smaller">A</span>&nbsp;&nbsp;|&nbsp;&nbsp;<span id="reset">A</span>&nbsp;&nbsp;|&nbsp;&nbsp;<span id="bigger">A</span><p>');

	$('#smaller').click(function(){
		fontSizeDecrease();
		return false;
	});

	$('#reset').click(function(){
		fontSizeReset();
		return false;
	});

	$('#bigger').click(function(){
		fontSizeIncrease();
		return false;
	});



	if($('#map').length){
		initializeMap('map');
	}

	if($('#map2').length){
		initializeMap('map2');
	}


	
	
	$('#nav-main li a').mouseenter(function(){
		$(this).parent().find('span.nub').toggleClass('on');
	})
	.mouseleave(function(){
		$(this).parent().find('span.nub').toggleClass('on');
	});
	

	
	
	/*
	if(0){
		$('.div-switcher')
		.cycle({ 
			speed:  100,
			fx: 'fade',
			timeout: 0
		});
		
		$('.tabs li').click(function(){
			var slide = $(this).index();
			$('.div-switcher').cycle(slide);
			$('.tabs li.on').removeClass('on');
			$(this).addClass('on');
			resizeds(slide);
		});
		
		function resizeds(slide){
			var tabheight = $('li.tabed:eq(' + slide + ')').outerHeight();
			alert(tabheight);
			//$('.content-slider').css('height',tabheight);		
		}
		
	}
	*/
	if($('.sub-slider').length){
		$('.sub-slider')
		.cycle({ 
			speed:  1000,
			fx: 'fade',
			delay: 3000
		});
	}
	
	
	//---------------------  SCHEDULE A VISIT
	if($('#questions').length){
		var allow = false;
		var error = false;
		
		$('ul#questions').change(function(){
			allow = true;
		});
		
		$('#questions-next').click(function(){
			if(allow){
				$('#questions').cycle('next');
				allow = false;
				error = false;
			}
			else{
				if(!error){
					$('.counter').append(' <span class="error">This field is required.</span>');
					error = true;
				}
			}
			return false;
		});
		
		function onAfter(curr,next,opts){
			slideCurr	= opts.currSlide + 1;
			var slideCount	= opts.slideCount;
			var msg			= "(Question " + slideCurr + " of " + slideCount + " )"
			$('.counter').text(msg);
			if(slideCurr >= slideCount){
				$('#questions-next').hide();
				$('#questions-submit').show().css('width','100px');
			}
		}
		
		$('#questions')
		.cycle({ 
			speed:  600,
			fx: 'fade',
			timeout: 0,
			after: onAfter
		});
		
	}
	
});
