var objQueryStringParameters = new Object();

if(location.search.length>1) {
	objQueryStringParameters.tmpPairs=location.search.substring(1).split("&");
	for (var i in objQueryStringParameters.tmpPairs) {
		var pairsplit=objQueryStringParameters.tmpPairs[i].split("=")
		if (pairsplit[0].length>0) objQueryStringParameters[pairsplit[0]]=unescape(pairsplit[1]);
	}
}

objQueryStringParameters.tmpPairs=null;
delete objQueryStringParameters.tmpPairs;

var footerhtml='<table width="700"><tr><td  colspan="3" ><hr width=700 size=1 noshade color="#5a5a5a" /></td></tr></table><table width="700" border=0 cellpadding=0 cellspacing="0"><tr><td colspan="3"><img src="https://event.on24.com/images/clear.gif" width=1 height=3 border=0></td></tr></table><table width="700"><tr  width="100%"><td colspan="3" align="right"  width="100%"><nocd><a href="http://event.on24.com/eventRegistration/images/cb/on24/poweredby.html" target="_new"></nocd><img src="http://event.on24.com/eventRegistration/images/cb/on24/poweredby.gif"  alt="" border="0"></a></td></tr></table><iframe style="display:none;" scrolling="No" marginheight="0" marginwidth="0" frameborder="0" align="left" height="800" width="810" id="ifrHeader" onload="setCustomHtmlDiv()" src="'+getCustomHtmlUrl()+'"></iframe>';

function getCustomHtmlUrl() {
	var eventid=objQueryStringParameters.eventid?objQueryStringParameters.eventid:eventObject.eventid;
	var sessionid=objQueryStringParameters.sessionid?objQueryStringParameters.sessionid:eventObject.sessionid;
	if(!eventid || !sessionid) return ""
	return "http://event.on24.com/eventManager/presentation/html.jsp?profiletype=customHTML2&eventid="+eventid+"&sessionid="+sessionid;
}

function setCustomHtmlDiv() {
	var customDocumentBody=document.getElementById('ifrHeader').contentWindow.document.body;
	var customDocumentForms=document.getElementById('ifrHeader').contentWindow.document.forms;
	//alert(customDocumentBody);
	//alert(customDocumentForms.length);
	
	if (customDocumentForms && customDocumentForms.length && customDocumentForms.length > 0) {
		//alert(customDocumentForms[0].innerHTML);
		if (customDocumentForms[0] && customDocumentForms[0].innerHTML) {
			var customHtmlDiv = document.getElementById('headerdiv');
			//alert(customHtmlDiv);
			if (customHtmlDiv) customHtmlDiv.innerHTML = customDocumentForms[0].innerHTML;
		}
	}
	document.body.style.visibility="visible";
}

