//-----------------------------------------------------------------
  // This is a table of vanity URLs that can be appended to your
  // main domain and will then redirect the browser to the actual gallery.
  // 
  // This lets you have memorable URLs like:
  // http://jfriend.smugmug.com/stanford
  // 
  // rather than URLs like: 
  // http://jfriend.smugmug.com/gallery/329885
  //
  // which aren't so memorable.
  //
  // To extend this yourself, just add more items to the table below.
  // The first string must be all lowercase and is the vanity string
  // that you want to represent a gallery or category on your site.
  // The second string is the actual smugmug URL you want the browser
  // to go to when they type the vanity URL.
  // Note that this is a JavaScript array.  If you add items to the end
  // of the array, you must have a comma at the end of each line (except
  // the last line).
  //-----------------------------------------------------------------
  var vanityTable = 
  { 
  	"mudd" : "http://www.scottwestphotography.com/Friends/217588",
  	"portraitportfolio" : "http://www.scottwestphotography.com/gallery/1717447",
  	"models" : "http://www.scottwestphotography.com/share/TWn5c7fi8CIDA",
  	"erinandkeoki" : "http://www.scottwestphotography.com/share/lvOKHAQrQViV2",
  	"verigy" : "http://www.scottwestphotography.com/share/V6mmBQFNIKiOM",
   	"hsvolleyball" : "http://www.scottwestphotography.com/share/tKrkzLQWESQlE",
  	"guestbook" : "http://www.scottwestphotography.com/gallery/1890106",
  	"services" : "http://www.scottwestphotography.com/gallery/1924151",
  	"photoservices" : "http://www.scottwestphotography.com/gallery/1924151",
   	"tracings" : "http://www.scottwestphotography.com/gallery/3906882_3nFxj",
   	"speedshoot" : "http://www.scottwestphotography.com/gallery/4823179_gecsH",
   	"artnudes" : "http://www.scottwestphotography.com/share/5p5cL6NblYXyQ",
   	"vtc" : "http://www.scottwestphotography.com/Sports/213095",
   	"brianna" : "http://www.scottwestphotography.com/Portraits/2009-Finished-Images/Justin-and-Brianna/9369493_vjXKP#627067857_XnVwR",
   	"arie" : "http://www.scottwestphotography.com/gallery/7416740_pgn4L",
   	"ciaramadeline" : "http://www.scottwestphotography.com/gallery/7424662_7JebM",
   	"nikki" : "http://www.scottwestphotography.com/gallery/6782694_3uWJg",
   	"megan" : "http://www.scottwestphotography.com/gallery/5531682_UmPcJ",
   	"crystal" : "http://www.scottwestphotography.com/gallery/5530019_FQJRi",
   	"christana" : "http://www.scottwestphotography.com/gallery/5530022_Mv7ai",
   	"mariah" : "http://www.scottwestphotography.com/gallery/5531686_BmaUS",
   	"mandy" : "http://www.scottwestphotography.com/gallery/5067440_M8Wqa",
   	"ellie" : "http://www.scottwestphotography.com/gallery/5219526_xXkpz",
   	"chelsea" : "http://www.scottwestphotography.com/gallery/5067486_VqZPQ",
   	"aimee" : "http://www.scottwestphotography.com/gallery/4927208_LY7U4",
   	"mica" : "http://www.scottwestphotography.com/gallery/4904881_WKNeb",
   	"lacey" : "http://www.scottwestphotography.com/gallery/4856586_2zNxs",
   	"rachael" : "http://www.scottwestphotography.com/gallery/4611448_xEwt7",
   	"monique" : "http://www.scottwestphotography.com/gallery/4610859_msMdH",
   	"taraw" : "http://www.scottwestphotography.com/gallery/4458852_jbdci",
   	"shantel" : "http://www.scottwestphotography.com/gallery/4371859_TEEt5",
   	"carah" : "http://www.scottwestphotography.com/gallery/4320444_ZkmHA",
   	"sai" : "http://www.scottwestphotography.com/gallery/4320447_wkNJt",
   	"erika" : "http://www.scottwestphotography.com/gallery/4007485",
   	"lucy" : "http://www.scottwestphotography.com/gallery/4007539",
   	"morgan" : "http://www.scottwestphotography.com/gallery/3946649",
   	"erica" : "http://www.scottwestphotography.com/gallery/3946490",
   	"tara" : "http://www.scottwestphotography.com/gallery/3956905",
   	"stephanie" : "http://www.scottwestphotography.com/gallery/3557893",
   	"lani" : "http://www.scottwestphotography.com/gallery/3441511",
   	"avidyn" : "http://www.scottwestphotography.com/gallery/3418605",
   	"idaho" : "http://www.scottwestphotography.com/gallery/3357373",
   	"rakhee" : "http://www.scottwestphotography.com/gallery/3046435",
   	"kristen" : "http://www.scottwestphotography.com/gallery/2977191",
   	"edie" : "http://www.scottwestphotography.com/gallery/2977211",
   	"jenelle" : "http://www.scottwestphotography.com/gallery/2886878",
   	"madeleine" : "http://www.scottwestphotography.com/gallery/2674886",
   	"audrey" : "http://www.scottwestphotography.com/gallery/2669119",
 	"jordan" : "http://www.scottwestphotography.com/gallery/1997340",
  	"nicolek" : "http://www.scottwestphotography.com/gallery/2629563",
  	"kelly" : "http://www.scottwestphotography.com/gallery/2608589",
  	"shannonk" : "http://www.scottwestphotography.com/gallery/2435152",
  	"gudren" : "http://www.scottwestphotography.com/gallery/2428779",
  	"yulia" : "http://www.scottwestphotography.com/gallery/2425403",
  	"constantina" : "http://www.scottwestphotography.com/gallery/2367563",
  	"christine" : "http://www.scottwestphotography.com/gallery/2337001",
  	"jenanddeb" : "http://www.scottwestphotography.com/gallery/2340180",
  	"lisa" : "http://www.scottwestphotography.com/gallery/2250242",
  	"kathleen" : "http://www.scottwestphotography.com/gallery/2250748",
  	"angie" : "http://www.scottwestphotography.com/gallery/2249302",
  	"melissaw" : "http://www.scottwestphotography.com/gallery/2217788",
  	"tovah" : "http://www.scottwestphotography.com/gallery/2185669",
  	"maddi" : "http://www.scottwestphotography.com/gallery/2029346",
  	"nancyrene" : "http://www.scottwestphotography.com/gallery/2136317",
  	"starla" : "http://www.scottwestphotography.com/gallery/2015495",
  	"dustina" : "http://www.scottwestphotography.com/gallery/2004525",
  	"sarahg" : "http://www.scottwestphotography.com/gallery/1968546",
  	"renata" : "http://scottkwest.smugmug.com/gallery/1941938",
  	"rose" : "http://scottkwest.smugmug.com/gallery/1951421",
   	"ashleyhaven" : "http://www.scottwestphotography.com/gallery/1908557",
 	"ashley" : "http://http://www.scottwestphotography.com/gallery/1908557",
  	"danielle" : "http://www.scottwestphotography.com/gallery/1912296",
  	"brynn" : "http://www.scottwestphotography.com/gallery/1888830",
  	"justine" : "http://www.scottwestphotography.com/gallery/1873075",
  	"susan": "http://www.scottwestphotography.com/gallery/1715462",
  	"tarah": "http://www.scottwestphotography.com/gallery/1714878",
  	"coey": "http://www.scottwestphotography.com/gallery/1715491",
  	"laurie": "http://www.scottwestphotography.com/gallery/1715504",
  	"becca": "http://www.scottwestphotography.com/gallery/1715477",
  	"nova": "http://www.scottwestphotography.com/gallery/1715471",
  	"kacy": "http://www.scottwestphotography.com/gallery/1715469",
  	"tammy": "http://www.scottwestphotography.com/gallery/1871075",
  	"jeneye": "http://www.scottwestphotography.com/gallery/1888890",
  	"haydenjane": "http://www.scottwestphotography.com/gallery/1888814",
  	"courtney": "http://www.scottwestphotography.com/gallery/1715488",
  	"rabbit": "http://www.scottwestphotography.com/gallery/1873088",
  	"taylor": "http://www.scottwestphotography.com/gallery/1715474",
  	"rachel": "http://www.scottwestphotography.com/gallery/1715516",
  	"dejonna": "http://www.scottwestphotography.com/gallery/1715508",
  	"floofie": "http://www.scottwestphotography.com/gallery/1715494",
  	"anetta": "http://www.scottwestphotography.com/gallery/1715485",
  	"nicole": "http://www.scottwestphotography.com/gallery/1715483",
  	"sheena": "http://www.scottwestphotography.com/gallery/1715481",
  	"kyleen": "http://www.scottwestphotography.com/gallery/1886247",
  	"mckenna": "http://www.scottwestphotography.com/gallery/1715479",
  	"moseswedding": "http://www.scottwestphotography.com/gallery/5923820_84yHW",
  	"mayerswedding": "http://www.scottwestphotography.com/gallery/5676672_ua5Uw",
  	"tranwedding": "http://www.scottwestphotography.com/gallery/1823684_WSAnv",
  	"hilhi" : "http://www.scottwestphotography.com/share/ayVC9Gtt5t2lA",
  	"hillhi" : "http://www.scottwestphotography.com/share/ayVC9Gtt5t2lA"
  };
  
  function CheckRedirects()
  {
  	// 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 (newURL != undefined) 		// if we find it in the table
  	{
 		window.location = newURL;		// go to the new URL
  	}
  };
  
  CheckRedirects();
//  ===========  end of Redirects  =====================================

//-----------------------------------------------------------------
// Custom right click warning

rightClickWarning = "All photos are copyright Scott West. All rights reserved. Unauthorized use is prohibited.  Some digital images can be purchased and downloaded, just add the image to the shopping cart and select product -> Digital Download."

//-----------------------------------------------------------------
// hasPath function to see if text is in the url
// used to customize what's shown on the homepage
function hasPath(sPath)
{
  re = new RegExp("\/" + sPath + "(\/|$)");
  return re.test(window.location)
}



function getCookie(name) {
  var start = document.cookie.indexOf(name + "=");
  var len = start + name.length + 1;
  
  if ((!start) && (name != document.cookie.substring(0, name.length)))
    return null;

  if (start == -1)
    return null;

  var end = document.cookie.indexOf(";", len);

  if (end == -1)
    end = document.cookie.length;

  return unescape(document.cookie.substring(len, end));
}

function deleteCookie(name, path, domain) {
  if (getCookie(name))
    document.cookie = name + "=" + ((path) ? ";path=" + path : "") + ((domain) ? ";domain=" + domain : "") + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

//Flash slideshow code
//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;
//}
//end Flash slideshow code