var xmlDoc;
var xmlObj;

function importXML(){
	if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = marquee;
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async="false";
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4){
			 marquee();
			}
		};		
 	}
	else
	{
		alert('Your browser can\'t handle this script');
		return;
	}
	xmlDoc.load("js/marquee/marquee.xml");
	xmlObj=xmlDoc.documentElement;
}

function marquee(){
	width = xmlDoc.getElementsByTagName('width')[0].firstChild.nodeValue;
	height = xmlDoc.getElementsByTagName('height')[0].firstChild.nodeValue;
	behavior = xmlDoc.getElementsByTagName('behavior')[0].firstChild.nodeValue;
	direction = xmlDoc.getElementsByTagName('direction')[0].firstChild.nodeValue;
	scrolldelay = xmlDoc.getElementsByTagName('scrolldelay')[0].firstChild.nodeValue;
	bgcolor = xmlDoc.getElementsByTagName('bgcolor')[0].firstChild.nodeValue;
	marqueetextfont = xmlDoc.getElementsByTagName('fontface')[0].firstChild.nodeValue;
	fontcolor = xmlDoc.getElementsByTagName('fontcolor')[0].firstChild.nodeValue;
	fontweight = xmlDoc.getElementsByTagName('fontweight')[0].firstChild.nodeValue;
	fontface = xmlDoc.getElementsByTagName('fontface')[0].firstChild.nodeValue;
	fontsize = xmlDoc.getElementsByTagName('fontsize')[0].firstChild.nodeValue;
	fontstyle = xmlDoc.getElementsByTagName('fontstyle')[0].firstChild.nodeValue;
	contenttext = xmlDoc.getElementsByTagName('contenttext')[0].firstChild.nodeValue;
	marqueecontent='<marquee behavior="'+ behavior +'" direction="'+ direction;
	//marqueecontent +='" width="' + width + '" height="' + height;
	marqueecontent +='" bgcolor="' + bgcolor + '" scrolldelay="'+ scrolldelay;
	marqueecontent +='"><span style="font-weight:'+ fontweight +';color:'+ fontcolor +';font-family:'+ fontface +';font-style:'+ fontstyle +';font-size:'+ fontsize +'">' + contenttext + '</span></marquee>';
	$('marquee').innerHTML = marqueecontent;
	//document.write(marqueecontent);
}
