$(document).ready(function() {
						   
    var config = {    
     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
     interval: 200, // number = milliseconds for onMouseOver polling interval    
     over:  function () {
        $(this).find('a:first').addClass('tempActive');
        $(this).find('ul').toggle();
      },  // function = onMouseOver callback (REQUIRED)    
     timeout: 500, // number = milliseconds delay before onMouseOut    
     out: function () {
        $(this).find('a:first').removeClass('tempActive');
        $(this).find('ul').toggle();
      }    
	};
	
	$('#primeNav > li').hoverIntent(config);
	
    $('#tracking_link').click(function() {
		$('#whoAreYou .popup').hide();
		$('#search .popup').hide();
		//$(this).find('.popup').toggle();
		$('#trackingLogin').find('.popup').toggle();			
		return false;		
    });
    $('#whoAreYou').click(function() {
		$('#trackingLogin .popup').hide();
		$('#search .popup').hide();
		$(this).find('.popup').toggle();		
        
        $('.test').click(function() {
            window.location=$(this).attr('href');
            $(this).find('.popup').toggle();	
            return false;	
        });        
        
		return false;	
    });
    $('#search_link').click(function() {
        $('#whoAreYou .popup').hide();
		$('#trackingLogin .popup').hide();
		//$(this).find('.popup').toggle();	
		$('#search').find('.popup').toggle();	
		return false;	
    });
    
    var fixFlag = 0;
    var config2 = {    
     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
     interval: 200, // number = milliseconds for onMouseOver polling interval    
     over:  function () {
        if(!fixFlag) {
            $(this).find('a:first').addClass('active');
            $(this).find('.popup').toggle();
        }
        else
            fixFlag = 0;
      },  // function = onMouseOver callback (REQUIRED)    
     timeout: 500, // number = milliseconds delay before onMouseOut    
     out: function (e) {
        if(e.clientX >= 0) {
            $(this).find('a:first').removeClass();
            $(this).find('.popup').toggle();
        }
        else 
            fixFlag = 1;
      }    
    };
   


    //$('#popups li').hoverIntent(config2);
	
	/*$("a.form").fancybox({ 
		'zoomSpeedIn': 300, 
		'zoomSpeedOut': 300, 
		'overlayShow': false
	});*/

});