// JavaScript Document

function setVisibility(id, visibility) {
	document.getElementById(id).style.display = visibility;
}

function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}

function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}

function ReverseContentDisplay(d) {
	if(d.length < 1) { return; }
	
	if(document.getElementById(d).style.display == "none") { 
			//alert("block");
			document.getElementById(d).style.display = "block"; 
	}
	else { 
			//alert("none");
			document.getElementById(d).style.display = "none"; 
	}
}

function showTab(obj, scrolTo) 
{			
	//alert(obj);
	
	$('.showTab').each(function() {
		$(this).removeClass('active');			
		$('#'+$(this).attr('divID')).hide();
	});

	$(obj).addClass('active');
	$('#'+$(obj).attr('divID')).show();
	
	if (scrolTo) $.scrollTo(scrolTo, 800, {queue:true});
}

function getFountains(year,platformID){
	var dataString = 'year='+year+'&platformID='+platformID;
	
	jQuery.ajax({
		  type: 'POST',
		  url: '/script/action/getFountains.php',
		  data: dataString,
		  dataType: 'json',
		  success: function(data){
		 		if (data.error.length == 0){
		 			jQuery('#fountains').html(data.posts);
		 			jQuery('#allYears').html(data.showAllYears);
			  }else{
			  	alert(data.error);
			  }
		  }
	});
}
