DistributorLocator = {
  "Fields": {
    "zipcode": {
      "click": function (input) {
        if (input.value == "zipcode") {
           input.value = "";
        }
      }
    }
  }
};

ProductSearch= {
  "Fields": {
    "model": {
      "click": function (input) {
        if (input.value == "Product Quick Search") {
           input.value = "";
        }
      }
    }
  }
};

jQuery.fn.supersleight = function(settings) {
	settings = jQuery.extend({
		imgs: true,
		backgrounds: true,
		shim: '/files/images/template/transparent.gif',
		apply_positioning: true
	}, settings);
	
	return this.each(function(){
		if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7 && parseInt(jQuery.browser.version, 10) > 4) {
			jQuery(this).find('*').andSelf().each(function(i,obj) {
				var self = jQuery(obj);
				// background pngs
				if (settings.backgrounds && self.css('background-image').match(/\.png/i) !== null) {
					var bg = self.css('background-image');
					var src = bg.substring(5,bg.length-2);
					var mode = (self.css('background-repeat') == 'no-repeat' ? 'crop' : 'scale');
					var styles = {
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')",
						'background-image': 'url('+settings.shim+')'
					};
					self.css(styles);
				};
				// image elements
				if (settings.imgs && self.is('img[src$=png]')){
					var styles = {
						'width': self.width() + 'px',
						'height': self.height() + 'px',
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + self.attr('src') + "', sizingMethod='scale')"
					};
					self.css(styles).attr('src', settings.shim);
				};
				// apply position to 'active' elements
				if (settings.apply_positioning && self.is('a, input') && (self.css('position') === '' || self.css('position') == 'static')){
					self.css('position', 'relative');
				};
			});
		};
	});
};

$(document).ready(function(){
  
  if(ie6 == true)
  { 
    $('body').supersleight({shim:'/files/unimac/images/x.gif'}); 
  }
  
  $(".model-spec-row").each(function(index) {
    var valChildren = $(this).children('.model-spec-value');
    
    if(valChildren.length == 1){
      valChildren.css('width','240px');
      valChildren.css('text-align','left');
    }
  });
  
  var currentImage = 0;
  var homeImageURLS = {
    "Fire Industry" : "/my-industry/fire.aspx",
    "Comm Industry" : "/my-industry/commercial-laundry.aspx",
    "Lodging Industry" : "/my-industry/lodging.aspx",
    "LTC Industry" : "/my-industry/long-term-care.aspx"
  };
    
  $(document).everyTime(5000, function(i) {    
    var images = $("#rotating-container .image-store img");
    
    if(currentImage + 1 == images.length){
      currentImage = 0;
    } else {
      currentImage++;
    }
    
    var image = $(images[currentImage]).clone();
    
    image.addClass('fade-in').appendTo('#rotating-container a').fadeIn(1200,function(){
      $("#rotating-container .current").remove();
      var newImage = $(this);
      newImage.removeClass('fade-in').addClass('current');
      newImage.parent().attr('href',homeImageURLS[newImage.attr('alt')]);
    });
  });
});