$(document).ready(function(){
   //stop big menu dropdowm from loading on non-modern browsers
   if ($('body').is('.browser_ie, .browser_ie_modern')) {
    
 } else {
    $('#myMenu ul li.capabilities').mouseover(function() {
     $('#menuBg').show(); // alert("showing");
   });
   $('#myMenu ul li.capabilities').mouseout(function() {
     $('#menuBg').hide();
   });
   
   $('#myMenu ul li.the-company').mouseover(function() {
     $('#shortMenuBg').show(); // alert("showing");
   });
   $('#myMenu ul li.the-company').mouseout(function() {
     $('#shortMenuBg').hide();
   });
   
   
 }
 
 
 

 // Remove top level href links
 $('#superfish li.item1 a:not(li.lvl2 a),#superfish li.item2 a:not(li.lvl2 a)').removeAttr("href");
 
   // Homepage banner rotation
   if ($(".home #hdrImg #container").length > 0)
   {
      $.fn.cycle.defaults.speed   = 750;
      $.fn.cycle.defaults.timeout = 7500;

      $('#container .items').cycle({
          fx: 'fade'
         //,timeout: 7500
         //,delay:  1000
         ,pager: "#container .navi"
         ,sync: 1
         //,pause: 1
         //,pauseOnPagerHover: 1
         ,cleartype: true
         ,cleartypeNoBg: true     
      });
      //append a pause/resume function to the navigation
      $("#container .navi").append("<a id='cycle_prev' class='cycle_nav' href='javascript:paginate_cycle({move: \"prev\"});'>Prev</a>");
      $("#container .navi").append("<a id='cycle_next' class='cycle_nav' href='javascript:paginate_cycle({move: \"next\"});'>Next</a>");

      //append a pause/resume function to the navigation
      $("#container .navi").append("<a id='cycle_toggle' class='pause' href='javascript:void(0);'>Pause</a>");
      $("#cycle_toggle").bind("click",function(){
         var button_txt = $(this).text();
         switch(button_txt.toLowerCase())
         {
            case "pause":
               $(this).text("Resume");
               $(this).addClass("resume").removeClass("pause");
               $('#container .items').cycle('pause');
            break;
            case "resume":
               $(this).text("Pause");
               $(this).addClass("pause").removeClass("resume");
               $('#container .items').cycle('resume');
            break;
         }
      });
   }//end if
});
//----------------------
function paginate_cycle(params){
   switch(params.move){
      case "prev":
         $('#container .items').cycle('prev');
      break;
      case "next":
         $('#container .items').cycle('next');
      break;
   }
}

$(document).ready(function(){
  //add specific class to certain images
  $('#hdrImg img').addClass('shadow');
  $('.homeImage img').addClass('shadow');

  // give a shadow to images in IE 7 & 8
  if ($.browser.msie) {
    $('.shadow').boxShadow( 0,  0, 8, "#333");			
  } 
});


//horizontal dropdown
$(document).ready(function(){
  // remove sf-menu from the nav instead of over riding 
  $('#superfish').removeClass('sf-menu');
});

sfHover = function() {
   var sfEls = document.getElementById("superfish").getElementsByTagName("li");
   for (var i=0; i<sfEls.length; i++) {
      sfEls[i].onmouseover=function() {
         this.className+=" hover";
      }
      sfEls[i].onmouseout=function() {
         this.className=this.className.replace(new RegExp(" hover\\b"), "");
      }
   }
}
if (window.attachEvent) window.attachEvent("onload", sfHover)


