//make HTML5 placeholders work in non supportive browsers
$(document).ready(function(){
  $("input[placeholder]").each(function(){
    if($(this).val()==""){
     // $(this).addClass('hasplaceholder');
      $(this).val($(this).attr("placeholder"));
      $(this).focus(function(){
        if($(this).val()==$(this).attr("placeholder")) $(this).val("");
       // $(this).removeClass('hasplaceholder');
      });
      $(this).blur(function(){
        if($(this).val()==""){
	  // $(this).addClass('hasplaceholder');
           $(this).val($(this).attr("placeholder"));
        }
       });
    }
  });

$('form').submit(function(evt){
	$('input[placeholder]').each(function(){
		if($(this).attr("placeholder") == $(this).val()) {$(this).val('');}
	});
});
} );
//make HTML5 placeholders work in non supportive browsers

function goToByScroll(id){
     	$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}


$(document).ready(function() {
	$("a.fancy").fancybox({
		padding: 20
	});
	
	$("a.fancy0").fancybox({
		padding: 0,
		overlayColor: '#ffffff'
	});
});



$(document).ready(function() {
    $('#slideshow').cycle({
		fx: 'fade',
		speed:  1000, 
		timeout: 5000,
		next:   '#next2', 
	    prev:   '#prev2'  
	});
	


});

$(document).ready(function() {


	//SWAP LOGIN/REG FORM
	$("#showprot2").click(function(){
		$("#prot1").hide();
		$("#prot2").fadeIn();
	});
	
	

    $('.gallery_r').cycle({
		fx: 'scrollHorz',
		speed:  500, 
		timeout: 0,
		next:   '#next1', 
	    prev:   '#prev1'  
	});
	
	var $container = $('.gallery_r').cycle({ 
	    fx:     'scrollHorz', 
	    speed:   500, 
	    timeout: 0 
	}); 
	

	
	$('#pager_0').click(function() { 
	    $container.cycle(0); 
	    return false; 
	});
	
	$('#pager_1').click(function() { 
	    $container.cycle(1); 
	    return false; 
	});
	
	$('#pager_2').click(function() { 
	    $container.cycle(2); 
	    return false; 
	});
	
	$('#pager_3').click(function() { 
	    $container.cycle(3); 
	    return false; 
	});
	
	$('#pager_4').click(function() { 
	    $container.cycle(4); 
	    return false; 
	});
	
	$('#pager_5').click(function() { 
	    $container.cycle(5); 
	    return false; 
	});
	
	$('#pager_6').click(function() { 
	    $container.cycle(6); 
	    return false; 
	});
	
	$('#pager_7').click(function() { 
	    $container.cycle(7); 
	    return false; 
	});
	
	$('#pager_8').click(function() { 
	    $container.cycle(8); 
	    return false; 
	});
	
	$('#pager_9').click(function() { 
	    $container.cycle(9); 
	    return false; 
	});
	
	$('#pager_10').click(function() { 
	    $container.cycle(10); 
	    return false; 
	});
	
	
	$('#pager_11').click(function() { 
	    $container.cycle(11); 
	    return false; 
	});
	
	$('#pager_12').click(function() { 
	    $container.cycle(12); 
	    return false; 
	});
	
	$('#pager_13').click(function() { 
	    $container.cycle(13); 
	    return false; 
	});
	
	$('#pager_14').click(function() { 
	    $container.cycle(14); 
	    return false; 
	});
	
	$('#pager_15').click(function() { 
	    $container.cycle(15); 
	    return false; 
	});
	
	$('#pager_16').click(function() { 
	    $container.cycle(16); 
	    return false; 
	});
	
	
	$('#pager_17').click(function() { 
	    $container.cycle(17); 
	    return false; 
	});
	
	$('#pager_18').click(function() { 
	    $container.cycle(18); 
	    return false; 
	});
	
	$('#pager_19').click(function() { 
	    $container.cycle(19); 
	    return false; 
	});
	
	$('#pager_20').click(function() { 
	    $container.cycle(20); 
	    return false; 
	});
	
	$('#pager_21').click(function() { 
	    $container.cycle(21); 
	    return false; 
	});
});


$(document).ready(function(){	
	
	$("#map1_rev").toggle(function(){	
			$("#linkdiv1").css({"height":"0px"});		
			$("#map1").animate({'height': '450px'});	
			$(this).animate({'margin-top':'400px'});	
			
			setTimeout( function() {
				$('span#map1btntext').replaceWith( "<span id=\"map1btntext\">CLOSE MAP</span>" );
			}, 500 );
		
		}, function () {
		
			$("#linkdiv1").css({"height":"210px"});		
			$("#map1").animate({'height': '210px'});	
			$(this).animate({'margin-top':'95px'});	
			$('span#map1btntext').replaceWith( "<span id=\"map1btntext\">VIEW MAP</span>" );
				
	});
	
	
	
	$("#map2_rev").toggle(function(){	
			$("#linkdiv2").css({"height":"0px"});		
			$("#map2").animate({'height': '450px'});	
			$(this).animate({'margin-top':'400px'});	
			
			setTimeout( function() {
				$('span#map2btntext').replaceWith( "<span id=\"map2btntext\">CLOSE MAP</span>" );
			}, 500 );
		
		}, function () {
		
			$("#linkdiv2").css({"height":"210px"});		
			$("#map2").animate({'height': '210px'});	
			$(this).animate({'margin-top':'95px'});	
			$('span#map2btntext').replaceWith( "<span id=\"map2btntext\">VIEW MAP</span>" );
		
	});
	
	$("#map3_rev").toggle(function(){	
			$("#linkdiv3").css({"height":"0px"});		
			$("#map3").animate({'height': '450px'});	
			$(this).animate({'margin-top':'400px'});	
			
			setTimeout( function() {
				$('span#map3btntext').replaceWith( "<span id=\"map3btntext\">CLOSE MAP</span>" );
			}, 500 );
		
		}, function () {
		
			$("#linkdiv3").css({"height":"210px"});		
			$("#map3").animate({'height': '210px'});	
			$(this).animate({'margin-top':'95px'});	
			$('span#map3btntext').replaceWith( "<span id=\"map3btntext\">VIEW MAP</span>" );
		
	});
	
	
});


$(document).ready(function(){
    $(".validateform").validate();
} );



