Fuddling with paths

Hi all.

Okay, for a site I’m developing for a client - WeldCo.ca - I just spent the last couple hours changing the paths that the xml for the images in the header loads at (since I cannot use absolute values - www.weldco.ca won’t load http://weldco.ca, and vise-versa) and since relative paths wouldn’t work since there are HTMs in different folders.

here’s the code i used (its crude, but it works):


//define url (i.e., weldco.ca or www.weldco.ca
var thisURL = new String(this._url)
//used for thisDomainNameEtc
var endCap = ".ca/";
//yields either http://www.weldco.ca or http://weldco.ca
var thisDomainNameEtc = thisURL.slice(0, thisURL.indexOf(endCap)+endCap.length);
//something like index.htm or catalog/languages/english/index.php
var thisAfterPath = thisURL.slice(thisURL.indexOf(endCap)+endCap.length, thisURL.length);
//splits the string into an arrays aftr a slash
var slashes:Array = thisAfterPath.split("/");
//counts the length of the array (essentially the number of slashes in thisAfterPath) 
var slashTimes = slashes.length-1;
//defines new folder paths depending upon slashTimes
if (slashTimes == 0) {
    var prePath = ""    
}
if (slashTimes == 1) {
    var prePath = "../"    
}
if (slashTimes == 2) {
    var prePath = "../../"    
}
if (slashTimes == 3) {
    var prePath = "../../../"    
}
//loads the xml - e.g. http://www.weldco.ca/catalog/../media/images/images1.xml
Galeria.load(thisDomainNameEtc+prePath+"media/images"+slashTimes+".xml");

So I just used this._url to find the path and then used that to establish a relative path. Everything is working fine in Firefox, but everything is broken in IE. Even the store isn’t updated (the CSS didn’t update the h1 tags, etc.). Would anyone know if this is a problem in IE or with my code. Thanks.