﻿// Functions specific to a site.

(function($) {
	$(document).ready(function() {
		// Place document manipulation code here
		$('#nav-products a').tooltip({
			position: 'bottom center',
			offset: [0, 436],
			tip: '#dhtml-product',
			relative: true,
			onShow: function() {
				$('#nav-products a').addClass('hover');
			},
			onHide: function() {
				$('#nav-products a').removeClass('hover');
			}
		});
		$('#nav-about a').tooltip({
			position: 'bottom center',
			offset: [0, 231],
			tip: '#dhtml-about',
			relative: true,
			onShow: function() {
				$('#nav-about a').addClass('hover');
				$('#content').css("display","block");
			},
			onHide: function() {
				$('#nav-about a').removeClass('hover');
				$('#content').css("display","block");
			}			
		});
	//}); 
	//Popup window code
	$('a').each(function() {
		var popupWindowRegex = /\{[\w\d\s:,&;/\."\[\]\-]*\}/g;
		if ($(this).attr('class').match('popUp')) {
			var paramsJson = $(this).attr('class').match(popupWindowRegex); 
			$(this).click(function() {
				popUp(paramsJson);
				return false;
			});
		}
	});	    
	/*$('.main-nav ul.L1').superfish({
		delay: 500,                            // one second delay on mouseout 
		animation: { opacity: 'show' },  // fade-in and slide-down animation 
		speed: 'fast',                          // faster animation speed 
		autoArrows: false,
		dropShadows: false
	});		*/
	});
})(jQuery);
