function fixPhotoNav() {

  var oPhotoNav = YD.getElementsByClassName("photoNav", "div");



  for (var i=0; i < oPhotoNav.length; i++) {

    var re = /gallery\/([\d]+)(_(\w+))?\//;

    var oTitle = YD.getElementsByClassName("title", "span", oPhotoNav[i]);

    if (re.test(window.location)) {

      oTitle[0].innerHTML = "|&nbsp;" + oTitle[0].innerHTML + "&nbsp;|";

      re.exec(window.location);

      oPhotoNav[i].innerHTML = oPhotoNav[i].innerHTML + "<span ><a href='/gallery/" + RegExp.$1 + ((RegExp.$2 != undefined) ? RegExp.$2 : "") + "'>Back to Main Gallery</a></span>";

    }

  }

}





function isClass(sClass) {



  sClassName = document.body.className;



  re = new RegExp(sClass + "( |$)")







  if (!sClassName)



    return false;







  return re.test(sClassName);



}











function getHostname()



{



  re = /(http:\/\/[\w]+\.[\w]+\.[\w]+)\//;



  re.exec(window.location);



  return RegExp.$1;



}







function hasPath(sPath)



{



  re = new RegExp("\/" + sPath + "(\/|$)");



  return re.test(window.location)



}







/***************************/

/* Paypal Button Logic Main */

/***************************/





function setPaypalFormm(form) {





 urlToImage =  webServer + "/gallery/" + AlbumID + "_" + AlbumKey + "/1/" + ImageID + "_" + ImageKey + "/Small";





 form.item_number.value = "Image Link: " + urlToImage;

 





 if (document.PhotoOrderFormm.item_name.value == "Click the arrow for item list")



      {



        document.PhotoOrderFormm.item_name.value=printsarraym[1];



        }




 PhotoOrderFormmShowPrice();



}





function PhotoOrderFormmFormatValues(value)



{



 var temp = Math.round(value * 100);

 temp = temp / 100;

 return temp;





}





function PhotoOrderFormmShowPrice()



{





if (document.PhotoOrderFormm.business.value != "matt@mattaddington.com")



        {





        document.PhotoOrderFormm.business.value='matt@mattaddington.com'





        }





   document.PhotoOrderFormm.amount.value= PhotoOrderFormmFormatValues(parseFloat(printspricearraym[document.PhotoOrderFormm.item_name.selectedIndex]));

   document.PhotoOrderFormm.paypalfilename.value=mainPhotoFileName;

   document.PhotoOrderFormm.os0.value= albumtitlepp + '; File Name: ' + mainPhotoFileName + "; Instructions: " + document.PhotoOrderFormm.instruct.value; 

   



}




