/**
 * @version		1.0.1 - 28 september 2011
 * 
 * @copyright	1.0.1,	28 september 2011,		Jan Niemantsverdriet,	Kleine foutjes uit CpHTMLAjaxLoad_vShowHTML gehaald
 * @copyright	1.0.0,	27 september 2011,		Jan Niemantsverdriet,	Gemaakt
 * 
 * dependency: /BB/JSDivers/simpleajax.js
 */

var CpHTMLAjaxLoad_iCounter = 99;

/**
 * Laad de HTML 
 * 
 * @param a_sHTMLId				het html id
 * @param a_sType				het type html dat geladen moet worden
 * @param a_sMore				meer informatie
 * @since 1.0.0 - 27 september 2011
 * @author Jan Niemantsverdriet
 */
function CpHTMLAjaxLoad_vLoadId(a_sHTMLId, a_sType, a_sMore) {
	CpHTMLAjaxLoad_iCounter++;
	//alert('http://' + window.location.hostname + '/AjaxLoad/' + a_sHTMLId);
	vSimpleAjaxSend('http://' + window.location.hostname + '/AjaxLoad/' + a_sHTMLId, "?sAjaxLoadType=" + a_sType + "&" + a_sMore, CpHTMLAjaxLoad_vShowHTML, "text/plain", CpHTMLAjaxLoad_iCounter);
}

/**
 * Plaatst de HTML
 * 
 * @param a_oResponse			het object met de HTML
 * @since 1.0.0 - 27 september 2011
 * @author Jan Niemantsverdriet
 */
function CpHTMLAjaxLoad_vShowHTML(a_oResponse) {
	var sResponse = a_oResponse.responseText;
	var aResponse = sResponse.split("\n");
	var sHTMLId = aResponse[0];
	delete aResponse[0];
	var sHTML = aResponse.join("\n");
	//alert("Load: " + sResponse);
	var oDiv = document.getElementById(sHTMLId);
	if (oDiv) oDiv.innerHTML = sHTML;
}
