function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

var vanityTable = 
 {
     usawest: "http://www.alexdimson.com/gallery/8345912_oaqJp",
     usaeast: "http://www.alexdimson.com/gallery/8345524_LSjbF",
     canadawest: "http://www.alexdimson.com/gallery/8345026_vEQFe",
     canadaeast: "http://www.alexdimson.com/gallery/8345485_sS4uA",
     ireland: "http://www.alexdimson.com/gallery/8332815_TNvar",
     contact: "http://www.alexdimson.com/gallery/8403392_7Pe7a",
     purchase: "http://www.alexdimson.com/gallery/8424348_3wp5B",
     mideast: "http://www.alexdimson.com/gallery/8966503_Com2e"
 };

 function CheckRedirects()
 {
     if (YD.hasClass(document.body, 'homepage'))    // only run this code on the home page
     {
         // get the path from the current URL, 
         // convert it to lowercase and remove the leading slash
         var path = window.location.pathname.toLowerCase().substr(1);
         
         var newURL = vanityTable[path];        // look it up in our table
         
         // if we found it in the table && newURL is different than where we are
         if (newURL && (newURL != window.location))
         {
             window.location.replace(newURL);        // go to the new URL
         }
     }
 }