
/*
 * Superfish v1.4.8 - $ menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

;(function($){
	initialized = false;
	$.fn.superfish = function(op){
		if(initialized) return;
		initialized = true;
		var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
			over = function(){
				var superfish = $(this), menu = getMenu(superfish);
				clearTimeout(menu.sfTimer);
				superfish.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var superfish = $(this), menu = getMenu(superfish), o = sf.op;
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray(superfish[0],o.$path)>-1);
					superfish.hideSuperfishUl();
					if (o.$path.length && superfish.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($menu){
				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
				sf.op = sf.o[menu.serial];
				return menu;
			},
			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
			
		return this.each(function() {
			var s = this.serial = sf.o.length;
			var o = $.extend({},sf.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
			});
			sf.o[s] = sf.op = o;
			
			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );
			})
			.not('.'+c.bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			o.onInit.call(this);
			
		}).each(function() {
			var menuClasses = [c.menuClass];
			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
			$(this).addClass(menuClasses.join(' '));
		});
	};

	var sf = $.fn.superfish;
	sf.o = [];
	sf.op = {};
	sf.IE7fix = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
			this.toggleClass(sf.c.shadowClass+'-off');
		};
	sf.c = {
		bcClass     : 'sf-breadcrumb',
		menuClass   : 'sf-js-enabled',
		anchorClass : 'sf-with-ul',
		arrowClass  : 'sf-sub-indicator',
		shadowClass : 'sf-shadow'
	};
	sf.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		pathLevels	: 1,
		delay		: 800,
		animation	: {opacity:'show'},
		speed		: 'normal',
		autoArrows	: true,
		dropShadows : true,
		disableHI	: false,		// true disables hoverIntent detection
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = sf.op,
				not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility','hidden');
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = sf.op,
				sh = sf.c.shadowClass+'-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible');
			sf.IE7fix.call($ul);
			o.onBeforeShow.call($ul);
			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
			return this;
		}
	});

})(jQuery);


/*
 * Supersubs v0.2b - jQuery plugin
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 *
 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
 * their longest list item children. If you use this, please expect bugs and report them
 * to the jQuery Google Group with the word 'Superfish' in the subject line.
 *
 */

;(function($){ // $ will refer to jQuery within this closure

	$.fn.supersubs = function(options){
		var opts = $.extend({}, $.fn.supersubs.defaults, options);
		// return original object to support chaining
		return this.each(function() {
			// cache selections
			var $$ = $(this);
			// support metadata
			var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
			// get the font size of menu.
			// .css('fontSize') returns various results cross-browser, so measure an em dash instead
			var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
				'padding' : 0,
				'position' : 'absolute',
				'top' : '-999em',
				'width' : 'auto'
			}).appendTo($$).width(); //clientWidth is faster, but was incorrect here
			// remove em dash
			$('#menu-fontsize').remove();
			// cache all ul elements
			$ULs = $$.find('ul');
			// loop through each ul in menu
			$ULs.each(function(i) {	
				// cache this ul
				var $ul = $ULs.eq(i);
				// get all (li) children of this ul
				var $LIs = $ul.children();
				// get all anchor grand-children
				var $As = $LIs.children('a');
				// force content to one line and save current float property
				var liFloat = $LIs.css('white-space','nowrap').css('float');
				// remove width restrictions and floats so elements remain vertically stacked
				var emWidth = $ul.add($LIs).add($As).css({
					'float' : 'none',
					'width'	: 'auto'
				})
				// this ul will now be shrink-wrapped to longest li due to position:absolute
				// so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
				.end().end()[0].clientWidth / fontsize;
				// add more width to ensure lines don't turn over at certain sizes in various browsers
				emWidth += o.extraWidth;
				// restrict to at least minWidth and at most maxWidth
				if (emWidth > o.maxWidth)		{ emWidth = o.maxWidth; }
				else if (emWidth < o.minWidth)	{ emWidth = o.minWidth; }
				emWidth += 'em';
				// set ul to width in ems
				$ul.css('width',emWidth);
				// restore li floats to avoid IE bugs
				// set li width to full width of this ul
				// revert white-space to normal
				$LIs.css({
					'float' : liFloat,
					'width' : '100%',
					'white-space' : 'normal'
				})
				// update offset position of descendant ul to reflect new width of parent
				.each(function(){
					var $childUl = $('>ul',this);
					var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right';
					$childUl.css(offsetDirection,emWidth);
				});
			});
			
		});
	};
	// expose defaults
	$.fn.supersubs.defaults = {
		minWidth		: 9,		// requires em unit.
		maxWidth		: 25,		// requires em unit.
		extraWidth		: 0			// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
	};
	
})(jQuery); // plugin code ends

