var lastDiv = "";
function showDiv(divName) {
	// hide last div
	if (lastDiv) {
		document.getElementById(lastDiv).className = "hiddenDiv";
	}
	//if value of the box is not nothing and an object with that name exists, then change the class
	if (divName && document.getElementById(divName)) {
		document.getElementById(divName).className = "visibleDiv";
		lastDiv = divName;
	}
}

//using jQuery to handle form interactions
jQuery(function($){
	//show cPanel information for visitors not hosted with Web Circle
	$('#hosting').change(function(){
		if ( $(this).val() == 'Not hosted with Web Circle' ) {
			//show hosting information
			$('#not-hosted').removeClass('hidden');
		} else {
			$('#not-hosted').addClass('hidden');
		}
	});
	$('#article_model').change(function(){
		if ( $(this).val() == 'Yes please take the article from our blog' ) {
			$('#blog_address').removeClass('hidden');
		} else {
			$('#blog_address').addClass('hidden');
		}
	});
	$('#video_model').change(function(){
		if ( $(this).val() == 'Yes I will email through a video each month' ) {
			$('#video_acc').removeClass('hidden');
		} else {
			$('#video_acc').addClass('hidden');
		}
	});
});
