var geoXml;
var showSurvey=true;
$(document).ready(function(){
	geoXml = new GGeoXml("http://www.southsidehealth.org/pilotstudy_communities.kmz");
	$("ul#catset").before($("<button>").attr('id','sbb').html("show borders").toggle(function(){map.addOverlay(geoXml);$(this).html("hide borders");}, function(){map.removeOverlay(geoXml);$(this).html("show borders");}));
	$('#sbb').click();
	$("#notice").corner();
	$("#cmap div.ui-resizable-e").dblclick( function(){ var b=$('#cmap'); b.css("width",b.css("width")=="500px"?"auto":"500px"); map.checkResize(); } );
	//$("#handlebar").dblclick( function(){ var b=$('#cmap'); b.css("width",b.css("width")=="500px"?"auto":"500px"); map.checkResize(); } )
	//$("#ins").before($("<div>").attr("id","under-construction").html("We launched this site in <u><strong>an early stage of development</strong></u> knowing it needs improvement.  Please give us feedback using this <a id='survey' href='#'>short survey</a>.  Thank you!"));
	$("#ins").before($("<div>").attr("id","under-construction").html("We are building this site with your input. Please take this <a id='survey' href='#'>brief survey</a>."));
	$("#under-construction").corner();
	//$("#ins ol").prepend("We have intentionally launched this site in an <u><strong>early stage of development</strong></u> in order to obtain feedback from users.  Please take a minute to <a id='survey' href='#'>complete this short survey</a>.  Thank you");
	$("a#survey").click(function(){$("#the-survey").dialog("open"); showSurvey=false;});
	$("#under-construction").after($("<div>").attr('id','the-survey').html("<iframe src='http://www.surveymonkey.com/s/W8MNRXP'></iframe>"));
	$("#the-survey").dialog({width:800, height:1000, autoOpen: false, title:'Thank you for your feedback!'});
	//window.onbeforeunload = function(evt) { if(showSurvey){$("#the-survey").dialog("open");  return 'PRESS CANCEL TO TAKE OUR SURVEY BEFORE YOU LEAVE.';}}
});