var TINY={};

function T$(i){return document.getElementById(i)}
function T$$(e,p){return p.getElementsByTagName(e)}

TINY.slider=function(){
	function slide(n,p){this.n=n; this.init(p)}
	slide.prototype.init=function(p){
		var s=T$(p.id), u=this.u=T$$('ul',s)[0], c=T$$('li',u), l=c.length, i=this.l=this.c=0;
		if(p.navid&&p.activeclass){this.g=T$$('li',T$(p.navid)); this.s=p.activeclass}
		this.a=p.auto||0; this.p=p.resume||0; this.v=p.vertical||0; s.style.overflow='hidden';
		for(i;i<l;i++){if(c[i].parentNode==u){this.l++}}
		if(this.v){;
			u.style.top=0; this.h=p.height||c[0].offsetHeight; u.style.height=(this.l*this.h)+'px'
		}else{
			u.style.left=0; this.w=p.width||c[0].offsetWidth; u.style.width=(this.l*this.w)+'px'
		}
		this.pos(p.position||0,this.a?1:0)
	},
	slide.prototype.auto=function(){
		this.u.ai=setInterval(new Function(this.n+'.move(1,1)'),this.a*1000)
	},
	slide.prototype.move=function(d,a){
		var n=this.c+d, i=d==1?n==this.l?0:n:n<0?this.l-1:n; this.pos(i,a)
	},
	slide.prototype.pos=function(p,a){
		clearInterval(this.u.ai); clearInterval(this.u.si);
		var o=this.v?parseInt(this.u.style.top):parseInt(this.u.style.left),
		t=this.v?p*this.h:p*this.w, d=t>Math.abs(o)?1:-1; t=t*-1; this.c=p;
		if(this.g){for(var i=0;i<this.l;i++){this.g[i].className=i==p?this.s:''}}
		this.u.si=setInterval(new Function(this.n+'.slide('+t+','+d+','+a+')'),20)
	},
	slide.prototype.slide=function(t,d,a){
		var o=this.v?parseInt(this.u.style.top):parseInt(this.u.style.left);
		if(o==t){
			clearInterval(this.u.si); if(a||(this.a&&this.p)){this.auto()}
		}else{
			var v=o-Math.ceil(Math.abs(t-o)*.15)*d+'px';
			this.v?this.u.style.top=v:this.u.style.left=v
		}
	};
	return{slide:slide}
}();

(function($) {
	/*
		jquery.twitter.js v1.0
		Last updated: 26 October 2008

		Created by Damien du Toit
		http://coda.co.za/blog/2008/10/26/jquery-plugin-for-twitter

		Licensed under a Creative Commons Attribution-Non-Commercial 3.0 Unported License
		http://creativecommons.org/licenses/by-nc/3.0/
	*/

	$.fn.getTwitter = function(options) {
		var o = $.extend({}, $.fn.getTwitter.defaults, options);
	
		// hide container element
		$(this).hide();
	
		// add heading to container element
		//if (o.showHeading) {
			//$(this).append('<h2>'+o.headingText+'</h2>');
		//}

		// add twitter list to container element
		$(this).append('<ul id="twitter_update_list"><li></li></ul>');

		// hide twitter list
		$("ul#twitter_update_list").hide();

		// add preLoader to container element
		var pl = $('<p id="'+o.preloaderId+'">'+o.loaderText+'</p>');
		$(this).append(pl);

		// add Twitter profile link to container element
		if (o.showProfileLink) {
			$(this).append('<a id="profileLink" href="http://twitter.com/'+o.userName+'">volg ons op Twitter</a>');
		}

		// show container element
		$(this).show();
	
		$.getScript("http://twitter.com/javascripts/blogger.js");
		$.getScript("http://twitter.com/statuses/user_timeline/"+o.userName+".json?callback=twitterCallback2&count="+o.numTweets, function() {
			// remove preLoader from container element
			$(pl).remove();

			// show twitter list
			if (o.slideIn) {
				$("ul#twitter_update_list").slideDown(1000);
			}
			else {
				$("ul#twitter_update_list").show();
			}

			// give first list item a special class
			$("ul#twitter_update_list li:first").addClass("firstTweet");

			// give last list item a special class
			$("ul#twitter_update_list li:last").addClass("lastTweet");
		});
	};

	// plugin defaults
	$.fn.getTwitter.defaults = {
		userName: null,
		numTweets: 5,
		preloaderId: "preloader",
		loaderText: "Loading tweets...",
		slideIn: false,
		showHeading: true,
		headingText: "Latest Tweets",
		showProfileLink: true
	};
})(jQuery);


