// JavaScript Document
function loadImages(rel) {
    MM_preloadImages(rel + 'images/buttons/off.gif', rel + 'images/buttons/on.gif', rel + 'images/buttons/submenutop_on.gif', rel + 'images/buttons/submenutop.gif', rel + 'images/buttons/submenuitem_on.gif', rel + 'images/buttons/submenuitem.gif', rel + 'images/buttons/submenubottom_on.gif', rel + 'images/buttons/submenubottom.gif', rel + 'images/buttons/widesubmenutop_on.gif', rel + 'images/buttons/widesubmenutop.gif', rel + 'images/buttons/widesubmenuitem_on.gif', rel + 'images/buttons/widesubmenuitem.gif', rel + 'images/buttons/widesubmenubottom_on.gif', rel + 'images/buttons/widesubmenubottom.gif', rel + 'images/healthcare_splash_bg.gif', rel + 'images/healthcare_splash_bg_on.gif', rel + 'images/hr_splash_bg.gif', rel + 'images/hr_splash_bg_on.gif', rel + 'images/manag_splash_bg.gif', rel + 'images/manag_splash_bg_on.gif', rel + 'images/buttons/itserv.gif', rel + 'images/buttons/itserv_on.gif', rel + 'images/buttons/progproj.gif', rel + 'images/buttons/progproj_on.gif', rel + 'images/buttons/acqcongrant.gif', rel + 'images/buttons/acqcongrant_on.gif', rel + 'images/buttons/finman.gif', rel + 'images/buttons/finman_on.gif');
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


$(document).ready(function(){
						   
	$('.subnav li.ddmenutopitem').addClass('ddmenutopitemoff'); 
	$('.subnav li.ddmenuitem').addClass('ddmenuitemoff'); 
	$('.subnav li.ddmenubottomitem').addClass('ddmenubottomitemoff'); 
	$('.widesubnav li.wideddmenutopitem').addClass('wideddmenutopitemoff'); 
	$('.widesubnav li.wideddmenuitem').addClass('wideddmenuitemoff'); 
	$('.widesubnav li.wideddmenubottomitem').addClass('wideddmenubottomitemoff'); 
	$('#boxhealthcare').addClass('boxhealthcareoff'); 
	$('#boxhr').addClass('boxhroff'); 
	$('#boxmanagement').addClass('boxmanagementoff'); 
	
	$('.topnav li.topdd').hover(function() { 

		//Following events are applied to the subnav itself (moving subnav up and down)
		$('ul.topsubnav', this).slideDown('fast').show(); //Drop down the subnav on click

		$(this).hover(function() {
		}, function(){
			$('ul.topsubnav', this).slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});
	});
	
	//Button rollovers
	$('.button').hover(
	  function () {
	    $(this).css("background","url('../images/buttons/on.gif') no-repeat");
		
      }, 
      function () {
        $(this).css("background","url('../images/buttons/off.gif') no-repeat");
      }
    );
	
	$('.buttonnav li.buttondd').hover(
	  function () {
		$(this).css("background","url('../images/buttons/on.gif') no-repeat");
		
      }, 
      function () {
        $(this).css("background","url('../images/buttons/off.gif') no-repeat");
      }
    );
    
    $('.buttonnav li.widebuttondd').hover(
	  function () {
		$(this).css("background","url('../images/buttons/on.gif') no-repeat");
		
      }, 
      function () {
        $(this).css("background","url('../images/buttons/off.gif') no-repeat");
      }
    );
    
    //Home page button rollovers
    $('.homebutton').hover(
	  function () {
	    $(this).css("background","url('images/buttons/on.gif') no-repeat");
		
      }, 
      function () {
        $(this).css("background","url('images/buttons/off.gif') no-repeat");
      }
    );
	
	$('.buttonnav li.homebuttondd').hover(
	  function () {
		$(this).css("background","url('images/buttons/on.gif') no-repeat");
		
      }, 
      function () {
        $(this).css("background","url('images/buttons/off.gif') no-repeat");
      }
    );
    
       
    //PCR page button rollovers
    $('.pcrbutton').hover(
	  function () {
	    $(this).css("background","url('http://www.vetms.com/images/buttons/on.gif') no-repeat");
		
      }, 
      function () {
        $(this).css("background","url('http://www.vetms.com/images/buttons/off.gif') no-repeat");
      }
    );
	
	$('.buttonnav li.pcrbuttondd').hover(
	  function () {
		$(this).css("background","url('http://www.vetms.com/images/buttons/on.gif') no-repeat");
		
      }, 
      function () {
        $(this).css("background","url('http://www.vetms.com/images/buttons/off.gif') no-repeat");
      }
    );
    
    $('.buttonnav li.buttondd').hover(function() { 

		//Following events are applied to the subnav itself (moving subnav up and down)
		$('ul.subnav', this).slideDown('fast').show(); //Drop down the subnav on click

		$(this).hover(function() {
		}, function(){
			$('ul.subnav', this).slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});
	});
	
	$('.buttonnav li.homebuttondd').hover(function() { 

		//Following events are applied to the subnav itself (moving subnav up and down)
		$('ul.subnav', this).slideDown('fast').show(); //Drop down the subnav on click

		$(this).hover(function() {
		}, function(){
			$('ul.subnav', this).slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});
	});
	
	$('.buttonnav li.pcrbuttondd').hover(function() { 

		//Following events are applied to the subnav itself (moving subnav up and down)
		$('ul.subnav', this).slideDown('fast').show(); //Drop down the subnav on click

		$(this).hover(function() {
		}, function(){
			$('ul.subnav', this).slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});
	});
	
	$('.buttonnav li.widebuttondd').hover(function() { 

		//Following events are applied to the subnav itself (moving subnav up and down)
		$('ul.widesubnav', this).slideDown('fast').show(); //Drop down the subnav on click

		$(this).hover(function() {
		}, function(){
			$('ul.widesubnav', this).slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});
	});
	
	$('.subnav li.ddmenutopitem').hover(
	  function () {
		$(this).addClass('ddmenutopitemon'); 
		
      }, 
      function () {
        $(this).removeClass('ddmenutopitemon');
      }
    );
	
	$('.subnav li.ddmenuitem').hover(
	  function () {
		$(this).addClass('ddmenuitemon'); 
		
      }, 
      function () {
        $(this).removeClass('ddmenuitemon');
      }
    );
	
	$('.subnav li.ddmenubottomitem').hover(
	  function () {
		$(this).addClass('ddmenubottomitemon'); 
		
      }, 
      function () {
        $(this).removeClass('ddmenubottomitemon');
      }
    );
    
    //Wide submenu items
    
    $('.buttonnav li.widebuttondd').hover(function() { 

		//Following events are applied to the subnav itself (moving subnav up and down)
		$('ul.widesubnav', this).slideDown('fast').show(); //Drop down the subnav on click

		$(this).hover(function() {
		}, function(){
			$('ul.widesubnav', this).slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});
	});
	
	$('.widesubnav li.wideddmenutopitem').hover(
	  function () {
		$(this).addClass('wideddmenutopitemon'); 
		
      }, 
      function () {
        $(this).removeClass('wideddmenutopitemon');
      }
    );
	
	$('.widesubnav li.wideddmenuitem').hover(
	  function () {
		$(this).addClass('wideddmenuitemon'); 
		
      }, 
      function () {
        $(this).removeClass('wideddmenuitemon');
      }
    );
	
	$('.widesubnav li.wideddmenubottomitem').hover(
	  function () {
		$(this).addClass('wideddmenubottomitemon'); 
		
      }, 
      function () {
        $(this).removeClass('wideddmenubottomitemon');
      }
    );
	
	//splash box rollovers
	$('#boxhealthcare').hover(
      function () {
		$(this).addClass('boxhealthcareon'); 
		
      }, 
      function () {
        $(this).removeClass('boxhealthcareon');
      }
    );
	
	$('#boxhr').hover(
      function () {
		$(this).addClass('boxhron'); 
		
      }, 
      function () {
        $(this).removeClass('boxhron');
      }
    );
	
	$('#boxmanagement').hover(
      function () {
		$(this).addClass('boxmanagementon'); 
		
      }, 
      function () {
        $(this).removeClass('boxmanagementon');
      }
    );
    
    $('#finman').hover(
	  function () {
		$(this).addClass('hover'); 
		
      }, 
      function () {
        $(this).removeClass('hover'); 
      }
    );
    
    $('#progproj').hover(
	  function () {
		$(this).addClass('hover'); 
		
      }, 
      function () {
        $(this).removeClass('hover'); 
      }
    );
    
    $('#acqcongrant').hover(
	  function () {
		$(this).addClass('hover'); 
		
      }, 
      function () {
        $(this).removeClass('hover'); 
      }
    );

      $('#itserv').hover(
	  function() {
	      $(this).addClass('hover');

	  },
      function() {
          $(this).removeClass('hover');
      }
    );

});
