function createSWF( w, h, params) {
  var args = "";
  for (var i in params) {
    args += i + "=" + params[i] + "&amp;";
  }
document.writeln('<object width="100%" height="100%" align="middle">'+ '<param name="movie" value="http://www.smugmug.com/ria/ShizamSlides-2007091201.swf?'+args+'"/>'+ '<param name="wmode" value="transparent" />'+ '<embed src="http://www.smugmug.com/ria/ShizamSlides-2007091201.swf?'+args+'" wmode="transparent" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" allowScriptAccess="always" allowNetworking="all"/></object>');
return 1;
} 

function AddReferralCode() {
var links = this.getElementsByTagName("A");
if (links && (links.length != 0)) {
var smugLink = links.item(0);
smugLink.href = "http://www.smugmug.com/?referrer=HtgPwZa9IeXsg";
}
}
YE.onAvailable('footer', AddReferralCode);

function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

function norobotmail(aUser, aDomain) { 
       document.location = "mailto:" + aUser + "@" + aDomain;
    }

/***************************/

/* Menu Code               */

/***************************/



  var menuArray = new Array();

  var tableID = null;

  var rowID = null;



  function collapse(subMenu)

  {

 // 	alert(menuArray.length);



    if(subMenu==0)

      {

//CLOSE ALL OPEN SUB-MENUS IN REVERSE ORDER FROM WHICH THEY WERE OPENED

    for(var i=(menuArray.length)-1; i>=0; i--)

        {

          document.getElementById(menuArray[i]).style.display="none";

            menuArray.length=i;  //DELETES ROW[I] FROM THE ARRAY

        }

      }

    else

      {

      //CLOSE APPROPRIATE SUB-MENU CHILDREN

        var j=menuArray.length;

        while(menuArray[--j]!=subMenu)

      {

          document.getElementById(menuArray[j]).style.display="none";

          menuArray.length=j;

        }

      }

  }



  function checkTable(ID)

  {

  //USED FOR TROUBLESHOOTING

  //alert("rowID="+rowID+", tableID="+tableID+", ID="+ID+", mA[0]="+menuArray[0]+", mA[1]="+menuArray[1]+", mA[2]="+menuArray[2])



  //THE MENU OPTION SELECTED HAS NO SUB-MENUS, SO CLOSE ALL OPEN SUB-MENUS AND STOP PROCESSING

    if(rowID==0)

      {

        collapse(0);

        return;

    }



  //A MENU OPTION FROM A DIFFERENT TABLE (GROUPING) HAS BEEN SELECTED, SO CLOSE ALL SUB-MENUS FROM THE OTHER TABLE

    if(tableID!=ID)

      {

         tableID =ID;

       collapse(0);

      }



      var flag=0;

  //CHECK IF THE SUB-MENU HAS ALREADY BEEN OPENED

      for(var i=0; i<menuArray.length; i++)

      {

        if(menuArray[i]==rowID)

             flag=1;

      }



  //IF THE MENU SELECTED IS ALREADY OPEN

      if(flag==1)

      {

      //COLLAPSE ALL SUB-MENU CHILDREN

        collapse(rowID);

      }

      else

      {

      //DISPLAY THE SUB-MENU

      	if((rowID != null) && (rowID != "0") )

      	{

      		menuArray[menuArray.length] = rowID;

      		document.getElementById(rowID).style.display = "";

      		//objSpan = eval("document.getElementById('span"+rowID+"')");

     		 //objSpan.style.display = "block";

     	 }

      }

  }


  function swapBoxes() {
   box1 = YD.get("subcategoriesBox");
   box2 = YD.get("galleriesBox");
   if (box1 && box2)
   {
      swap = box1.innerHTML;
      box1.innerHTML = box2.innerHTML;
      box2.innerHTML = swap;
   }
}

  var vanityTable = 
  {
     guestbook : "http://www.rinkshots.com/gallery/6894299_cgxyh",
     contact : "http://www.rinkshots.com/gallery/6894355_K9qd4",
     about : "http://www.rinkshots.com/gallery/6894360_2Sut9",
     faq : "http://www.rinkshots.com/gallery/6894369_K8Lfi" ,
     survey : "http://rinkshots.smugmug.com/gallery/7512075_58n5H"
  };

  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
         }
     }
  }