/**
 * jQuery gMap v3
 *
 * @url http://www.smashinglabs.pl/gmap
 * @author Sebastian Poreba <sebastian.poreba@gmail.com>
 * @version 3.2.0
 * @date 19.08.2011
 */
(function(i){var d=google.maps,m=new d.Geocoder,n=0,e={},e={init:function(a){var b,c=i.extend({},i.fn.gMap.defaults,a);for(b in i.fn.gMap.defaults.icon)c.icon[b]||(c.icon[b]=i.fn.gMap.defaults.icon[b]);return this.each(function(){var a=i(this),b=e._getMapCenter.apply(a,[c]);if(c.zoom=="fit")c.zoom=e.autoZoom.apply(a,[c]);var j=new d.Map(this,{zoom:c.zoom,center:b,mapTypeControl:c.mapTypeControl,zoomControl:c.zoomControl,panControl:c.panControl,scaleControl:c.scaleControl,streetViewControl:c.streetViewControl,
mapTypeId:c.maptype,scrollwheel:c.scrollwheel,maxZoom:c.maxZoom,minZoom:c.minZoom});c.log&&console.log("map center is:");c.log&&console.log(b);a.data("$gmap",j);a.data("gmap",{opts:c,gmap:j,markers:[],markerKeys:{},infoWindow:null});if(c.controls.length!==0)for(b=0;b<c.controls.length;b+=1)j.controls[c.controls[b].pos].push(c.controls[b].div);c.markers.length!==0&&e.addMarkers.apply(a,[c.markers]);e._onComplete.apply(a,[])})},_onComplete:function(){var a=this.data("gmap"),b=this;if(n!==0)window.setTimeout(function(){e._onComplete.apply(b,
[])},1E3);else a.opts.onComplete()},_setMapCenter:function(a){var b=this.data("gmap");b.opts.log&&console.log("delayed setMapCenter called");if(b.gmap!==void 0)b.gmap.setCenter(a);else{var c=this;window.setTimeout(function(){e._setMapCenter.apply(c,[a])},500)}},_boundaries:null,_getBoundaries:function(a){if(e._boundaries)return e._boundaries;var b=a.markers[0].latitude,c=a.markers[0].longitude,d=a.markers[0].longitude,f=a.markers[0].latitude,j;for(j=1;j<a.markers.length;j+=1){if(b>a.markers[j].latitude)b=
a.markers[j].latitude;if(c<a.markers[j].longitude)c=a.markers[j].longitude;if(d>a.markers[j].longitude)d=a.markers[j].longitude;if(f<a.markers[j].latitude)f=a.markers[j].latitude}e._boundaries={N:b,E:c,W:d,S:f};return e._boundaries},_getMapCenter:function(a){var b,c=this,g,f;if(a.markers.length&&(a.latitude=="fit"||a.longitude=="fit"))return b=e._getBoundaries(a),b=new d.LatLng((b.N+b.S)/2,(b.E+b.W)/2);if(a.latitude&&a.longitude)return b=new d.LatLng(a.latitude,a.longitude);else b=new d.LatLng(0,
0);if(a.address)return m.geocode({address:a.address},function(b,d){d===google.maps.GeocoderStatus.OK?e._setMapCenter.apply(c,[b[0].geometry.location]):a.log&&console.log("Geocode was not successful for the following reason: "+d)}),b;if(a.markers.length>0){f=null;for(g=0;g<a.markers.length;g+=1)if(a.markers[g].setCenter){f=a.markers[g];break}if(f===null)for(g=0;g<a.markers.length;g+=1){if(a.markers[g].latitude&&a.markers[g].longitude){f=a.markers[g];break}a.markers[g].address&&(f=a.markers[g])}if(f===
null)return b;if(f.latitude&&f.longitude)return new d.LatLng(f.latitude,f.longitude);f.address&&m.geocode({address:f.address},function(b,d){d===google.maps.GeocoderStatus.OK?e._setMapCenter.apply(c,[b[0].geometry.location]):a.log&&console.log("Geocode was not successful for the following reason: "+d)})}return b},setZoom:function(a){var b=this.data("gmap").gmap;a==="fit"&&(a=e.autoZoom.apply(i(this),[]));b.setZoom(parseInt(a))},getRoute:function(a){var b=this.data("gmap"),c=b.gmap,g=new d.DirectionsRenderer,
f=new d.DirectionsService,j={BYCAR:d.DirectionsTravelMode.DRIVING,BYBICYCLE:d.DirectionsTravelMode.BICYCLING,BYFOOT:d.DirectionsTravelMode.WALKING},h={MILES:d.DirectionsUnitSystem.IMPERIAL,KM:d.DirectionsUnitSystem.METRIC},e=null,k=null,l=null;a.routeDisplay!==void 0?e=a.routeDisplay instanceof jQuery?a.routeDisplay[0]:typeof a.routeDisplay=="string"?i(a.routeDisplay)[0]:null:b.opts.routeDisplay!==null&&(e=b.opts.routeDisplay instanceof jQuery?b.opts.routeDisplay[0]:typeof b.opts.routeDisplay=="string"?
i(b.opts.routeDisplay)[0]:null);g.setMap(c);e!==null&&g.setPanel(e);k=j[b.opts.travelMode]!==void 0?j[b.opts.travelMode]:j.BYCAR;l=h[b.opts.travelUnit]!==void 0?h[b.opts.travelUnit]:h.KM;f.route({origin:a.from,destination:a.to,travelMode:k,unitSystem:l},function(a,c){c==d.DirectionsStatus.OK?g.setDirections(a):e!==null&&i(e).html(b.opts.routeErrors[c])});return this},processMarker:function(a,b,c,g){var f=this.data("gmap"),e=f.gmap,h=f.opts,i;g===void 0&&(g=new d.LatLng(a.latitude,a.longitude));if(!b)var k=
{image:h.icon.image,iconSize:new d.Size(h.icon.iconsize[0],h.icon.iconsize[1]),iconAnchor:new d.Point(h.icon.iconanchor[0],h.icon.iconanchor[1]),infoWindowAnchor:new d.Size(h.icon.infowindowanchor[0],h.icon.infowindowanchor[1])},b=new d.MarkerImage(k.image,k.iconSize,null,k.iconAnchor);c||(new d.Size(h.icon.shadowsize[0],h.icon.shadowsize[1]),k&&k.iconAnchor||new d.Point(h.icon.iconanchor[0],h.icon.iconanchor[1]));i=new d.Marker({position:g,icon:b,title:a.title,map:e});i.setShadow(c);f.markers.push(i);
a.key&&(f.markerKeys[a.key]=i);var l;a.html&&(b={content:typeof a.html==="string"?h.html_prepend+a.html+h.html_append:a.html,pixelOffset:a.infoWindowAnchor},h.log&&console.log("setup popup with data"),h.log&&console.log(b),l=new d.InfoWindow(b),d.event.addListener(i,"click",function(){h.log&&console.log("opening popup "+a.html);h.singleInfoWindow&&f.infoWindow&&f.infoWindow.close();l.open(e,i);f.infoWindow=l}));if(a.html&&a.popup)h.log&&console.log("opening popup "+a.html),l.open(e,i),f.infoWindow=
l},_geocodeMarker:function(a,b,c){n+=1;var g=this;m.geocode({address:a.address},function(f,j){n-=1;j===d.GeocoderStatus.OK?(g.data("gmap").opts.log&&console.log("Geocode was successful with point: ",f[0].geometry.location),e.processMarker.apply(g,[a,b,c,f[0].geometry.location])):g.data("gmap").opts.log&&console.log("Geocode was not successful for the following reason: "+j)})},autoZoom:function(a){var b=this.data("gmap"),c,d=39135.758482,a=b?b.opts:a;a.log&&console.log("autozooming map");b=e._getBoundaries(a);
a=(b.E-b.W)*111E3/this.width();c=(b.S-b.N)*111E3/this.height();for(b=2;b<20;b+=1){if(a>d||c>d)break;d/=2}return b-2},addMarkers:function(a){var b=this.data("gmap").opts;if(a.length!==0){b.log&&console.log("adding "+a.length+" markers");for(b=0;b<a.length;b+=1)e.addMarker.apply(i(this),[a[b]])}return this},addMarker:function(a){var b=this.data("gmap").opts;b.log&&console.log("putting marker at "+a.latitude+", "+a.longitude+" with address "+a.address+" and html "+a.html);var c=b.icon.image,g=new d.Size(b.icon.iconsize[0],
b.icon.iconsize[1]),f=new d.Point(b.icon.iconanchor[0],b.icon.iconanchor[1]),j=new d.Size(b.icon.infowindowanchor[0],b.icon.infowindowanchor[1]),h=b.icon.shadow,i=new d.Size(b.icon.shadowsize[0],b.icon.shadowsize[1]),k=f;a.infoWindowAnchor=j;if(a.icon){if(a.icon.image)c=a.icon.image;a.icon.iconsize&&(g=new d.Size(a.icon.iconsize[0],a.icon.iconsize[1]));a.icon.iconanchor&&(f=new d.Point(a.icon.iconanchor[0],a.icon.iconanchor[1]));a.icon.infowindowanchor&&new d.Size(a.icon.infowindowanchor[0],a.icon.infowindowanchor[1]);
if(a.icon.shadow)h=a.icon.shadow;a.icon.shadowsize&&(i=new d.Size(a.icon.shadowsize[0],a.icon.shadowsize[1]))}c=new d.MarkerImage(c,g,null,f);h=new d.MarkerImage(h,i,null,k);if(a.address){if(a.html==="_address")a.html=a.address;if(a.title=="_address")a.title=a.address;b.log&&console.log("geocoding marker: "+a.address);e._geocodeMarker.apply(this,[a,c,h])}else{if(a.html==="_latlng")a.html=a.latitude+", "+a.longitude;if(a.title=="_latlng")a.title=a.latitude+", "+a.longitude;b=new d.LatLng(a.latitude,
a.longitude);e.processMarker.apply(this,[a,c,h,b])}return this},removeAllMarkers:function(){var a=this.data("gmap").markers,b;for(b=0;b<a.length;b+=1)a[b].setMap(null),delete a[b];a.length=0},getMarker:function(a){return this.data("gmap").markerKeys[a]}};i.fn.gMap=function(a){if(e[a])return e[a].apply(this,Array.prototype.slice.call(arguments,1));else if(typeof a==="object"||!a)return e.init.apply(this,arguments);else i.error("Method "+a+" does not exist on jQuery.gmap")};i.fn.gMap.defaults={log:!1,
address:"",latitude:null,longitude:null,zoom:3,maxZoom:null,minZoom:null,markers:[],controls:{},scrollwheel:!0,maptype:google.maps.MapTypeId.ROADMAP,mapTypeControl:!0,zoomControl:!0,panControl:!1,scaleControl:!1,streetViewControl:!0,singleInfoWindow:!0,html_prepend:'<div class="gmap_marker">',html_append:"</div>",icon:{image:"http://www.google.com/mapfiles/marker.png",iconsize:[20,34],iconanchor:[9,34],infowindowanchor:[9,2],shadow:"http://www.google.com/mapfiles/shadow50.png",shadowsize:[37,34]},
onComplete:function(){},travelMode:"BYCAR",travelUnit:"KM",routeDisplay:null,routeErrors:{INVALID_REQUEST:"The provided request is invalid.",NOT_FOUND:"One or more of the given addresses could not be found.",OVER_QUERY_LIMIT:"A temporary error occured. Please try again in a few minutes.",REQUEST_DENIED:"An error occured. Please contact us.",UNKNOWN_ERROR:"An unknown error occured. Please try again.",ZERO_RESULTS:"No route could be found within the given addresses."}}})(jQuery);
