﻿$(document).ready(function(){photos=$(".home-gallery-image");photos_length=photos.length;for(i=0;i<photos_length;i++){var a=photos[i];$(a).data("photo_num",i+1)}$(".home-gallery-total").text(photos_length);first_photo=$(".home-gallery-image").first();last_photo=$(".home-gallery-image").last();first_photo.addClass("active");$(".home-gallery-current").text(first_photo.data("photo_num"));$(".home-gallery-next, .home-gallery-image").click(function(a){a.preventDefault();next=$(".home-gallery-image.active").next();if(next.length){$(".home-gallery-current").html(next.data("photo_num"));$(".home-gallery-image").removeClass("active");next.addClass("active")}else{$(".home-gallery-current").html(first_photo.data("photo_num"));$(".home-gallery-image").removeClass("active");first_photo.addClass("active")}});$(".home-gallery-previous").click(function(a){a.preventDefault();prev=$(".home-gallery-image.active").prev();if(prev.length){$(".home-gallery-current").html(prev.data("photo_num"));$(".home-gallery-image").removeClass("active");prev.addClass("active")}else{$(".home-gallery-current").html(last_photo.data("photo_num"));$(".home-gallery-image").removeClass("active");last_photo.addClass("active")}})});var swfobject=function(){var c="undefined",g="object",I="Shockwave Flash",U="ShockwaveFlash.ShockwaveFlash",t="application/x-shockwave-flash",H="SWFObjectExprInst",M="onreadystatechange",d=window,b=document,j=navigator,K=false,u=[Q],i=[],r=[],n=[],o,s,w,D,k=false,p=false,f,y,G=true,a=function(){var l=typeof b.getElementById!=c&&typeof b.getElementsByTagName!=c&&typeof b.createElement!=c,f=j.userAgent.toLowerCase(),h=j.platform.toLowerCase(),n=h?/win/.test(h):/win/.test(f),m=h?/mac/.test(h):/mac/.test(f),o=/webkit/.test(f)?parseFloat(f.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=!+"\131",e=[0,0,0],a=null;if(typeof j.plugins!=c&&typeof j.plugins[I]==g){a=j.plugins[I].description;if(a&&!(typeof j.mimeTypes!=c&&j.mimeTypes[t]&&!j.mimeTypes[t].enabledPlugin)){K=true;i=false;a=a.replace(/^.*\s+(\S+\s+\S+$)/,"$1");e[0]=parseInt(a.replace(/^(.*)\..*$/,"$1"),10);e[1]=parseInt(a.replace(/^.*\.(.*)\s.*$/,"$1"),10);e[2]=/[a-zA-Z]/.test(a)?parseInt(a.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof d.ActiveXObject!=c)try{var k=new ActiveXObject(U);if(k){a=k.GetVariable("$version");if(a){i=true;a=a.split(" ")[1].split(",");e=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}}}catch(p){}return{w3:l,pv:e,wk:o,ie:i,win:n,mac:m}}(),W=function(){if(!a.w3)return;(typeof b.readyState!=c&&b.readyState=="complete"||typeof b.readyState==c&&(b.getElementsByTagName("body")[0]||b.body))&&m();if(!k){typeof b.addEventListener!=c&&b.addEventListener("DOMContentLoaded",m,false);if(a.ie&&a.win){b.attachEvent(M,function(){if(b.readyState=="complete"){b.detachEvent(M,arguments.callee);m()}});d==top&&(function(){if(k)return;try{b.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}m()})()}a.wk&&(function(){if(k)return;if(!/loaded|complete/.test(b.readyState)){setTimeout(arguments.callee,0);return}m()})();J(m)}}();function m(){if(k)return;try{var c=b.getElementsByTagName("body")[0].appendChild(h("span"));c.parentNode.removeChild(c)}catch(e){return}k=true;for(var d=u.length,a=0;a<d;a++)u[a]()}function E(a){if(k)a();else u[u.length]=a}function J(a){if(typeof d.addEventListener!=c)d.addEventListener("load",a,false);else if(typeof b.addEventListener!=c)b.addEventListener("load",a,false);else if(typeof d.attachEvent!=c)R(d,"onload",a);else if(typeof d.onload=="function"){var e=d.onload;d.onload=function(){e();a()}}else d.onload=a}function Q(){if(K)T();else z()}function T(){var f=b.getElementsByTagName("body")[0],e=h(g);e.setAttribute("type",t);var d=f.appendChild(e);if(d){var i=0;(function(){if(typeof d.GetVariable!=c){var b=d.GetVariable("$version");if(b){b=b.split(" ")[1].split(",");a.pv=[parseInt(b[0],10),parseInt(b[1],10),parseInt(b[2],10)]}}else if(i<10){i++;setTimeout(arguments.callee,10);return}f.removeChild(e);d=null;z()})()}else z()}function z(){var o=i.length;if(o>0)for(var g=0;g<o;g++){var h=i[g].id,f=i[g].callbackFn,d={success:false,id:h};if(a.pv[0]>0){var b=e(h);if(b)if(q(i[g].swfVersion)&&!(a.wk&&a.wk<312)){l(h,true);if(f){d.success=true;d.ref=C(h);f(d)}}else if(i[g].expressInstall&&v()){var j={};j.data=i[g].expressInstall;j.width=b.getAttribute("width")||"0";j.height=b.getAttribute("height")||"0";if(b.getAttribute("class"))j.styleclass=b.getAttribute("class");if(b.getAttribute("align"))j.align=b.getAttribute("align");for(var p={},m=b.getElementsByTagName("param"),r=m.length,k=0;k<r;k++)if(m[k].getAttribute("name").toLowerCase()!="movie")p[m[k].getAttribute("name")]=m[k].getAttribute("value");A(j,p,h,f)}else{S(b);f&&f(d)}}else{l(h,true);if(f){var n=C(h);if(n&&typeof n.SetVariable!=c){d.success=true;d.ref=n}f(d)}}}}function C(f){var b=null,a=e(f);if(a&&a.nodeName=="OBJECT")if(typeof a.SetVariable!=c)b=a;else{var d=a.getElementsByTagName(g)[0];if(d)b=d}return b}function v(){return!p&&q("6.0.65")&&(a.win||a.mac)&&!(a.wk&&a.wk<312)}function A(g,j,i,n){p=true;w=n||null;D={success:false,id:i};var f=e(i);if(f){if(f.nodeName=="OBJECT"){o=x(f);s=null}else{o=f;s=i}g.id=H;if(typeof g.width==c||!/%$/.test(g.width)&&parseInt(g.width,10)<310)g.width="310";if(typeof g.height==c||!/%$/.test(g.height)&&parseInt(g.height,10)<137)g.height="137";b.title=b.title.slice(0,47)+" - Flash Player Installation";var m=a.ie&&a.win?"ActiveX":"PlugIn",k="MMredirectURL="+d.location.toString().replace(/&/g,"%26")+"&MMplayerType="+m+"&MMdoctitle="+b.title;if(typeof j.flashvars!=c)j.flashvars+="&"+k;else j.flashvars=k;if(a.ie&&a.win&&f.readyState!=4){var l=h("div");i+="SWFObjectNew";l.setAttribute("id",i);f.parentNode.insertBefore(l,f);f.style.display="none";(function(){if(f.readyState==4)f.parentNode.removeChild(f);else setTimeout(arguments.callee,10)})()}B(g,j,i)}}function S(b){if(a.ie&&a.win&&b.readyState!=4){var c=h("div");b.parentNode.insertBefore(c,b);c.parentNode.replaceChild(x(b),c);b.style.display="none";(function(){if(b.readyState==4)b.parentNode.removeChild(b);else setTimeout(arguments.callee,10)})()}else b.parentNode.replaceChild(x(b),b)}function x(e){var d=h("div");if(a.win&&a.ie)d.innerHTML=e.innerHTML;else{var f=e.getElementsByTagName(g)[0];if(f){var b=f.childNodes;if(b)for(var i=b.length,c=0;c<i;c++)!(b[c].nodeType==1&&b[c].nodeName=="PARAM")&&!(b[c].nodeType==8)&&d.appendChild(b[c].cloneNode(true))}}return d}function B(b,i,q){var n,l=e(q);if(a.wk&&a.wk<312)return n;if(l){if(typeof b.id==c)b.id=q;if(a.ie&&a.win){var o="";for(var d in b)if(b[d]!=Object.prototype[d])if(d.toLowerCase()=="data")i.movie=b[d];else if(d.toLowerCase()=="styleclass")o+=' class="'+b[d]+'"';else if(d.toLowerCase()!="classid")o+=" "+d+'="'+b[d]+'"';var p="";for(var m in i)if(i[m]!=Object.prototype[m])p+='<param name="'+m+'" value="'+i[m]+'" />';l.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+o+">"+p+"</object>";r[r.length]=b.id;n=e(b.id)}else{var j=h(g);j.setAttribute("type",t);for(var f in b)if(b[f]!=Object.prototype[f])if(f.toLowerCase()=="styleclass")j.setAttribute("class",b[f]);else f.toLowerCase()!="classid"&&j.setAttribute(f,b[f]);for(var k in i)i[k]!=Object.prototype[k]&&k.toLowerCase()!="movie"&&P(j,k,i[k]);l.parentNode.replaceChild(j,l);n=j}}return n}function P(d,b,c){var a=h("param");a.setAttribute("name",b);a.setAttribute("value",c);d.appendChild(a)}function N(c){var b=e(c);if(b&&b.nodeName=="OBJECT")if(a.ie&&a.win){b.style.display="none";(function(){if(b.readyState==4)O(c);else setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)}function O(c){var a=e(c);if(a){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}function e(c){var a=null;try{a=b.getElementById(c)}catch(d){}return a}function h(a){return b.createElement(a)}function R(c,a,b){c.attachEvent(a,b);n[n.length]=[c,a,b]}function q(d){var c=a.pv,b=d.split(".");b[0]=parseInt(b[0],10);b[1]=parseInt(b[1],10)||0;b[2]=parseInt(b[2],10)||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false}function L(k,l,d,m){if(a.ie&&a.mac)return;var j=b.getElementsByTagName("head")[0];if(!j)return;var e=d&&typeof d=="string"?d:"screen";if(m){f=null;y=null}if(!f||y!=e){var i=h("style");i.setAttribute("type","text/css");i.setAttribute("media",e);f=j.appendChild(i);if(a.ie&&a.win&&typeof b.styleSheets!=c&&b.styleSheets.length>0)f=b.styleSheets[b.styleSheets.length-1];y=e}if(a.ie&&a.win)f&&typeof f.addRule==g&&f.addRule(k,l);else f&&typeof b.createTextNode!=c&&f.appendChild(b.createTextNode(k+" {"+l+"}"))}function l(a,c){if(!G)return;var b=c?"visible":"hidden";if(k&&e(a))e(a).style.visibility=b;else L("#"+a,"visibility:"+b)}function F(a){var d=/[\\\"<>\.;]/,b=d.exec(a)!=null;return b&&typeof encodeURIComponent!=c?encodeURIComponent(a):a}var V=function(){a.ie&&a.win&&window.attachEvent("onunload",function(){for(var d=n.length,b=0;b<d;b++)n[b][0].detachEvent(n[b][1],n[b][2]);for(var g=r.length,c=0;c<g;c++)N(r[c]);for(var f in a)a[f]=null;a=null;for(var e in swfobject)swfobject[e]=null;swfobject=null})}();return{registerObject:function(c,e,f,d){if(a.w3&&c&&e){var b={};b.id=c;b.swfVersion=e;b.expressInstall=f;b.callbackFn=d;i[i.length]=b;l(c,false)}else d&&d({success:false,id:c})},getObjectById:function(b){if(a.w3)return C(b)},embedSWF:function(n,b,j,k,o,m,e,f,h,d){var i={success:false,id:b};if(a.w3&&!(a.wk&&a.wk<312)&&n&&b&&j&&k&&o){l(b,false);E(function(){j+="";k+="";var a={};if(h&&typeof h===g)for(var t in h)a[t]=h[t];a.data=n;a.width=j;a.height=k;var p={};if(f&&typeof f===g)for(var s in f)p[s]=f[s];if(e&&typeof e===g)for(var r in e)if(typeof p.flashvars!=c)p.flashvars+="&"+r+"="+e[r];else p.flashvars=r+"="+e[r];if(q(o)){var u=B(a,p,b);a.id==b&&l(b,true);i.success=true;i.ref=u}else if(m&&v()){a.data=m;A(a,p,b,d);return}else l(b,true);d&&d(i)})}else d&&d(i)},switchOffAutoHideShow:function(){G=false},ua:a,getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:q,createSWF:function(d,c,b){return a.w3?B(d,c,b):undefined},showExpressInstall:function(e,b,c,d){a.w3&&v()&&A(e,b,c,d)},removeSWF:function(b){a.w3&&N(b)},createCSS:function(b,e,d,c){a.w3&&L(b,e,d,c)},addDomLoadEvent:E,addLoadEvent:J,getQueryParamValue:function(e){var c=b.location.search||b.location.hash;if(c){if(/\?/.test(c))c=c.split("?")[1];if(e==null)return F(c);for(var d=c.split("&"),a=0;a<d.length;a++)if(d[a].substring(0,d[a].indexOf("="))==e)return F(d[a].substring(d[a].indexOf("=")+1))}return""},expressInstallCallback:function(){if(p){var b=e(H);if(b&&o){b.parentNode.replaceChild(o,b);if(s){l(s,true);if(a.ie&&a.win)o.style.display="block"}w&&w(D)}p=false}}}}();$(document).ready(function(){$(".youtube-placeholder").live("click",function(c){c.preventDefault();c.stopPropagation();var a=$(this).attr("href"),b=a.length,d=a.substring(b-11,b);$(this).remove();var e=$('<iframe class="youtube-player" type="text/html" width="627" height="406" src="http://www.youtube.com/embed/'+d+'?autoplay=1&hd=1" frameborder="0"></iframe>');$("#embeddedVideo").append(e)})})
