/*new slideshow*/
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="left">'+ '<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;
} 

/*extra galleries page*/
function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

/*hide some of the Categories*/
function delCategory() {
  re = /\/(GetConnected|Friends)$/;

  if (YD.hasClass(document.body, 'loggedIn'))
    return;

  var oList = YD.getElementsByClassName('miniBox', 'div', YD.get('categoriesBox'));

  for (i = 0; i < oList.length; i++) {
    if (re.test(oList[i].getElementsByTagName('a')[0].href))
      oList[i].parentNode.removeChild(oList[i]);
  }
YE.onContentReady('categoriesBox', delCategory);
}


/*don't automatically scroll filmstrip*/
filmstripMove = 0;

/*don't break frames*/
/*framesWarning = false;*/

/*vanity URLS*/
var vanityTable = 
 {
     above : "http://www.paulbrockphotography.co.uk/gallery/4393077_ttt46",
     allstar : "http://www.paulbrockphotography.co.uk/gallery/7288050_tSvVv",
     assistants : "http://www.paulbrockphotography.co.uk/gallery/6518001_yffsF",
     aftersparks : "http://www.paulbrockphotography.co.uk/gallery/4160959",
     alasthenobles : "http://www.paulbrockphotography.co.uk/gallery/4329057_oikY9",
     albenaza : "http://www.paulbrockphotography.co.uk/gallery/3919642",
   annabelleschristening : "http://www.paulbrockphotography.co.uk/gallery/8521816_ufx3n",
     amanaandsaud : "http://www.paulbrockphotography.co.uk/Weddings/Amana-and-Saud/10223683_uQexf",
     asic2008: "http://www.paulbrockphotography.co.uk/gallery/5511805_XPyns",
     bivdaagm : "http://www.paulbrockphotography.co.uk/gallery/6526089_BiZay",
     bivdaapril : "http://www.paulbrockphotography.co.uk/gallery/4837179_p355f",
     bellasbirthday :"http://www.paulbrockphotography.co.uk/gallery/7332338_ZhHjn",
     biglunch : "http://www.paulbrockphotography.co.uk/gallery/9145989_f85iz",
     boroughmarket : "http://www.paulbrockphotography.co.uk/gallery/4946740_FL3KL",
     debrarose : "http://www.paulbrockphotography.co.uk/gallery/8134881_jRkEh",
     dance4life1 : "http://www.paulbrockphotography.co.uk/gallery/6549216_iwBAV",
     dance4life2 : "http://www.paulbrockphotography.co.uk/gallery/6607899_g7zr4",
     dance4life3 : "http://www.paulbrockphotography.co.uk/gallery/6783010_kLZKy",
     eastmeetsjest2 : "http://www.paulbrockphotography.co.uk/gallery/4972001_BWtWt",
     elizabethandsheena : "http://www.paulbrockphotography.co.uk/gallery/6544598_z26t3",
     emmasbirthday : "http://www.paulbrockphotography.co.uk/gallery/9182882_gnwBW",
     enfieldprom : "http://www.paulbrockphotography.co.uk/gallery/5519360_KAcyH",
     eventphotos : "http://www.paulbrockphotography.co.uk/gallery/3540590",
     festival : "http://www.paulbrockphotography.co.uk/gallery/3666840",
     firstassist : "http://www.paulbrockphotography.co.uk/gallery/7822989_tE9LL",
     flashpoint : "http://www.paulbrockphotography.co.uk/gallery/5494146_SLDax",
     funkstationzebra : "http://www.paulbrockphotography.co.ukgallery/4079421",
     fireworks : "http://www.paulbrockphotography.co.uk/gallery/3540435",
     gforce : "http://www.paulbrockphotography.co.uk/gallery/3727934_PAGJP",
     gigs : "http://www.paulbrockphotography.co.uk/gallery/3545593",
     hannahanddom : "http://www.paulbrockphotography.co.uk/Weddings/Han-n-Doms-w/10162440_uJSgQ",
     helenaandmarkswedding : "http://www.paulbrockphotography.co.uk/Weddings/HelenaandMark/9413107_W74SF",
     hilaryandbob : "http://www.paulbrockphotography.co.uk/gallery/8694384_2gajg",
     lightupdover : "http://www.paulbrockphotography.co.uk/gallery/6106580_rM9SC",
     newmanparty : "http://www.paulbrockphotography.co.uk/gallery/7168665_TWoPG",
     inspire : "http://paulbrock.smugmug.com/gallery/8603585_nSUAx",
     ironik : "http://www.paulbrockphotography.co.uk/gallery/3974729",
     jamessbirthday : "http://www.paulbrockphotography.co.uk/gallery/8661418_sZjdX",
     jubilee : "http://www.paulbrockphotography.co.uk/gallery/3655347_SxwMb",
     louiseandandy : "http://www.paulbrockphotography.co.uk/Weddings/Louiseandandy/9492886_hPW2J",
     kathrynandsteve : "http://www.paulbrockphotography.co.uk/gallery/6848483_4b7GD",
     katharynandpaul : "http://www.paulbrockphotography.co.uk/Weddings/Katharynand/9905051_Eg7gG",
     kemiliasbirthday : "http://www.paulbrockphotography.co.uk/gallery/8980858_ziJdN",
     louissmardina : "http://www.paulbrockphotography.co.uk/Parties/Louiss-Bar-Mita/10043948_AJo4U",
     margaretandphil : "http://www.paulbrockphotography.co.uk/Weddings/Margaret-and-Phil/10215398_6PzL3",
     michaelgoodhill : "http://www.paulbrockphotography.co.uk/Parties/Michaels-Birthday/9860806_sZkyU",
     nikitasbirthday : "http://www.paulbrockphotography.co.uk/Parties/Nikitas-Birthd/9897993_p3Q9W",
     nspcccinema : "http://www.paulbrockphotography.co.uk/gallery/8689036_WsJpX",
     oorufc : "http://www.paulbrockphotography.co.uk/gallery/6045602_uEo5P",
     oorufc2 : "http://www.paulbrockphotography.co.uk/gallery/8047898_fP4j4",
     pendragon : "http://www.paulbrockphotography.co.uk/gallery/5937276_mqNhD",
     phoenixfireworks : "http://www.paulbrockphotography.co.uk/gallery/3743544_Tfu5X",
     phoenixfireworks2008 : "http://www.paulbrockphotography.co.uk/gallery/6316841_puj4v",
     plymouth : "http://www.paulbrockphotography.co.uk/gallery/5693040_cB5wf",
     pyromania : "http://www.paulbrockphotography.co.uk/gallery/3667651",
     reecesbarmitzvah :  "http://www.paulbrockphotography.co.uk/Parties/ReeceBarMitzvah/10402613_LasbD",
     rspb1 : "http://www.paulbrockphotography.co.uk/gallery/6792061_WqDh6",
     rspb2 : "http://www.paulbrockphotography.co.uk/gallery/7661422_wQrbD",
     saracrystal : "http://www.paulbrockphotography.co.uk/gallery/4877756_59baf", 
     setfashionfreeyouth : "http://www.paulbrockphotography.co.uk/gallery/6180687_WKxYZ",
     sport : "http://www.paulbrockphotography.co.uk/gallery/3540469",
     sketchbeat : "http://www.paulbrockphotography.co.uk/gallery/4174640",
     starfireworks : "http://www.paulbrockphotography.co.uk/gallery/5748183_68kHL",
     spitfirepyrotechnics : "http://www.paulbrockphotography.co.uk/gallery/5812275_UDrkP",
     spyrotechnics : "http://www.paulbrockphotography.co.uk/gallery/4413526_MX3EU",
     spyrotechnics2 : "http://www.paulbrockphotography.co.uk/gallery/5679482_XfZVp",
     revelation : "http://www.paulbrockphotography.co.uk/gallery/5242094_3ooRq",
     thedaves : "http://www.paulbrockphotography.co.uk/gallery/4528830_5WNsb",
     tsangvisit : "http://paulbrock.smugmug.com/gallery/6614241_LBo3b",
     tuition : "http://www.paulbrockphotography.co.uk/gallery/6597267_SLe9L",
     vanessasanchez : "http://www.paulbrockphotography.co.uk/gallery/7770756_VPtZa",
     underclass : "http://www.paulbrockphotography.co.uk/gallery/4528754_86Ucw",
     wedding : "http://www.paulbrockphotography.co.uk/gallery/7288671_FRmij"
 };

 function CheckRedirects()
 {
     if (YD.hasClass(document.body, 'homepage'))    // only run this code on the home page
     {
         // 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 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
         }
     }
 }
//filmStrip values you can override:
rightMoves = -5;
leftMoves = 5;

function setPaypalForm(form) {
 form.item_name.value = photoInfo[ImageID]['fileName'] + form.item_name.value;
}


//clever analytics stuff
function noPercent(x)
{
	x = unescape(x);
	return x.replace(/\+/g," ").replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

function getRef()
{
	ref = document.referrer;
	re = /(\?|&)(q|p|query|encquery|qt|terms|rdata|qs|wd|text|szukaj|k|searchExpr|search_for|string|search_query|searchfor)=([^&]+)/;
	searchq = re.exec(ref);
	if(searchq) {
		searchq[3] = noPercent(searchq[3]);
		sleuthTracker._setVar(searchq[3]);
	}
	else {
		sleuthTracker._setVar(document.referrer);
	}
}

function sleuth()
{
	if(document.location.search.indexOf("gclid")!=-1||document.location.search.indexOf("cpc")!=-1) {
		getRef();
	}
}
