function handleDivs(xml){
	$("html > div,html > body > div,div",xml).each(function(){
		var id = $(this).attr("id");
		var divEl = $("#" + id).get(0);

		if(divEl == undefined){
			return;
		}

		var dParent;
		var el = $(this).get(0);

		newEl = document._importNode(el,true);
		
		dParent = divEl.parentNode;
		dParent.replaceChild(newEl,divEl);

		$('script',newEl).each(function(){
			var jsText = $(this).text();

			eval(jsText);
		});
	});
	
	$("html > script",xml).each(function(){
		var jsText = $(this).text();

		eval(jsText);
	});
}
