// Include Javascript documents
document.write('<script language="javascript" type="text/javascript" src="' + root + 'js/mt-1.2.4.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="' + root + 'js/mt-more-1.2.4.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="' + root + 'js/browserCheck.js"></script>');
document.write('<script languate="javascript" type="text/javascript" src="' + root + 'js/QFontSizer.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="' + root + 'js/QServices.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="' + root + 'js/QSmallServices.js"></script>');

document.write('<link rel="stylesheet" href="' + root + 'css/css3.css" type="text/css" />');
document.write('<link rel="shortcut icon" href="' + root + 'favicon.ico" type="image/x-icon">');

// Functions
function makeFixed(el, top) {
	if(document.getScroll().y >= top) {
		el.addClass('fixed');
	} else {
		if(el.hasClass('fixed')) el.removeClass('fixed');
	}
}

var onDomReady = new Array();
function init() {
	onDomReady.each(function(fn) {
		fn.run();				 
	});
}

onDomReady.push(function() {
	document.QFontSizer = new QFontSizer('incFont', 'resFont', 'decFont');

/*
	Smooth Scroller = disabled 
	document.SmoothScroller = new Fx.SmoothScroll();
	document.SmoothScroller.addEvent('scrolledTo', function(a,b) {
		// Make sure the element is not hidden under the navigation
		// (height of nav = 50)
		// And only adjust if the anchor is in the content
		if( b.getPosition().y - document.body.getScroll().y < 50 && document.id('left').hasChild(b) )	{
			scroller = new Fx.Scroll(document.body, { duration: 600 } );
			scroller.start(0, document.getScroll().y - 50);
		}
	});
*/

	// Services menu
	if($('services-menu') != null) {
		document.QServices = new QServices($$('#services-menu li'));
	}
	
	// Small services menu
	if($('small-services-menu') != null) {
		document.QSmallServices = new QSmallServices($$('#small-services-menu li'));
	}
	
	if($$('fade')) {
		
		$$('img.fade').each(function(el) {
			el.addEvents({
				'mouseover': function() { this.fade(1); },
				'mouseout': function() { this.fade(0.7); }
			}).set('tween', {duration: 300}).fade(0.7);
		});
	}
	
	// Arrows fade in/out
	$$('.arrow').each(function(ar){
		ar.set('opacity', .3).set('tween', {duration: 200}).set('morph', {duration: 200});;
				
		ar.getParent().addEvent('mouseover', function() {
			ar.fade(.8);
			ar.morph('.arrowhover')
		});
		ar.getParent().addEvent('mouseout', function() {
			ar.fade(0.3);
			ar.morph('.arrownormal');
		})
	});

});

