function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=700,height=700,screenX=150,screenY=150,top=150,left=150')
}

 jQuery(function($){ 	   
 	   
 	   $('#animBoxSearch').az_animation_box({box_width:196, search:true, session_id:session_id, az_selfclose:false, az_fetch_file:search_link });  	   
 	   $('#animBoxLogin').az_animation_box({box_width:177, session_id:session_id, az_fetch_file:login_link });
 	   
 	   jQuery('#products_sub a, #services_sub a').click(function() {
			window.location=jQuery(this).attr('href');
		});
		
		jQuery('div.sub_nav').hover(
    	function() {
				jQuery(this).children('div.drop_nav').fadeIn('slow');
      	},
		function() {
				jQuery(this).children('div.drop_nav').fadeOut('slow');
			}
		);
		
		if ( typeof(last_top_nav) != 'undefined' )
		if ( !jQuery('#'+last_top_nav).hasClass('virtual'))
		{
			jQuery('#'+last_top_nav+'_menu').slideDown('fast');
			jQuery('#'+last_top_nav).addClass('over');
		}

        var timeout = null;
        var pause = 400;

        function onOut(){
            jQuery('#main_menu div.main_nav ').removeClass('over');
            jQuery('#sub_menu > div ').hide();
            if ( jQuery('#main_menu div.main_nav_sub').length ){
                jQuery('#main_menu div.main_nav_sub a').hide();
                jQuery('#main_menu div.main_nav_sub a.sub').show();
                jQuery('#'+last_top_nav+'_sub_menu').show();
                jQuery('#'+last_top_nav+'_sub').addClass('over');
            } else {
                jQuery('#'+last_top_nav+'_menu').show();
                jQuery('#'+last_top_nav).addClass('over');
            }
        }

		jQuery('#main_menu > div ').hover(
			function() {
                clearTimeout(timeout);
                jQuery('#main_menu div.main_nav ').removeClass('over');
                jQuery(this).addClass('over');
                jQuery('#sub_menu > div ').hide();

                if (jQuery(this).hasClass('main_nav_sub')) {
                    jQuery('a', this).show();
                    jQuery('a.sub', this).hide();
                    jQuery('#' + last_top_nav + '_menu').show();                    
                } else {
                    if (jQuery('#main_menu div.main_nav_sub').length) {
                        jQuery('#main_menu div.main_nav_sub a').hide();
                        jQuery('#main_menu div.main_nav_sub a.sub').show();
                    }
                    jQuery('#' + jQuery(this).attr('id') + '_menu').show();
                }

            },
			function() {
                // show original tab in 1 sec
                timeout = setTimeout(function(){
					onOut();
				},pause);
			}
		);

        jQuery('#sub_menu > div ').hover(
		    function() {
                clearTimeout(timeout)
			},
			function() {
                // show original tab in 1 sec
                timeout = setTimeout(function(){
					onOut();
				},pause);
			}
		);
 });
