<!--//

// Poll ophalen

function poll(module_08_01_id, div_id, homepage){
	//
	var image = '';
	if(homepage == 1){ 
		image = 'ajax-loader.gif';
	} else {
		image = 'ajax-loaderWit.gif';
	}
	document.getElementById(div_id).innerHTML = '<h3>Poll</h3><div style="margin:40px auto; width: 32px;"> <img src="site-img/' + image + '" alt="Loading" /></div>';
	//
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = handleStateChange_08_01;
	xmlHttp.open("GET", "cms/xml/module_08_01.xml.php?module_08_01_id=" + module_08_01_id + "&div_id=" + div_id + "&homepage=" + homepage, true);
	xmlHttp.send(null);
	
}

function handleStateChange_08_01() {
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			parseResults_08_01();
		}
	}
}

function parseResults_08_01() {
	var results = xmlHttp.responseXML;
	var eigendommen = results.getElementsByTagName("poll");
	eigendom = eigendommen[0];
	bericht = eigendom.getElementsByTagName("vraag")[0].firstChild.nodeValue;
	div_id =  eigendom.getElementsByTagName("div_id")[0].firstChild.nodeValue;
	document.getElementById(div_id).innerHTML = '';
	add_bericht_08_01(bericht, div_id);
}

function add_bericht_08_01(var_b, div_id) {
	var row = document.createElement("div");
	row.innerHTML = var_b;
	document.getElementById(div_id).appendChild(row);
}

// Poll verzenden

function verzend_poll(id, div_id, homepage){
	var module_08_01_id = document.forms["module_08_01_form_" + id].module_08_01_id.value;
	var module_08_02_id = '';
	for (i=0; i<document.forms["module_08_01_form_" + id].module_08_02_id.length; i++){
		if (document.forms["module_08_01_form_" + id].module_08_02_id[i].checked==true){
			module_08_02_id += document.forms["module_08_01_form_" + id].module_08_02_id[i].value+',';
		}
	}
	module_08_02_id=module_08_02_id.substring(0,module_08_02_id.length-1);
	//
	var image = '';
	if(homepage == 1){ 
		image = 'ajax_load_small.gif';
	} else {
		image = 'ajax_load_small.gif';
	}
	document.getElementById(div_id).innerHTML = '<h3>Poll</h3><div style="margin:40px auto; width: 32px; height: 50px;"> <img src="cms/images/' + image + '" alt="Loading" /></div>';
	//
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = handleStateChange_08_01;
	xmlHttp.open("GET", "cms/xml/module_08_01.xml.php?module_08_02_action=module_08_02_insert_poll&module_08_02_id=0," + module_08_02_id + "&module_08_01_id=" + module_08_01_id + "&div_id=" + div_id, true);
	xmlHttp.send(null);
}

// Button enable

function module_08_01_enable(id){
	document.getElementById("submit_08_01_" + id).disabled=false;
}

-->
