jqueryReady();
function include(destination) {
	var e=window.document.createElement('script');
	e.setAttribute('src',destination);
	e.setAttribute('type',"text/javascript");
	e.setAttribute('onload',"jqueryReady()");
	window.document.body.appendChild(e);
}

function jqueryReady(){
	jQuery.getJSON("http://"+location.host+"/survey/api.php?callback=?",{act:"getSurveyPop"},
		function(response){
			if(response.status.data!="empty"){
				data = response.data[0];
				id = data['id'];
				show = data['show'];
				
				$.ajax({// increment survey counter
					type:"GET",
					url:"http://"+location.host+"/survey/process/process-get.php",
					data:"formType=surveyCount&id="+id
				});
				
				if(show=="yes"){
					showPop("http://"+location.host+"/survey/launchSurvey.php?id="+id,600,400);
				}
			}
		}
	);
}
function showPop(url,w,h){
	window.open(url,"surveyPopup","menubar=no,width="+w+",height="+h+",toolbar=no,scrollbars=yes,resizable=no,status=no");
}
//$.get("http://eforms.lansingmi.gov/survey/ajax.php",{type:"getSurveyPop"})