/*
  Custom ready function
  This should be used to reposition elements or to define and use custom functions
*/
$(document).ready(function(){
 		//reposition header elements
        
        /*
            page element repositioning
        */
        
        /* */
        
        $('.header').append($('#headernav'));
		$('.header').after($('#temp'));
		$('em.error').remove();
		
		$('.helpfullinks ul li:last-child').each(function(){
			$('a',this).addClass('noborder');
			}); 
			
		$('.helpful-articles .helpfullinks:last').addClass('right');

		
		$('em.error').remove();
        
        /* */
        
        /**   site-specific functions       **/
        
        $('img.nav').hover(function(){
			var src = $(this).attr('src');
			var	pos = src.lastIndexOf('.jpg');
			var new_src = src.substring(0,pos);
			 		new_src += '-hover.jpg';
					$(this).attr('src',new_src);
		},function(){
			var src = $(this).attr('src');
			var	pos = src.lastIndexOf('-hover.jpg');
			var new_src = src.substring(0,pos);
			 		new_src += '.jpg';
					$(this).attr('src',new_src);
		});
		
		$('#home_form_a').click(function(){
		  $('#leadform').submit();
		  return false;
		});
     
});//ready
