var vanityTable = 
 {
     schoolfurniture : "http://photos.miseast.org/gallery/3620245_M2qei",
     earthquakepreparation : "http://photos.miseast.org/gallery/1887140_LLvAo"

 };


function removeKeywords() {

 var aKeywords = ['archive','afgtfb001','afgecho004','afgfao001','afgshum007','armshumd009','tajdipecho001',
     'afgshum004','tajdipecho002', 'afggtz007', 'tajdip004', 'tajundp001',
     'armsnp009','afgshum07','arms9008','armsnp','dipecho01',
                  'tajeua005'];

 var oBox = YD.get('keywordsBox');
 oKeywords = YD.getElementsByClassName('keyword', 'a', oBox);

 for (i=0; i<oKeywords.length; i++) {
   for (j=0; j<aKeywords.length; j++) {
     if (aKeywords[j] == oKeywords[i].innerHTML) {
       try {
         oKeywords[i].parentNode.removeChild(oKeywords[i].previousSibling);
       } catch(e){}
       try {
         oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
       } catch(e){}
       try {
         oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
       } catch(e){}
       try {
         oKeywords[i].parentNode.removeChild(oKeywords[i]);
       } catch(e){}
       break;
     }
   }
 }
}

function rem_pipes () {
      var objElement = document.getElementById("toolbar")
      if (objElement != null) 
      {
         var str_b = new String(objElement.innerHTML);
         str_b = str_b.replace(/\|/g, '')
         objElement.innerHTML = str_b;
      }
}

 function IsHomePage()
 {
    return(YD.hasClass(document.body, 'homepage'));
 }
 
 function CheckRedirects()
 {
     if (IsHomePage())    // 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
         }
     }
 }

function swapBoxes() {
   box1 = YD.get("subcategoriesBox");
   box2 = YD.get("galleriesBox");
   if (box1 && box2)
   {
      swap = box1.innerHTML;
      box1.innerHTML = box2.innerHTML;
      box2.innerHTML = swap;
   }
}