function toggle_visibility(id) {
   var e = document.getElementById(id);
   if(e.style.display == 'inline')
	  e.style.display = 'none';
   else
	  e.style.display = 'inline';
}
function validate_ask_form(){
	var check_val='true';
	if (document.ask_form.author_name.value==""){
		alert('Please enter your name');
		return false;
		check_val='false';
	}
	if (document.ask_form.author_city.value==""){
		alert('Please enter your city');
		return false;
		check_val='false';
	}
	if (document.ask_form.author_state.value==""){
		alert('Please enter your state');
		return false;
		check_val='false';
	}
	if (document.ask_form.author_question.value==""){
		alert('Please enter your quesiton');
		return false;
		check_val='false';
	}
	if (check_val=='false'){
		return false;
	}
	else {
		return true;
	}
}
function validate_contact_form(){
	var check_val='true';
	if (document.contact_form.contact_name.value==""){
		alert('Please enter your name');
		return false;
		check_val='false';
	}
	if (document.contact_form.contact_email.value==""){
		alert('Please enter your email');
		return false;
		check_val='false';
	}
	if (document.contact_form.contact_city.value==""){
		alert('Please enter your city');
		return false;
		check_val='false';
	}
	if (document.contact_form.contact_state.value==""){
		alert('Please enter your state');
		return false;
		check_val='false';
	}
	if (document.contact_form.contact_comments.value==""){
		alert('Please enter your comments');
		return false;
		check_val='false';
	}
	if (document.contact_form.contact_spam.value==""){
		alert('Please answer the spam check math problem at the bottom of the form.');
		return false;
		check_val='false';
	}
	if (document.contact_form.contact_spam.value!="6"){
		alert('Please answer the spam check math problem correctly.');
		return false;
		check_val='false';
	}
	if (check_val=='false'){
		return false;
	}
	else {
		return true;
	}
}
$(function(){

	// Dialog			
	$('#dialog1').dialog({
		autoOpen: false,
		width: 900,
		buttons: {
			"Ok": function() { 
				$(this).dialog("close"); 
			}
		}
	});
	
	// Dialog Link
	$('#dialog_link1').click(function(){
		$('#dialog1').dialog('open');
		return false;
	});
	
	//hover states on the static widgets
	$('#dialog_link1, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
});
$(function(){

	// Dialog			
	$('#dialog2').dialog({
		autoOpen: false,
		width: 900,
		buttons: {
			"Ok": function() { 
				$(this).dialog("close"); 
			}
		}
	});
	
	// Dialog Link
	$('#dialog_link2').click(function(){
		$('#dialog2').dialog('open');
		return false;
	});
	
	//hover states on the static widgets
	$('#dialog_link2, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
});
$(function(){

	// Dialog			
	$('#dialog3').dialog({
		autoOpen: false,
		width: 900,
		buttons: {
			"Ok": function() { 
				$(this).dialog("close"); 
			}
		}
	});
	
	// Dialog Link
	$('#dialog_link3').click(function(){
		$('#dialog3').dialog('open');
		return false;
	});
	
	//hover states on the static widgets
	$('#dialog_link3, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
});
$(function(){

	// Dialog			
	$('#dialog4').dialog({
		autoOpen: false,
		width: 900,
		buttons: {
			"Ok": function() { 
				$(this).dialog("close"); 
			}
		}
	});
	
	// Dialog Link
	$('#dialog_link4').click(function(){
		$('#dialog4').dialog('open');
		return false;
	});
	
	//hover states on the static widgets
	$('#dialog_link4, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
});
$(function(){

	// Dialog			
	$('#dialog5').dialog({
		autoOpen: false,
		width: 900,
		buttons: {
			"Ok": function() { 
				$(this).dialog("close"); 
			}
		}
	});
	
	// Dialog Link
	$('#dialog_link5').click(function(){
		$('#dialog5').dialog('open');
		return false;
	});
	
	//hover states on the static widgets
	$('#dialog_link5, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
});
