// Get Date For Form Processor
var getDate=new Date()

var getYear=getDate.getYear()
if (getYear < 1000)
getYear+=1900

var getDay=getDate.getDay()

var getMonth=getDate.getMonth()+1
if (getMonth<10)
getMonth="0"+getMonth

var getCurrentDay=getDate.getDate()
if (getCurrentDay<10)
getCurrentDay="0"+getCurrentDay

theDate = getMonth+"/"+getCurrentDay+"/"+getYear

//Initialize NoConflict
jQuery.noConflict();

//Run when DOM is ready to be manipulated
jQuery(document).ready(
	function(){
		
		//No Tooltips Call
		jQuery('#primaryNav a[title]').noTooltips();
		
		
		//Show/Hide PrimaryNav Sub-menu
		jQuery('#primaryNav li').hover(
			function(){
		    	jQuery(this).children('ul').show();
			},
			function(){
			   	jQuery(this).children('ul').hide();
		});
		
		jQuery("#primaryNav li ul").hover (
			function () { 
				jQuery(this.parentNode).addClass("hover");
			},
			function () {
			jQuery(this.parentNode).removeClass("hover");
		});


		
	
		//RFQ Button background slide
		jQuery('#rfqButton a')
			.css( { backgroundPosition: "0 0" } )
			.mouseover( function() {
				jQuery( this ).stop().animate(
					{ backgroundPosition:"(-362px 0)" }, 
					{duration:200});
			})
			.mouseout(function(){
				jQuery(this).stop().animate(
					{backgroundPosition:"(0 0)"}, 
					{duration:300});
			})
			
		//PrimaryNav background slide
		jQuery('#primaryNav li a')
			.css( { backgroundPosition: "0 0" } )
			.mouseover( function () {
				jQuery( this ).stop().animate(
					{ backgroundPosition: "0 -45" },
					{ duration:300 });
			})
			.mouseout(function(){
				jQuery(this).stop().animate(
					{backgroundPosition:"(0 0)"}, 
					{duration:150});
			})
		//Disable Right-click context menu
		//jQuery(document).bind("contextmenu",function(e){
		//	alert('Manufacturing Solutions, Inc (Copyright 2009)');
		//	return false;
		//});
		
		jQuery('#banner').css('zIndex','1');
		jQuery('#header').css('zIndex','2');
	}
);

// Title: NoTooltips
// Author: Matt Higgins
// Description: Kills Anchor Tag titles on hover
//			    (Fixes drop-down dissappear bug in FF & IE)
// Usage: jQuery('#primaryNav a[title]').noTooltips();

(function($) {
	$.fn.noTooltips = function() {
		return this.each(function() {
			var title = $(this).attr('title');
			$(this).hover(onHover,onHoverOut(title));
		});
		
		function onHover() {
			$(this).attr('title','');
		}
		
		function onHoverOut(title)
		{
			$(this).attr('title', title);
		}
		
	}
})(jQuery);
