var xmlDoc

setInterval('LoadXML()', 10000);

function LoadXML() {	
	var strXMLFile = "/includes/xml/Dynamic_Page_Title.xml" + GetUniqueIdentifier();
	
	// Check for Internet Explorer
	if (window.ActiveXObject) {
    	xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = false;
  		xmlDoc.load(strXMLFile);
		GetXMLFileValue();
	}
	// Check for Mozilla, Opera, Firefox, etc.
	else if (document.implementation && document.implementation.createDocument) {
    	xmlDoc = document.implementation.createDocument("","",null);
  		xmlDoc.load(strXMLFile);	
		xmlDoc.onload = GetXMLFileValue
	}
	// If none of the above broser is not supported
	else {	
	    alert('Your browser does not support this script.')	
	}
}

function GetXMLFileValue() {
    var strTitle
    
    strTitle = xmlDoc.getElementsByTagName("Artist")[0].firstChild.nodeValue + " - ";
    strTitle = strTitle + xmlDoc.getElementsByTagName("Title")[0].firstChild.nodeValue + " - ";
    strTitle = strTitle + xmlDoc.getElementsByTagName("Album")[0].firstChild.nodeValue + " - ";
    strTitle = strTitle + xmlDoc.getElementsByTagName("AlbumYear")[0].firstChild.nodeValue + " - ";

	document.title = strTitle + "Armenian Radio";
}

function GetUniqueIdentifier() {
	var strValue = "?UniqueIdentifier=" + Math.random() + "&TimeStamp=" + new Date().getTime();	
	return strValue;
}