	(function($){ 
			jQuery.fn.mailto = function() {
				return this.each(function(){
					var email = $(this).html().replace(/\s*\(.+\)\s*/, "@");
					$(this).before('<a href="mailto:' + email + '?subject=contact%20via%20website" rel="nofollow" title="Email ' + email + '">' + email + '</a>').remove();
				});
			};
			$(function(){
				$('.email').mailto();
			});
		})(jQuery);
		$.fn.setAllToMaxHeight = function(){
			return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
		}
		
		$(function(){
		  // time between image rotate
		  var delay = 2000;
		  
		  // for each list item in 
		  // the rotator ul, generate
		  // show a random list item
		  $('#rotator > li').each(function(){
		    // save images in an array
		    var $imgArr = $(this).children();
		    // show a random image
		    $imgArr.eq(Math.floor(Math.random()*$imgArr.length)).show();
		  });
		  // run the changeImage function after every (delay) miliseconds
		  setInterval(function(){
		    changeImage();
		  },delay);
		  
		  function changeImage(){
		    // save list items in an array
		    var $liArr = $('#rotator > li');
		    // select a random list item
		    var $currLi = $liArr.eq(Math.floor(Math.random()*$liArr.length));
		    // get the currently visible image
		    var $currImg = $('.rotator-image:visible', $currLi);
		    if ($currImg.next().length == 1) {
		      var $next = $currImg.next();
		    } else {
		      var $next = $('.rotator-image:first', $currLi);
		    }
		    $currImg.fadeOut();
		    $next.fadeIn();
		  }  
		});

		$(document).ready(function (){
			$('.popupDescription').tipsy({html: true, gravity: $.fn.tipsy.autoNS});
			
			$('div.autoheight').setAllToMaxHeight();
			$('div.footerHeight').setAllToMaxHeight();
			
			//When you click on a link with class of poplight and the href starts with a # 
			$('a.poplight[href^=#]').click(function() {
			    var popID = $(this).attr('rel'); //Get Popup Name
			    var popURL = $(this).attr('href'); //Get Popup href to define size
			
			    //Pull Query & Variables from href URL
			    var query= popURL.split('?');
			    var dim= query[1].split('&');
			    var popWidth = dim[0].split('=')[1]; //Gets the first query string value
			
			    //Fade in the Popup and add close button
			    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');
			
			    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
			    var popMargTop = 500;//($('#' + popID).height() ) / 2 + 400;
			    var popMargLeft = ($('#' + popID).width() + 80) / 2;
			
			    //Apply Margin to Popup
			    $('#' + popID).css({
			        'margin-top' : -popMargTop,
			        'margin-left' : -popMargLeft
			    });
			
			    //Fade in Background
			    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
			    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 
				$('#popup_name').html('<iframe src="http://login.e-mailstation.nl/rwcode/subscribe.aspx?resize=0&Mode=subscribe&SiteID=9828&SID=4" width="490" height="620" scrolling=no></iframe>');
			    
			    return false;
			});
			
			//Close Popups and Fade Layer
			$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
			    $('#fade , .popup_block').fadeOut(function() {
			        $('#fade, a.close').remove();  //fade them both out
			    });
			    return false;
			});
		});
		
