   jQuery.noConflict();
     jQuery(document).ready(function($) {	
	  
		 function zIndexWorkaround()
		 {
		   if(jQuery.browser.msie){
			   if(parseInt(jQuery.browser.version) <= 7){ 
				 jQuery('.parent').addClass("on-top");
				jQuery('#top .parent ul li').css({'margin':'0px','clear':'left'});
			   }
			}
		 }
		zIndexWorkaround();	
	 $('.item1 a:first').addClass('mainNav1');
	 $('.item54 a:first').addClass('mainNav2'),$('.item54 ul').addClass('subNav2') ;
	 $('.item62 a:first').addClass('mainNav3'),$('.item62 ul').addClass('subNav3');
	 $('.item73 a:first').addClass('mainNav4'),$('.item73 ul').addClass('subNav4');	
	 $('.item125 a:first').addClass('mainNav5'),$('.item125 ul').addClass('subNav5');	
	 jQuery('.parent ul').addClass('actions').addClass('submenu');
       function show() {
         var menu = $(this);
		 // menu.children(".actions li").css('position','relative');
		 //menu.children(".actions li").css({'position':'relative','display':'block','width':'200px'});
		  menu.children(".actions").fadeIn();
       }
       function hide() { 
        var menu = $(this);
        //menu.children(".actions").hide();
		menu.children(".actions").css('display','none');
      }
      jQuery("#top .parent").hoverIntent({
        sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
        interval: 0,   // number = milliseconds for onMouseOver polling interval
        over: show,     // function = onMouseOver callback (required)
        timeout: 0,   // number = milliseconds delay before onMouseOut
        out: hide       // function = onMouseOut callback (required)
      });
	  jQuery(".subNav2 li").each(function(){ //about bic
           var menu = jQuery(".mainNav2");
			jQuery(this).hover(function(){
					menu.css({
						background:"url(/templates/standardtemplate/images/nav_hover_colors.png)"
					});
			},
			function(){
				    menu.css({
						background:"url(/templates/standardtemplate/images/nav_header_sprite.png)",
						backgroundPosition:"-254px -382px"
					});
			}); 
	  });
	   jQuery(".mainNav2").hover(function(){
			jQuery(this).css({background:"url(/templates/standardtemplate/images/nav_hover_colors.png)"});					
		},function(){
			jQuery(this).css({
			background:"url(/templates/standardtemplate/images/nav_header_sprite.png)",
			backgroundPosition:"-254px -382px"});
			});
	   
	  jQuery(".subNav3 li").each(function(){//product
           var menu = jQuery(".mainNav3");
			jQuery(this).hover(function(){
					menu.css({
						background:"url(/templates/standardtemplate/images/nav_hover_colors.png)",
						backgroundPosition:"-189px 0px"
					});
			},
			function(){
				    menu.css({
						background:"url(/templates/standardtemplate/images/nav_header_sprite.png)",
						backgroundPosition:"-254px -382px",
						backgroundRepeat:"repeat-y"
					});
			});
	  });
	   jQuery(".mainNav3").hover(function(){
			jQuery(this).css({background:"url(/templates/standardtemplate/images/nav_hover_colors.png)",
						backgroundPosition:"-189px 0px"});					
		},function(){
			jQuery(this).css({
			background:"url(/templates/standardtemplate/images/nav_header_sprite.png)",
						backgroundPosition:"-254px -382px",
						backgroundRepeat:"repeat-y"});
			});
       jQuery(".subNav4 li").each(function(){//press
           var menu = jQuery(".mainNav4");
			jQuery(this).hover(function(){
					menu.css({
						background:"url(/templates/standardtemplate/images/nav_hover_colors.png)",
						backgroundPosition:"-567px 0px"
					});
			},
			function(){
				    menu.css({
						background:"url(/templates/standardtemplate/images/nav_header_sprite.png)",
						backgroundPosition:"-254px -382px",
						backgroundRepeat:"repeat-y"
					});
			});
	  });
	    jQuery(".mainNav4").hover(function(){
			jQuery(this).css({background:"url(/templates/standardtemplate/images/nav_hover_colors.png)",
						backgroundPosition:"-567px 0px"});					
		},function(){
			jQuery(this).css({
			background:"url(/templates/standardtemplate/images/nav_header_sprite.png)",
						backgroundPosition:"-254px -382px",
						backgroundRepeat:"repeat-y"});
			});
	  
	   jQuery(".subNav5 li").each(function(){//press
           var menu = jQuery(".mainNav5");
			jQuery(this).hover(function(){
					menu.css({
						background:"url(/templates/standardtemplate/images/nav_hover_colors.png)",
						backgroundPosition:"-378px 0px"
					});
			},
			function(){
				    menu.css({
						background:"url(/templates/standardtemplate/images/nav_header_sprite.png)",
						backgroundPosition:"-254px -382px",
						backgroundRepeat:"repeat-y"
					});
			});
	  });
	   jQuery(".mainNav5").hover(function(){
			jQuery(this).css({background:"url(/templates/standardtemplate/images/nav_hover_colors.png)",
						backgroundPosition:"-378px 0px"});					
		},function(){
			jQuery(this).css({
			background:"url(/templates/standardtemplate/images/nav_header_sprite.png)",
						backgroundPosition:"-254px -382px",
						backgroundRepeat:"repeat-y"});
			});
	  
	   
	  function footer_show() { 
        var menu = $(this);
        menu.children(".actions").fadeIn();
      }
	   function footer_hide() { 
        var menu = $(this);
        menu.children(".actions").fadeOut();
      }
	  jQuery("#footer .parent").hoverIntent({
        sensitivity: 1, 
        interval: 50,   
        over: footer_show,     
        timeout: 300,   
        out: footer_hide      
      });
	 jQuery('.item54 ul li ul').removeClass('actions submenu subNav2');
	 /*jQuery('#page p:first').css({'margin':'0px'});*/
	 jQuery('.pressPreview img').removeAttr('align');
	 if(jQuery('.item95').hasClass('active') || jQuery('.item96').hasClass('active'))
	 { 
	 }
	 else
	 {
		 jQuery('.item94').addClass('active');
	 }
	 
	 var obj = jQuery('.xmap .contentpaneopen div');
	 obj.each(function(i){
			if (i <obj.size()-1)
			{
				jQuery(this).css('width','16.5%');	
			    jQuery(this).addClass('sixCol_'+i).addClass('sixCol');
			}
	 });
	 
	 	  var language_items = jQuery('#footer .menu_language ul');
	  var othersite_items = jQuery('#footer .menu_other_sites ul');
	  var footer_item_menu = [language_items,othersite_items];
	  setTop();

	  function setTop()
	  {  
	      for(var i = 0; i <footer_item_menu.length; i++)
	  		{
			    var len = footer_item_menu[i].find('li').length; //alert(len);
				if(len) footer_item_menu[i].css('top', -26 * len + 'px'); 
			}
	  }
	  	  	 	      //////////////////////////
	  var footer_width = jQuery('#footer').width();  //alert(footer_width); 
	  var footer_actual_width = 0;
	  jQuery('#footer').children().each(function(i){
				if(jQuery(this).hasClass('bicworld_leftcap') || jQuery(this).hasClass('menu_language')  || jQuery(this).hasClass('menu_other_sites') )
				{
				   footer_actual_width += jQuery(this).width() + 10;
				    //alert(jQuery(this).width() + 10);
				}else {
				   footer_actual_width += jQuery(this).width() ;
				}
	   });
	 // alert(footer_actual_width); 
	  var child_length = jQuery('#footer ul.menu').find('li').length;
	  var remain = footer_width - footer_actual_width  - child_length * 16 -10; // the 22 equels to padding * 2
	  
	  var average_add_width = Math.floor(remain / child_length);
	  

	  jQuery('#footer ul.menu').find('li').each(function(){
			var new_width = jQuery(this).width() + average_add_width;
			jQuery(this).find('a').width(new_width );
	   });
	 ////////////////////////////
	 
	 
    });

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-18917513-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

