

$(document).ready(function(){
	
	$('#container').fadeTo(0, 0).show().fadeTo(4000, 1, function() {
		$('#spec').delay(500).show(500, function() {
			$('#cust').delay(500).slideDown(800, function() {
				$('#container')
					.fadeTo(300, 0.4)
					.delay(10)
					.fadeTo(300, 1)
					.delay(10)
					.fadeTo(300, 0.4)
					.delay(10)
					.fadeTo(300, 1)
					.delay(10)
					.fadeTo(300, 0.4)
					.delay(10)
					.fadeTo(300, 1) ;
			}) ;
		}) ;
	}) ;
	
	$('a').each(function() {
		if ('' != $(this).attr('title')) {
			$(this).addClass('toolTip') ;
		}
	}) ;
	
	toolTip() ;
	
}) ;

/* *******************************************************************************************
 *         ToolTip                                                                           *
 ******************************************************************************************* */
/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * modified by Tommy Ullberg, imCode Partner AB (http://www.imcms.net/)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
var iconFileTypes = [ "PDF", "DOC", "XLS", "PPT", "ZIP", "IMAGE", "SWF", "VIDEO", "AUDIO",
                      "TXT", "RTF", "HTM", "OO-WRITE", "OO-CALC", "OO-DRAW", "OO-IMPRESS",
                      "ODS", "OTS", "SXC", "STC", "ODT", "OTT", "SXW", "STW", "ODP", "OTP", "SXI", "STI", "ODG", "OTG", "SXD", "STD" ] ;
 
this.toolTip = function(){
	xOffset = 10;
	yOffset = 20;
	$(".toolTip").hover(function(e){
		this.t = this.title;
		this.title = "";
		var fileData = $(this).attr("rel") ;
		this.iconClass = "" ;
		var fileExt ;
		var reFile = new RegExp("^FIL:(" + iconFileTypes.join("|") + ")", "gi") ;
		if (null != fileData && reFile.test(fileData)) {
			fileExt = fileData.replace(reFile, "$1") ;
			this.iconClass = "toolTipIcon_" + fileExt.toUpperCase() ;
		} else if (null != fileData && fileData.length >= 7 && fileData.indexOf("FIL") != -1) {
			fileExt = fileData.substring(4,7) ;
			if (/^(PDF|DOC|ZIP|JPG|PNG|GIF|MP3|AVI|MPG)$/i.test(fileExt)) {
				this.iconClass = "toolTipIcon_" + fileExt.toUpperCase() ;
			}
		} else if (null != fileData && fileData.indexOf("URL") != -1) {
			this.iconClass = "toolTipIcon_EXT_LINK" ;
		}
		$("body").append('<div id="toolTipPop">'+ this.t.replace(/&lt;/g, "<").replace(/&gt;/g, ">") + '</div>');
		$("#toolTipPop")
			.css("top",(e.pageY + yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px")
			.fadeIn(document.all ? "fast" : "slow");
	},
	function(){
		this.title = this.t;
		$("#toolTipPop").remove();
	});
	$(".toolTip").mousemove(function(e){
		$("#toolTipPop")
			.css("top",(e.pageY + yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px") ;
		if ("" != this.iconClass) {
			$("#toolTipPop").addClass(this.iconClass) ;
		}
	});
};


