/*========================================*/
/*==   Paypal shopping functionality    ==*/
/*========================================*/
function setPaypalForm(form) {
 urlToImage = photoInfo[ImageID]['fileName'];

/* urlToImage = webServer + "/gallery/" + AlbumID + "_" + AlbumKey + "/1/" + ImageID + "_" + ImageKey + "/Large" + "   " + photoInfo[ImageID]['fileName'];  */

 i = form.photoselection.selectedIndex
 
 sPhotoType = form.photoselection.options[i].text;
 sPhotoPrice = form.photoselection.options[i].value;
 urlToImage = urlToImage + "    " + sPhotoType ;
 form.item_name.value = urlToImage;
 form.amount.value = sPhotoPrice;
}

function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
} 

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

// now register a notification to install the right paypal options when they are loaded into the page
if (currentPayPalPricingDiv)
{
    YE.onContentReady(currentPayPalPricingDiv, MoveSelectedPaypalContent);
}

// function to install the appropriate paypal options into the right place in the page
function MoveSelectedPaypalContent()
{
    var paypalObj = this;
    var altViews = document.getElementById("altViews");
    if (altViews)
    {
        var paypalSetObj = paypalObj.parentNode.removeChild(paypalObj);
        altViews.appendChild(paypalSetObj);
        paypalSetObj.style.display = "inline";
    }    
}


