/*=========================================*/
/*== Position Paypal ==*/
/*=========================================*/
YE.onContentReady("altViews", MovePaypalContent); function MovePaypalContent() {
    var paypalObj = document.getElementById("paypalButtonSet");
    var altViews = document.getElementById("altViews");
    var smugmug= document.getElementById("smugmug");
    if (altViews && paypalObj && smugmug)
    {
        var paypalSetObj = paypalObj.parentNode.removeChild(paypalObj);
        altViews.appendChild(paypalSetObj);
        paypalSetObj.style.display = "inline";
    }    
}

/*==================*/
/*== NO ROBOT MAIL==*/
/*==================*/
function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain; }

/*==========++++++++========*/
/*==DEFAULT PAYPAL PRICING==*/
/*======see footer html=====*/
/*==========================*/
// set default pricing div name, can be set to 'null' if you want no paypal buying by default
var currentPayPalPricingDiv = null;

/*=========================*/
/*==  Keyword Redirect   ==*/
/*=========================*/

function CheckGalleryRedirects()
{
    var galleryRedirectTable = 
    {
     "10324016_JLrdM" : "http://www.oaktreephotography.net/Soccer/Kinnelon/U9B-051709-Parsippany-vs/8302153_PjN3R",     
"10323157_stJeP" : "http://www.oaktreephotography.net/Soccer/Kinnelon/U12G-042609-Kinnelon-vs-West/8089785_hKAsd",
     "10323894_Q2J3r" : "http://www.oaktreephotography.net/Soccer/Kinnelon/U9B-062109-Mtn-Lakes-vs/8641979_3Cn5o"



    };
    
    // the only way it will let you go to the real gallery is if you add #stop to the end of the gallery URL
    // you can't check for the loggedIn class because this executes before the body tag is even present
    if (window.location.hash != "#stop")
    {
        // get the path from the current URL, 
        var path = window.location.pathname;
        var results = path.match(/\/(\d+_[a-zA-Z0-9]+)\/?$/);
        if (results && (results.length > 1))
        {
            var newURL = galleryRedirectTable[results[1]];        // 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
            }
        }
    }
}

CheckGalleryRedirects();
