/* $Id: div.js 89 2010-07-29 15:07:46Z bums $ */
    
jQuery(document).ready(function() {  
 
   img = new Image();  
   $(img).attr("id","headerImage");
   img.id = "headerImage"; 
	
   if (claimImage != '') {
	   claim = new Image();
	   $(claim).attr("id","claimImage"); 
			$(function() {
			    $(claim).load(function() {
			    	$(this).hide();  
			   	}  
			 ).error(function () {
				 $(this).hide();
			}).attr('src', claimImage);
			}); 
   } 

   $(function() {
	   $(img).load(function () {
           // $(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already           
           $(this).hide();  
           var el = $(this); 
           var hm = $("#headerMedia");
           var cm = $("#claimMedia");
           
           $(el).queue("fx", function() {  
        	   $(el).attr("id", "headerImage");
               $(hm).removeClass('loading').append(el);  
               $(el).fadeIn(700).dequeue();               
               if (claimImage != null && claimImage != '') {
            	   $(cm).append(claim);
            	   $(claim).fadeIn(1700).dequeue();
               } 
               startAnimation(); 
              
           });   
       }).error(function () {
           // error function
       }).attr('src', globalImage); 
   }); 	
	 
   jQuery('ul.sf-menu').supersubs({ 
	   minWidth:    '240px',    
       maxWidth:    '600px',  
       extraWidth:  1   
   }).superfish(
    { 
	   dropShadows  :  false, 
       speed        :  'normal', 
       autoArrows	:  false,
	   delay        :  100,
	   animation    :  { opacity : 'show', height : 'show' }
   	}
   );
  
}); 

// preload Images Function
$(function() {
	  var cache = []; 
	  $.preLoadImages = function() {
	    var args_len = arguments.length;
	    for (var i = args_len; i--;) {
	      //var cacheImage = document.createElement('img');
	      var cacheImage = new Image();
	      $(cacheImage).load(
	    	function() {  
	  	        $(this).append($('.imageLoader')); 
	      	}).error(function() { 
	      		  
	      	}).attr("src",arguments[i]);	      
	    }
	  }
});
