function loadXMLDoc(dname) 
{
var xmlDoc;
if (window.XMLHttpRequest)
  {
  xmlDoc=new window.XMLHttpRequest();
  xmlDoc.open("GET",dname,false);
  xmlDoc.send("");
  return xmlDoc.responseXML;
  }
// IE 5 and IE 6
else if (ActiveXObject("Microsoft.XMLDOM"))
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async=false;
  xmlDoc.load(dname);
  return xmlDoc;
  }
alert("Error loading XML document");
return null;
}


 
function getXMLConfig(dname)
{

// javascript doesn't allow x-scripting on different second level domains. switch for admin

if (window.location.hostname.indexOf( 'promoadmin.adult.com' )  >= 0)
{
	dname = dname.replace(/hostedgalleries.adult.com/i, "promoadmin.adult.com")
}

xmlDoc = loadXMLDoc(dname);

var myConfig = { 
    key: '#@faf8a1b9aece5b6f690',
	
    // here is our playlist with two clips 
    playlist: [ 
     
        // this first PNG clip works as a splash image 
        { 
            url: xmlDoc.getElementsByTagName("screenpath")[0].childNodes[0].nodeValue,  
            scaling: 'orig' 
        }, 
         
        // second clip is a video. when autoPlay is set to false the splash screen will be shown 
        { 
            url: xmlDoc.getElementsByTagName("flvpath")[0].childNodes[0].nodeValue,  
            autoPlay: false,  
             
            // video will be buffered when splash screen is visible 
            autoBuffering: false
        } 
    ] 
};
return myConfig;
}
