jQuery.noConflict();

var MK = {
	reqJS: new Array(
	'/shared/js/jquery.scrollTo-min.js',
	'/shared/js/jquery.innerfade.js',
	'/shared/js/jquery.color.js'
	),
	
	loadJS: function(jsURL) {
		document.write('<script type="text/javascript" src="'+jsURL+'"></script>');
	},
	
	addRollovers: function(){
		var aPre = new Array();
		var imgs = jQuery('.imgover');
	
		for (var i = 0; i < imgs.length; i++) {
			var obj = imgs[i];
			var src = obj.getAttribute('src');
			var oversrc = src.replace('_out', '_over');
			
			obj.setAttribute('osrc', src);
			obj.setAttribute('hsrc', oversrc);
			
			aPre[i] = new Image();
			aPre[i].src = oversrc;
			
			obj.onmouseover = function() {
				this.setAttribute('src', this.getAttribute('hsrc'));
			};
			obj.onmouseout = function() {
				this.setAttribute('src', this.getAttribute('osrc'));
			};
		};
	},
	
	
	initScrollAdd : function () {
		jQuery('a[href^="#"]').click(function() {
			var id = this.href.substring(this.href.indexOf('#'),this.href.length);
			if(id == "#") {id = "#header"};
			jQuery.scrollTo(jQuery(id), 1000, {easing:'easeOutExpo'});
		});
	},
	
	
	/*
	init
	*/
	init: function() {
		if (typeof document.documentElement.style.maxHeight == "undefined") MK.reqJS.push('/shared/js/DD_belatedPNG_0.0.8a-min.js');
		
		jQuery.each(this.reqJS, function() {
			MK.loadJS(this);
		});
		
		jQuery.extend(jQuery.easing,{
			easeOutExpo: function (x, t, b, c, d) {
				return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
			}
		});
		
		/*DOM Ready Event*/
		jQuery(document).ready(function(){
			MK.addRollovers();
			MK.initScrollAdd();
			if (typeof document.documentElement.style.maxHeight == "undefined") DD_belatedPNG.fix('.photoColumn, .liquidColumn');
		});
	}

};

MK.init();
