/* ===============================================================================
	STABIPLAN GLOBAL JAVASCRIPT:
	All these functions are needed globally
==================================================================================
	NOTES:
	- Minified with YUICOMPRESSOR
	- Org files are supplied with the .min.js versions
================================================================================*/

// Load minified other scripts:
/* superfish.min.js - Superfish v1.4.8 - jQuery menu widget, Copyright (c) 2008 Joel Birch */
(function(b){b.fn.superfish=function(k){var g=b.fn.superfish,j=g.c,f=b(['<span class="',j.arrowClass,'"> &#187;</span>'].join("")),i=function(){var c=b(this),l=d(c);clearTimeout(l.sfTimer);c.showSuperfishUl().siblings().hideSuperfishUl()},e=function(){var c=b(this),m=d(c),l=g.op;clearTimeout(m.sfTimer);m.sfTimer=setTimeout(function(){l.retainPath=(b.inArray(c[0],l.$path)>-1);c.hideSuperfishUl();if(l.$path.length&&c.parents(["li.",l.hoverClass].join("")).length<1){i.call(l.$path)}},l.delay)},d=function(c){var l=c.parents(["ul.",j.menuClass,":first"].join(""))[0];g.op=g.o[l.serial];return l},h=function(c){c.addClass(j.anchorClass).append(f.clone())};return this.each(function(){var c=this.serial=g.o.length;var m=b.extend({},g.defaults,k);m.$path=b("li."+m.pathClass,this).slice(0,m.pathLevels).each(function(){b(this).addClass([m.hoverClass,j.bcClass].join(" ")).filter("li:has(ul)").removeClass(m.pathClass)});g.o[c]=g.op=m;b("li:has(ul)",this)[(b.fn.hoverIntent&&!m.disableHI)?"hoverIntent":"hover"](i,e).each(function(){if(m.autoArrows){h(b(">a:first-child",this))}}).not("."+j.bcClass).hideSuperfishUl();var l=b("a",this);l.each(function(n){var o=l.eq(n).parents("li");l.eq(n).focus(function(){i.call(o)}).blur(function(){e.call(o)})});m.onInit.call(this)}).each(function(){var c=[j.menuClass];if(g.op.dropShadows&&!(b.browser.msie&&b.browser.version<7)){c.push(j.shadowClass)}b(this).addClass(c.join(" "))})};var a=b.fn.superfish;a.o=[];a.op={};a.IE7fix=function(){var c=a.op;if(b.browser.msie&&b.browser.version>6&&c.dropShadows&&c.animation.opacity!=undefined){this.toggleClass(a.c.shadowClass+"-off")}};a.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};a.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};b.fn.extend({hideSuperfishUl:function(){var e=a.op,d=(e.retainPath===true)?e.$path:"";e.retainPath=false;var c=b(["li.",e.hoverClass].join(""),this).add(this).not(d).removeClass(e.hoverClass).find(">ul").hide().css("visibility","hidden");e.onHide.call(c);return this},showSuperfishUl:function(){var e=a.op,d=a.c.shadowClass+"-off",c=this.addClass(e.hoverClass).find(">ul:hidden").css("visibility","visible");a.IE7fix.call(c);e.onBeforeShow.call(c);c.animate(e.animation,e.speed,function(){a.IE7fix.call(c);e.onShow.call(c)});return this}})})(jQuery);
/* jquery.inputempty.min.js - jQuery Input Empty on Focus plugin 1.0  */
if(typeof jQuery!="undefined"){(function(a){jQuery.fn.emptyonfocus=function(b){var c={validInputsSelector:":visible:enabled:text, :visible:enabled:password, textarea:visible:enabled",getAllInputsIfEmpty:true,focusClassName:"focused"},b=a.extend(c,b);return this.each(function(){var e=a(this);if(e.is(b.validInputsSelector)){var d=a(elements)}else{if(e.is("form")){var d=e.find(b.validInputsSelector)}else{if(b.getAllInputsIfEmpty){var d=a(b.validInputsSelector)}}}if(d){d.focus(function(){if(a(this).val()===this.defaultValue){a(this).val("")}a(this).addClass(b.focusClassName)}).blur(function(){if(!a(this).val()){a(this).val(this.defaultValue)}a(this).removeClass(b.focusClassName)})}})}})(jQuery)};
/* jquery.replacemail.min.js - jQuery Replace Mail link plugin 1.0 */
if(typeof jQuery!="undefined"){(function(a){jQuery.fn.replacemail=function(b){var c={atSymbol:" [AT] ",domain:window.location.domain,domainString:"this domain",className:"email"},b=a.extend(c,b);return this.each(function(){var k=a(this);var i=k.text().toLowerCase();var d=b.atSymbol.toLowerCase();if(i.indexOf(d)>0){var j=i.substring(0,i.indexOf(d)).replace(/^\s+|\s+$/g,"");var f=i.substring(i.length,(i.indexOf(d)+d.length)).replace(/^\s+|\s+$/g,"");var h=b.domain;if(f!==window.location.domain&&f!==b.domainString){h=f}var e=j+"&#64;"+h;var g="<a href='mailto:"+e+"' class='"+b.className+"'>"+e+"</a>";k.replaceWith(g)}})}})(jQuery)};
/* jquery.simplecollapse.min.js - jQuery Simple Collapse plugin 1.0 */
if(typeof jQuery!="undefined"){(function(a){jQuery.fn.simplecollapse=function(b){var c={togglerSelector:".toggler",collapsibleSelector:".expandable",openedClassName:"open",toggleSpeed:"fast"},b=a.extend(c,b);return this.each(function(){var d=a(this);var e=d.find(b.togglerSelector);var f=d.find(b.collapsibleSelector);if(e.length>0&&f.length>0){f.each(function(){if(!d.hasClass(b.openedClassName)){a(this).hide()}});e.click(function(g){f.slideToggle(b.toggleSpeed);a(this).toggleClass(b.openedClassName);alert(g.currentTarget.nodeName);g.stop()})}else{if(this.tagName.toLowerCase()=="dl"){d.find("dd").each(function(){if(!a(this).parent().find("dt").hasClass(b.openedClassName)){a(this).hide()}});d.find("dt").each(function(){var g=a(this);g.click(function(){g.parent().find("dd").slideToggle(b.toggleSpeed);g.toggleClass(b.openedClassName)})})}}})}})(jQuery)};

// EXECUTING AT DOCUMENT READY
function init(){
	// Init dropdown menu for no capable browsers
	$('#main-navigation').superfish({'speed':'fast','autoArrows':false});

	// Convert hidden email addresses to proper email links
	$('.email').replacemail({domain:'stabiplan.nl'});

	// Automagically hide/show default input text onFocus
	$('#loginform').emptyonfocus();

	// COLLAPSIBLE: default = DL, DT = toggler, DD = expandable
	$('.collapsible').simplecollapse();
	// Options: All element could be togglers or expandables! check this out...
	// $('.wrapper').simplecollapse({'togglerSelector':'#logo','collapsibleSelector':'#secondary .submenu', 'speed':'slow'});
}

/* ===============================================================================
	On Document Ready: load init()
================================================================================*/
$(document).ready(init);