
	window.addEvent('domready', function()
		{
			// Make all links with class "external" open in new windows
			
			$$('a.external').each(function(link){
				link.target = "_blank";
			});
			
			// Portfolio scrolling feature...
			
			if($chk($('home_body')))  // If current page is home
				{
					function setPointerPosition(y_val)
						{
							if($chk($('pointer')))
								{
									$('pointer').morph({top: (y_val - 168)});
								}
						}
					
					// Set portfolio panel size to match browser dimensions on....
					
					function setPortfolioSize()
						{
							var windowSize = window.getSize();
							var panelSize = windowSize.y - 166;
							$('portfolio').setStyle('height',panelSize);
						}
						
					// ...page load...
					
					setPortfolioSize();
					
					// ...and window resize.
					
					window.addEvent('resize', function(){
					  setPortfolioSize();
					});
			
			
					// Create window scroller object
			
					var windowScroller = new Fx.Scroll(window,{ offset: {
		        'x': 0,
		        'y': -166
					  }
					});
					
					// Add click events to portfolio scroll links
					
					$$('#main_menu ul li a.scroll').each(function(menu_link) {
					
						menu_link.addEvent('click', function(e) {
						
							new Event(e).stop();
						
							var link_dest = menu_link.get('class').replace(/scroll /,'');
							
							// Scroll to selected panel
							
							windowScroller.toElement(link_dest);
							
							//setPointerPosition(menu_link.getPosition().y);
						
						});
					
					});
					
					
					// Get requested panel name from URL and scroll to if specified
					
					var url_load = window.location.href.replace(window.location.hostname,'').replace(/http:\/\/\/\?/,'').replace(/http:\/\/\//,'');
					
					if(url_load.length > 0)
						{
							windowScroller.toElement(url_load);
							setPointerPosition($('lnk_' + url_load).getPosition().y);
						}
						
					
				}
							
			// Multibox initialisation
			
			if($chk($('home_body')))
				{
					
					var initMultiBox = new multiBox({
						mbClass: '.mb',
						container: $(document.body),
						descClassName: 'multiBoxDesc',
						addDownload: false,
						addRollover: false,
						addOverlayIcon: false
					});
					
				}
			
			
		});
		
	

		

