// JavaScript Document for Olay UK product landing page.

$(document).ready(function() {
			
	// Rollovers to black out other boutiques when rolling over one.
	$('.darken').hover(
			
		function(){
			
			$(this).addClass('boutiqueOn');
			
			$('.darken').each(function() {			
																																						
					if (!($(this).hasClass('boutiqueOn'))) {
						
						if ($(this).hasClass('containerPackshot')) {
							
							if (navigator.userAgent.indexOf("MSIE") !=-1) {
								
								$(this).css({background: 'none', filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled="true", src="../images/product-landing-' + $(this).attr('id') + '-blackout.png", sizingMethod="crop")'});
								
							} else {
							
								$(this).css({background: 'url(../images/product-landing-' + $(this).attr('id') + '-blackout.png) top no-repeat'});
							
							}
							
						} else {
						
							$(this).children('p').after('<div class="blackout"></div>');
							
						}
						
					}
					
			});
			$('.blackout').height($('.containerBoutique').height()).css('opacity', '0.75').fadeIn('slow');
			
		},
		
		function(){
			
			$(this).removeClass('boutiqueOn');
			$('.blackout').remove();
			$('.containerPackshot').each(function() {	 
																						
				if (navigator.userAgent.indexOf("MSIE") !=-1) {
					
					$(this).css({background: 'none', filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled="true", src="../images/product-landing-' + $(this).attr('id') + '.png", sizingMethod="crop")'});
					
				} else {
				
					$(this).css({ background: 'url(../images/product-landing-' + $(this).attr('id') + '.png) top no-repeat'})
				
				}
				
			});
			
		}
		 
	);
	
});
