

		
		


		
		
		
	
	
	
		
		
	


			function prettyme() {
		 Cufon.replace('h1.sifr,a.blog-heading,.portfolio-item .title', { fontWeight:'normal' });
		 Cufon.replace('#menu1 h2 a', { 
		 	fontSize:'14px', 
			textShadowz: '2px 2px #cdcdcd',
			hoverx: { color:'#b54c63' } 
		 });
		 Cufon.replace('#footer-menu > li > span a', { 
		 	fontSize:'19px', 
			textShadowz: '2px 2px #cdcdcd',
			hoverx: { color:'#b54c63' } 
		 });
		 Cufon.replace('#slidegroup h3, .slidegroup h3', { 
		 	color: '#54504d',
			fontSize:'13px', 
			textShadow: '2px 2px #e7e6e5'
		 });
		 Cufon.now();
	}

	function jumpScroll(id) { 
		$('html,body').animate({scrollTop: $("a[name="+id+"]").offset().top-280},'slow'); 
		$("a[name="+id+"]").trigger('click');
	}

	jQuery().ready(function() {

		$.ajaxSetup ({ cache: false });
		
		$('#sortable tr:odd, .sortable tr:odd').addClass('odd');
		$('#sortable tr:even, .sortable tr:even').addClass('even');

		$("div.profilev > img, div.profileh > img").wrap('<a class="fancy"></a>');
		$("div.profilev > a, div.profileh > a").each(
			function( intIndex ){
				$(this).attr('href', $(this).find('img').attr('src'));
			}
		);


		$("a.fancy").fancybox({
			'hideOnContentClick'	: false,
			'width'					: Math.min(860, $(window).width() - 60),
			'height'				: $(window).height() - 60,
			'autoScale'				: false,
			'autoDimensions'		: false,
			'overlayShow'			: true,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack'
		});  

		$("a.fancyportfolio").fancybox({
			'hideOnContentClick'	: false,
			'autoScale'				: true,
			'autoDimensions'		: true,
			'overlayShow'			: true,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'centerOnScroll'		: true,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack',
			titlePosition			: 'over'
		});  

		$("a.iframe").fancybox({
			'hideOnContentClick'	: false,
			'width'					: Math.min(950, $(window).width() - 200),
			'height'				: $(window).height() - 200,
			'autoScale'				: false,
			'autoDimensions'		: false,
			'overlayShow'			: true,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack'
		});  

		$("a.showcase").fancybox({
			'hideOnContentClick'	: false,
			'width'					: 660,
			'height'				: $(window).height() - 60,
			'autoScale'				: false,
			'autoDimensions'		: false,
			'overlayShow'			: false,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack',
			'centerOnScroll'		: false,
			'callbackOnClose'		: function() { $('#viewport').html(''); }
		}); 

		$("#events a,.calevent").click(function(event) {
			event.preventDefault();

			$.fancybox({
				'href'					: $(this).attr("href") + "?ajax=yes",
				'hideOnContentClick'	: false,
				'width'					: 500,
				'height'				: Math.min($(window).height()-100, 500),
				'autoDimensions'		: false,
				'overlayShow'			: false,
				'zoomSpeedIn'			: 600,
				'zoomSpeedOut'			: 500,
				'easingIn'				: 'easeOutBack',
				'easingOut'				: 'easeInBack'
			});
		});

		$('a[href$="mov"]').click(function() { 
			$.fancybox({
				centerOnScroll	: true,
				overlayOpacity	: 0.8,
				padding			: 0,
				autoScale		: false,
				width			: 662,
				height			: Math.min($(window).height()-50, 584),
				href			: '/flash/misc/flvplayer.swf',
				type			: 'swf',
				swf				: 	{
									'bgcolor': '#cdcdcd',
									'wmode'		: 'transparent',
									'allowfullscreen'	: 'true',
									'flashvars': '&skin=/universal/scripts/jquery/plugins/media/skins/beelden/beelden.xml' +
									'&file=' + $(this).attr('href') + 
									'&autostart=true' +
									'&image=' + $(this).attr('rel') 
									}
			});
			
			return false;
		});
				

		$("div.profilev > a > img").css('height', '133px');
		$("div.profileh > a > img").css('width', '133px');

		scaleJobPics = function() {

			$('#viewport img').load(function() {

				$('#viewport img').each(function() {
					var maxWidth = 500; // Max width for the image
					var maxHeight = 500;    // Max height for the image
					var ratio = 1;  // Used for aspect ratio
					var width = $(this).width();    // Current image width
					var height = $(this).height();  // Current image height
			 
					// Check if the current width is larger than the max
					if(width > maxWidth){
						ratio = maxWidth / width;   // get ratio for scaling image
						$(this).css("width", maxWidth); // Set new width
						$(this).css("height", height * ratio);  // Scale height based on ratio
						height = height * ratio;    // Reset height to match scaled image
					}
			 
					// Check if current height is larger than max
					if(height > maxHeight){
						ratio = maxHeight / height; // get ratio for scaling image
						$(this).css("height", maxHeight);   // Set new height
						$(this).css("width", width * ratio);    // Scale width based on ratio
						width = width * ratio;    // Reset width to match scaled image
					}
				
				});
			
			});
	  	}

		$('#menu > ul > li').mouseover(function(event, url){
			$('#menusubs').html('');
			$(this).children('ul:first').clone().prependTo('#menusubs');
 			if (typeof url != 'undefined') $("a[href*='"+url+"']").addClass("active");
			Cufon.replace('#menusubs a', { fontSize:'12px', hover:'#fff' });
			$('#menusubs').children('ul:first').fadeIn('slow');
	    });

		bannerOver = function() { 
			$('#header-banner').stop().animate({ height: '328px'}, 3000, function() { $('#banner-expand').fadeOut('slow'); } );
		}

		bannerOut = function() { 
			$('#header-banner').stop().animate({ height: '150px'}, 3000, function() { $('#banner-expand').fadeIn('slow'); } );
		}

    
		$("#slidegroup ul li > h3, .slidegroup ul li > h3").live("click", function(e) {
			$(this).parent().parent().parent().find("div").fadeOut("slow");
			$(this).parent().parent().parent().find("h3").removeAttr("class");
			$(this).parent().find("div").fadeIn("slow");
			$(this).attr("class", "active");
			if (document.location.href.indexOf("morphogine-platform") == -1) $(this).parent().parent().parent().animate({'height': Math.max($(this).parent().find("div").height(), $(this).parent().parent().height() )+50}, {duration: 500});
		});

		$("#slidegroup ul li:eq(0) h3, .slidegroup ul li:eq(0) h3").trigger("click");
		
		if (document.location.href.indexOf('#') != -1) $('a[name='+ document.location.href.split('#')[1] +']').trigger('click');

		slideTop = function() {
			$('html, body').animate({
				scrollTop: $("[name=slidetotop]").offset().top,
				scrollLeft: $("[name=slidetotop]").offset().left
			}, 1500);
		}

		$("img.popup").css("cursor", "pointer").click(function() {
			$.fancybox({
				'hideOnContentClick'	: false,
				'overlayShow'			: true,
				'zoomSpeedIn'			: 600,
				'zoomSpeedOut'			: 500,
				'easingIn'				: 'easeOutBack',
				'easingOut'				: 'easeInBack',
				'overlayOpacity'		: 0.8,
				'titlePosition'			: 'over',
				'href'					: $(this).attr('src')
			});  
			return false;
		});  
			
		$("img").pngfix();		
		
		
	});

	

	

