
		var brandedImageLoadCheck = new Object();

		// This function is executed whenever the logo image is not found.
        // Attempt to change the last character of the logo image name 
        // to see if the modified image name can be located on the server   
        function fixLogoImage(a, orig) 
        {
           var theImage = eval("document."+a); 
    	   var logoStartIndex = theImage.src.lastIndexOf('/') + 5;      	   
    	   var logoNumber = theImage.src.substring(logoStartIndex,theImage.src.length - 5);
    	   var logoFirstTwo  = logoNumber.substring(0,2);
    	   var logoLastTwo =  logoNumber.substring(logoNumber.length-2);
    	   var alternate_logo_img=""; 
              
           if(brandedImageLoadCheck[theImage.name] == null){
        	   brandedImageLoadCheck[theImage.name] = false;
        	   // always try K as the first logo category #
			   alternate_logo_img = theImage.src.substring(0,theImage.src.length-5) +  'K.jpg'; 				
			   theImage.src=alternate_logo_img;
			   return;
           }
           
           var allCategories = "BCEGHLNSW";
           var current_logo_img = theImage.src; 
           var logoURLlength = current_logo_img.length; 
           var logoCatType = current_logo_img.substring(logoURLlength-5,logoURLlength-4);
           var currentindex = allCategories.indexOf(logoCatType);
           
           if(currentindex != -1){
        	    var nextLogoCatType = allCategories.substring(currentindex + 1, currentindex + 2);
				alternate_logo_img = current_logo_img.substring(0,logoURLlength-5) + nextLogoCatType + '.jpg'; 				
				theImage.src=alternate_logo_img;        	   
           }else{
				if(brandedImageLoadCheck[theImage.name] == false){
					brandedImageLoadCheck[theImage.name] = true;
					alternate_logo_img = '/DSB/web/'+ logoFirstTwo + '/' + logoLastTwo + '/' + logoNumber + '.jpg'
				}else{
					alternate_logo_img = '/lebowebcontent/images/global/navigation/missing_image_250.jpg'; 
				}	 
				theImage.src=alternate_logo_img;       	      
           }
		}        