function showPage() {
	$('#preLoader').animate(
	{
		opacity: 0.0
	},
	{
	 duration: 10,
		easing: 'easeOutQuad',
		complete: function() {
			$("#preLoader").remove();
		}
	});
}
$(document).ready(function() {
	$.plugin('cufon', {
		files: ['js/Gotham_Medium_350.font.js',
			'js/Chronicle_Text_325.font.js'],
		selectors: ['*'],
		init: function() {
		},
		callback: function() {

		$.plugin('misc').get();
		}
	});

	$.plugin('misc', {
		files: ['js/jquery.disable.text.select.pack.js',
			'js/jquery.easing.1.3.js'],
		selectors: ['*'],
		init: function() {
		},
		callback: function() {
			$('*').disableTextSelect();
			showPage();
		}
	});
	$.plugin('cufon').get();

	$("area").mouseleave(function() {
		$("#textBox").css('display', 'none');
	});
	var currentBrand;
	var lastLeft = 0;

	$('area').hover(function(e) {
		brand = $(this).attr('alt');
		if (brand != currentBrand) {
			currentBrand = brand;
			$("#" + brand).prependTo("#collections");
			$("#textBox #textTitle").html($("#" + brand + " .info .textTitle").html());
			$("#textBox #textSubTitle").html($("#" + brand + " .info .textSubTitle").text());
			$("#textBox #textCopy").html($("#" + brand + " .info .textCopy").text());
		}
		var posx = 0;
		var posy = 0;
		if (!e) var e = window.event;
		if (e.pageX || e.pageY) {
			posx = e.pageX - (document.body.scrollLeft + document.documentElement.scrollLeft);
			posy = e.pageY - (document.body.scrollLeft + document.documentElement.scrollLeft);
		}
		else if (e.clientX || e.clientY) {
			posx = e.clientX; //+ document.body.scrollLeft + document.documentElement.scrollLeft;
			posy = e.clientY; //+ document.body.scrollTop + document.documentElement.scrollTop;
		}

		newLeft = posx - ((document.body.clientWidth / 2) - 485);

		newLeft += 65;
		if (newLeft > 750) {
			newLeft -= 400;
		}

		$("#textBox").css('left', newLeft);
		Cufon.replace("#textBox #textTitle", { fontFamily: 'Gotham Medium' });
		Cufon.replace("#textBox #textSubTitle", { fontFamily: 'Gotham Medium' });
		Cufon.replace("#textBox #textCopy", { fontFamily: 'Chronicle Text G1' });
		$("#textBox").css('display', 'block');
		$("#textBox").css('opacity', '0.97');


	});

});
