//-----------------------------------------------
//Function to add referral code to smugmug footer
//-----------------------------------------------
function AddReferralCode() {
var links = this.getElementsByTagName("A");
if (links && (links.length != 0)) {
var smugLink = links.item(0);
smugLink.href = "http://www.smugmug.com/?referrer=awemqCouBNyYc";
}
}
YE.onAvailable('footer', AddReferralCode);


//--------------------------------------
//Function to Change right-click warning
//--------------------------------------
rightClickWarning = "All photos are property of Ken Burns Photography. All rights reserved. Unauthorized use is prohibited.";


//---------------------------------------------------
//Function to Change Gallery Name of Contact Gallery
//--------------------------------------------------
function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_7106407")) 
  {
    var objElement = YD.get("comment")
    if (objElement != null) 
    {
      var str = new String(objElement.innerHTML);
      str = str.replace(/\gallery/gi, ' ');
      objElement.innerHTML = str;
    }
  }
}

YE.onAvailable("comment", ModifyText);

function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

if (hasPath("find"))
 YD.addClass(document.body, "find");

//---------------------------------
//Function to Change div text color
//---------------------------------
function wsChangeColor(id, thecolor) 
{ 
   theid = document.getElementById(id);                          
   theid.style.color= thecolor; 	                         
	                        
} 

function billy()
{
   url = (location.href); 
   if (url == "http://www.kenburnsphotography.com/")
   {
     wsChangeColor("home_url","#ffffff"); 
   }
   else if (url == "http://www.kenburnsphotography.com/find")
   {
     wsChangeColor("find_url","#ffffff"); 
   }
   else if (url =="http://www.kenburnsphotography.com/gallery/7106407_M8W3U")
   {
     wsChangeColor("contact_url","#ffffff"); 
   }
   else if (url =="http://www.kenburnsphotography.com/gallery/7087260_p6GPt")
   {
     wsChangeColor("gallery_url","#ffffff"); 
   }
   else if (url=="http://www.kenburnsphotography.com/gallery/7428236_aDja7")
   {
     wsChangeColor("gallery_url","#ffffff"); 
   }
   else if (url =="http://www.kenburnsphotography.com/gallery/7087235_VHVhb")
   {
     wsChangeColor("gallery_url","#ffffff"); 
   }
   else if (url =="http://www.kenburnsphotography.com/gallery/7024105_CmwCh")
   {
     wsChangeColor("gallery_url","#ffffff"); 
   }
}
billy();

//---------------------------------
//Function to Find a class name
//---------------------------------
function find_div_class() 
{
  if (YD.hasClass(document.body, "gallery_6963510")) 
  {
    var divCollection = document.getElementsByTagName("div");
    for (var i=0; i<divCollection.length; i++) 
      {
        if(divCollection[i].getAttribute("id") == "FindMe") 
          {
             wsChangeColor("FindMe","#444444");
             //findMeText = divCollection[i].innerHTML;
             //alert(findMeText);
           } 
       }
    }
}
YE.onAvailable(find_div_class());


