var TheLooks = new Class({
		initialize: function()
		{
			this.lookTypes = new Array();
			this.lookTypes[0] = "bold";
			this.lookTypes[1] = "edgy";
			this.lookTypes[2] = "vibrant";
			this.lookTypes[3] = "multiDimensional";
			
			// Change link image to its on state
			this.currentSelected = $('link_all');
			new ImageSwap($('link_all').getElement('img'), '/en_GB/the_looks/images/all_on.gif');
			
			//Set up the looks nav
			this.setLooksEvents();
			
			//Set up the thumbnail events
			this.createThumbnailListeners();
			
			// Close Button
			$('closeButton').addEvent('click', function() { $('lookOverlay').setStyle('display', 'none'); });
            
            $('bottomLookText').setStyles({
                'display':'block',
                'background':'none'
            });

			for(i=1; i<=6; i++) {
				$('look' + i).getParent().removeClass('multiDimensional');
				$('look' + i).getParent().removeClass('reinvention');
				$('look' + i).getParent().removeClass('texture');
				$('look' + i).getParent().removeClass('volupt');
				$('look' + i).getParent().removeClass('shape');
			}

		},
		
		clearOverState: function(element)
		{
			elment = new Element(element);
			
            if (!window.ie)
				{
					console.log('element.getParent()--->>>'+element.getParent());
                    console.log('currentSelected--->>>'+this.currentSelected);
					console.log('element id--->>>'+element.id);
				}

            if (element.getParent() != this.currentSelected )
			{
                if (element.id != 'reinventionImage' || ($('looksSubLinks').getStyle('display') == 'none') ){
                    var re = new RegExp('.*src=\'(.*)_on.(png|jpg|gif)\'.*');
                    var offImage = (window.ie6 && element.getStyle('filter') != '') ? element.getStyle('filter').replace(re, '$1.$2') : element.getAttribute('src').replace("_on", "");
					new ImageSwap(element, offImage);
                }
			}
		},
		
		setOverState: function(element)
		{
                var textureImageSrc = $('textureImage').getAttribute('src');
                var textureImageName = textureImageSrc.substring(textureImageSrc.lastIndexOf('/'), textureImageSrc.length);
                textureImageName = '/en_GB/the_looks/images' + textureImageName.substring(0 ,textureImageName.length - 4);
                
                textureImageName = textureImageName.replace('_on','');
				if (element == "textureImage") {
                        $('textureImage').setAttribute('src', textureImageName + '_on.gif');
                        if(this.currentSelected.id != 'link_reinvention') {
                            $('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention.gif');
                        }
                        if(this.currentSelected.id != 'link_volupt') {
                            $('voluptImage').setAttribute('src', '/en_GB/the_looks/images/volupt.gif');
                        }
                        if(this.currentSelected.id != 'link_shape') {
                            $('shapeImage').setAttribute('src', '/en_GB/the_looks/images/shape.gif');
                        }
                        if(this.currentSelected.id != 'link_all') {
                            $('allImage').setAttribute('src', '/en_GB/the_looks/images/all.gif');
                        }
                    } else if (element == "reinventionImage") {
                        $('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention_on.gif');
                        if(this.currentSelected.id != 'link_texture') {
                            $('textureImage').setAttribute('src', textureImageName + '.gif');
                        }
                        if(this.currentSelected.id != 'link_volupt') {
                            $('voluptImage').setAttribute('src', '/en_GB/the_looks/images/volupt.gif');
                        }
                        if(this.currentSelected.id != 'link_shape') {
                            $('shapeImage').setAttribute('src', '/en_GB/the_looks/images/shape.gif');
                        }						
                        if(this.currentSelected.id != 'link_all') {
                            $('allImage').setAttribute('src', '/en_GB/the_looks/images/all.gif');
                        }
                    } else if (element == "voluptImage") {
                        $('voluptImage').setAttribute('src', '/en_GB/the_looks/images/volupt_on.gif');
                        if(this.currentSelected.id != 'link_texture') {
                            $('textureImage').setAttribute('src', textureImageName + '.gif');
                        }
                        if(this.currentSelected.id != 'link_reinvention') {
                            $('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention.gif');
                        }
                        if(this.currentSelected.id != 'link_shape') {
                            $('shapeImage').setAttribute('src', '/en_GB/the_looks/images/shape.gif');
                        }						
                        if(this.currentSelected.id != 'link_all') {
                            $('allImage').setAttribute('src', '/en_GB/the_looks/images/all.gif');
                        }
					} else if (element == "shapeImage") {
						$('shapeImage').setAttribute('src', '/en_GB/the_looks/images/shape_on.gif');
                        if(this.currentSelected.id != 'link_texture') {
                            $('textureImage').setAttribute('src', textureImageName + '.gif');
                        }						
                        if(this.currentSelected.id != 'link_reinvention') {
                            $('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention.gif');
                        }
                        if(this.currentSelected.id != 'link_volupt') {
                            $('voluptImage').setAttribute('src', '/en_GB/the_looks/images/volupt.gif');
                        }
				
                        if(this.currentSelected.id != 'link_all') {
                            $('allImage').setAttribute('src', '/en_GB/the_looks/images/all.gif');
                        }						
					} else if (element == "allImage") {
                        $('allImage').setAttribute('src', '/en_GB/the_looks/images/all_on.gif');
                        if(this.currentSelected.id != 'link_texture') {
                            $('textureImage').setAttribute('src', textureImageName + '.gif');
                        }
                        if(this.currentSelected.id != 'link_reinvention') {
                            $('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention.gif');
                        }
                        if(this.currentSelected.id != 'link_volupt') {
                            $('voluptImage').setAttribute('src', '/en_GB/the_looks/images/volupt.gif');
                        }
                        if(this.currentSelected.id != 'link_shape') {
                            $('shapeImage').setAttribute('src', '/en_GB/the_looks/images/shape.gif');
                        }						
					} else{
                        // nothing
                    }
					
			//elment = new Element(element);
			
			/*if (element.getParent() != this.currentSelected)
			{
				var re = new RegExp('.*src=\'(.*).(png|jpg|gif)\'.*');
				var reAlt = new RegExp('(.*).(png|jpg|gif)');
				var onImage;
				if (window.ie6 && element.getStyle('filter') != '')
				{
					onImage = element.getStyle('filter').replace(re, '$1_on.$2');
				}
				else
				{
					onImage = element.getAttribute('src').replace(reAlt, "$1_on.$2");
				}
				
				onImage = onImage.replace("_on_on", "_on");
				
				new ImageSwap(element, onImage);
			}
			*/
		},
			
		setLooksEvents : function()
		{	
            $ES('li','looksLinks').addEvent('mouseenter', function(event) {
				event = new Event(event);
				
				var target = new Element(event.target);
				
				this.setOverState(target.id);
			}.bind(this));
			
			/*$ES('li','looksLinks').addEvent('mouseleave', function(event) {
				event = new Event(event);
				
				var target = new Element(event.target);
				
                this.clearOverState(target.id);
                    
			}.bind(this));
			*/
			$ES('li','looksLinks').addEvent('click', function(event)
			{
				event = new Event(event);
				
				new Element(event.target);
				
				var previousItem = this.currentSelected;
				this.currentSelected = event.target.getParent();
				
				// once something is clicked, display 'all option'
				$('link_all').setStyle('display', 'inline');
				
                
				//if (previousItem)
				//{
                    
					//previousItem.removeClass('selected');
					//if(previousItem.id == 'allImage' || previousItem.id == 'textureImage' || previousItem.id == 'reinventionImage'){
                    //    this.clearOverState(previousItem.getElement('img'));
                    //}
				//}
				event.target.getParent().addClass('selected');
	
				// used at bottom of function to change link image to its on state
				var linkId = event.target.id;
				var linkParent = linkId.substr(0,linkId.length-5);
                
				if(linkParent != 'all') {
					$('bottomLookText').setHTML($(linkParent + 'StyleText').innerHTML);
                    $('bottomLookText').setStyles({
                        'display':'block',
                        'background':'#000'
                    });
                    
				} else {
					$('bottomLookText').setHTML('');                    
                    $('bottomLookText').setStyles({
                        'display':'block',
                        'background':'none'
                    });
				}
	
                if(linkParent == 'reinvention') {
					$('looksSubLinks').setStyle('display', 'block');
				}else{
					$('looksSubLinks').setStyle('display', 'none');
                }
                    
				//Close the overlay if we click a look category
				if($('lookOverlay').getProperty('class') == 'expandedLook') {
					this.closeOverlay();
				}
				
				// Filter Thumbnails
				//for (i=0; i < this.lookTypes.length; i++)
				{
					 // Handle multiple category classes
					 // TODO: Simplify with better $$ references
                     
                var textureImageSrc = $('textureImage').getAttribute('src');
                var textureImageName = textureImageSrc.substring(textureImageSrc.lastIndexOf('/'), textureImageSrc.length);
                textureImageName = textureImageName.replace('_on','');
                textureImageName = '/en_GB/the_looks/images' + textureImageName.substring(0,textureImageName.length - 4);
                     
					 if (linkParent == "all") {
						//turn on
						$ES('a.shape').removeClass('shapeOff');
                        $ES('a.volupt').removeClass('voluptOff');
                        $ES('a.texture').removeClass('textureOff');
                        $ES('a.reinvention').removeClass('reinventionOff');
                        $ES('a.bold').removeClass('boldOff');
                        $ES('a.edgy').removeClass('edgyOff');
                        $ES('a.vibrant').removeClass('vibrantOff');
                        $ES('a.multiDimensional').removeClass('multiDimensionalOff');                        
                        $('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention.gif');
                        $('textureImage').setAttribute('src',  textureImageName + '.gif');
                        $('voluptImage').setAttribute('src', '/en_GB/the_looks/images/volupt.gif');
						$('shapeImage').setAttribute('src', '/en_GB/the_looks/images/shape.gif');
                        $('link_reinvention').removeClass('selected');
                        $('link_texture').removeClass('selected');
                        $('link_volupt').removeClass('selected');
						$('link_shape').removeClass('selected');
                        $('link_all').addClass('selected');
                    } else if (linkParent == "texture") {
                        $ES('a.texture').removeClass('textureOff');
                        $ES('a.volupt').addClass('voluptOff');
                        $ES('a.reinvention').addClass('reinventionOff');
						$ES('a.shape').addClass('shapeOff');
                        $('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention.gif');
                        $('voluptImage').setAttribute('src', '/en_GB/the_looks/images/volupt.gif');
						$('shapeImage').setAttribute('src', '/en_GB/the_looks/images/shape.gif');
                        $('allImage').setAttribute('src', '/en_GB/the_looks/images/all.gif');
                        $('link_reinvention').removeClass('selected');
                        $('link_texture').addClass('selected');
                        $('link_volupt').removeClass('selected');
						$('link_shape').removeClass('selected');
                        $('link_all').removeClass('selected');
                        $ES('a.bold').removeClass('boldOff');
                        $ES('a.edgy').removeClass('edgyOff');
                        $ES('a.vibrant').removeClass('vibrantOff');
                        $ES('a.multiDimensional').removeClass('multiDimensionalOff');
                    } else if (linkParent == "volupt") {
                        $ES('a.texture').addClass('textureOff');
                        $ES('a.volupt').removeClass('voluptOff');
                        $ES('a.reinvention').addClass('reinventionOff');
						$ES('a.shape').addClass('shapeOff');
                        $('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention.gif');
                        $('textureImage').setAttribute('src', textureImageName + '.gif');
                        $('allImage').setAttribute('src', '/en_GB/the_looks/images/all.gif');
                        $('link_reinvention').removeClass('selected');
                        $('link_texture').removeClass('selected');
						$('link_shape').removeClass('selected');
                        $('link_volupt').addClass('selected');
                        $('link_all').removeClass('selected');
                        $ES('a.bold').removeClass('boldOff');
                        $ES('a.edgy').removeClass('edgyOff');
                        $ES('a.vibrant').removeClass('vibrantOff');
                        $ES('a.multiDimensional').removeClass('multiDimensionalOff');
                    } else if (linkParent == "shape"){
						$ES('a.texture').addClass('textureOff');
						$ES('a.shape').removeClass('shapeOff');
						$ES('a.reinvention').addClass('reinventionOff');
						$ES('a.volupt').addClass('voluptOff');						
						$('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention.gif');
                        $('textureImage').setAttribute('src', textureImageName + '.gif');
						$('voluptImage').setAttribute('src', '/en_GB/the_looks/images/volupt.gif');
                        $('allImage').setAttribute('src', '/en_GB/the_looks/images/all.gif');
                        $('link_reinvention').removeClass('selected');
                        $('link_texture').removeClass('selected');
						$('link_volupt').removeClass('selected');
                        $('link_shape').addClass('selected');
                        $('link_all').removeClass('selected');
                        $ES('a.bold').removeClass('boldOff');
                        $ES('a.edgy').removeClass('edgyOff');
                        $ES('a.vibrant').removeClass('vibrantOff');
                        $ES('a.multiDimensional').removeClass('multiDimensionalOff');
					} else if (linkParent == "reinvention") {
                        $ES('a.reinvention').removeClass('reinventionOff');
                        $ES('a.texture').addClass('textureOff');
                        $ES('a.volupt').addClass('voluptOff');
						$ES('a.shape').addClass('shapeOff');
                        $ES('a.bold').removeClass('boldOff');
                        $ES('a.edgy').removeClass('edgyOff');
                        $ES('a.vibrant').removeClass('vibrantOff');
                        $ES('a.multiDimensional').removeClass('multiDimensionalOff');
                        $('textureImage').setAttribute('src',  textureImageName + '.gif');
                        $('voluptImage').setAttribute('src', '/en_GB/the_looks/images/volupt.gif');
						$('shapeImage').setAttribute('src', '/en_GB/the_looks/images/shape.gif');
                        $('allImage').setAttribute('src', '/en_GB/the_looks/images/all.gif');
                        $('link_shape').removeClass('selected');
                        $('link_texture').removeClass('selected');
                        $('link_all').removeClass('selected');
                        $('link_reinvention').addClass('selected');
                        
					} else {
                          //nothing
					}
				}
				
				urchinTracker("the_looks/" + linkParent);
			}.bind(this));

            $ES('span','looksSubLinks').addEvent('click', function(event)
			{
				event = new Event(event);
				
				var el = new Element(event.target);
				
				var previousItem = this.currentSelected;
				this.currentSelected = el.getParent();
                
                var spanID = this.currentSelected.id.split('_');
                var linkParent = spanID[1];
                
				if(linkParent != 'all') {
					$('bottomLookText').setHTML($(linkParent + 'StyleText').innerHTML);
                    $('bottomLookText').setStyles({
                        'display':'block',
                        'background':'#000'
                    });
				}else{
					$('bottomLookText').setHTML('');
                    $('bottomLookText').setStyles({
                        'display':'block',
                        'background':'none'
                    });
                }

                if(linkParent == 'reinvention' || linkParent == 'bold' || linkParent == 'edgy' || linkParent == 'vibrant' || linkParent == 'multiDimensional') {
					$('looksSubLinks').setStyle('display', 'block');
                    $('reinventionImage').setAttribute('src', '/en_GB/the_looks/images/reinvention_on.gif');
                    $('link_reinvention').addClass('selected');
				}else{
					$('looksSubLinks').setStyle('display', 'none');
                }
                    
				//Close the overlay if we click a look category
				if($('lookOverlay').getProperty('class') == 'expandedLook') {
					this.closeOverlay();
				}
                
				// Filter Thumbnails
				for (i=0; i < this.lookTypes.length; i++)
				{
					 // Handle multiple category classes
					 // TODO: Simplify with better $$ references 
				    if (linkParent == "bold") {
                        $('link_bold').addClass('selected');
                        $('link_edgy').removeClass('selected');
                        $('link_vibrant').removeClass('selected');
                        $('link_multiDimensional').setAttribute('class', '');
                        $ES('a.bold').removeClass('boldOff');
                        $ES('a.reinvention').removeClass('reinventionOff');
                        $ES('a.edgy').addClass('edgyOff');
                        $ES('a.vibrant').addClass('vibrantOff');
                        $ES('a.multiDimensional').addClass('multiDimensionalOff');
                    } else if (linkParent == "edgy") {
                        $('link_bold').removeClass('selected');
                        $('link_edgy').addClass('selected');
                        $('link_vibrant').removeClass('selected');
                        $('link_multiDimensional').setAttribute('class', '');
                        $ES('a.bold').addClass('boldOff');
                        $ES('a.reinvention').removeClass('reinventionOff');
                        $ES('a.edgy').removeClass('edgyOff');
                        $ES('a.vibrant').addClass('vibrantOff');
                        $ES('a.multiDimensional').addClass('multiDimensionalOff');
                    } else if (linkParent == "vibrant") {
                        $('link_bold').removeClass('selected');
                        $('link_edgy').removeClass('selected');
                        $('link_vibrant').addClass('selected');
                        $('link_multiDimensional').setAttribute('class', '');
                        $ES('a.bold').addClass('boldOff');
                        $ES('a.reinvention').removeClass('reinventionOff');
                        $ES('a.edgy').addClass('edgyOff');
                        $ES('a.vibrant').removeClass('vibrantOff');
                        $ES('a.multiDimensional').addClass('multiDimensionalOff');
                    } else if (linkParent == "multiDimensional") {
                        $('link_bold').removeClass('selected');
                        $('link_edgy').removeClass('selected');
                        $('link_vibrant').removeClass('selected');
                        $('link_multiDimensional').addClass('selected');
                        $ES('a.bold').addClass('boldOff');
                        $ES('a.reinvention').removeClass('reinventionOff');
                        $ES('a.edgy').addClass('edgyOff');
                        $ES('a.vibrant').addClass('vibrantOff');
                        $ES('a.multiDimensional').removeClass('multiDimensionalOff');
					} else {
                        $('link_bold').removeClass('selected');
                        $('link_edgy').removeClass('selected');
                        $('link_vibrant').removeClass('selected');
                        $('link_multiDimensional').removeClass('selected');
                        $ES('a.bold').removeClass('boldOff');
                        $ES('a.reinvention').removeClass('reinventionOff');
                        $ES('a.edgy').removeClass('edgyOff');
                        $ES('a.vibrant').removeClass('vibrantOff');
                        $ES('a.multiDimensional').removeClass('multiDimensionalOff');
					}
				}
				
				urchinTracker("the_looks/" + linkParent);
			}.bind(this));
		},
		
		createThumbnailListeners: function()
		{
            $ES('a[href=#]', 'looksThumbnails').each(function(item, index) {
                if(index == null){
                    item.addClass('noLink');
					
                }else{

                    item.addEvents({
                        'click': function(event)
                        {
    
                            var idNum = index + 1;
                            
                            var lookTitleHTML = $('lookTitle' + idNum).innerHTML;
                            var lookDescHTML = $('lookDesc' + idNum).innerHTML;
                            var lookImageHTML = $('lookImage' + idNum).innerHTML;
                            var lookVideoHTML = $('lookVideo' + idNum).innerHTML;
                            var lookProductDownload = $('lookDownload' + idNum).innerHTML;
                            
                            var lookProductName1HTML = $('lookProductName1_' + idNum).innerHTML;
                            var lookProductLink1HTML = $('lookProductLink1_' + idNum).innerHTML;
                            var lookProductImage1HTML = $('lookProductImage1_' + idNum).innerHTML;

                            if ( $('lookProductName2_' + idNum) != null && $('lookProductLink2_' + idNum) != null && $('lookProductImage2_' + idNum)) {
                                var lookProductName2HTML = $('lookProductName2_' + idNum).innerHTML;
                                var lookProductLink2HTML = $('lookProductLink2_' + idNum).innerHTML;
                                var lookProductImage2HTML = $('lookProductImage2_' + idNum).innerHTML;
                            }else{
                                var lookProductName2HTML = '';
                                var lookProductLink2HTML = '';
                                var lookProductImage2HTML = '';
                            }
    
                            if ( $('lookProductName3_' + idNum) != null && $('lookProductLink3_' + idNum) != null && $('lookProductImage3_' + idNum)) {
                                var lookProductName3HTML = $('lookProductName3_' + idNum).innerHTML;
                                var lookProductLink3HTML = $('lookProductLink3_' + idNum).innerHTML;
                                var lookProductImage3HTML = $('lookProductImage3_' + idNum).innerHTML;
                            }else{
                                var lookProductName3HTML = '';
                                var lookProductLink3HTML = '';
                                var lookProductImage3HTML = '';
                            }
							
							 if ( $('lookProductName4_' + idNum) != null && $('lookProductLink4_' + idNum) != null && $('lookProductImage4_' + idNum)) {
                                var lookProductName4HTML = $('lookProductName4_' + idNum).innerHTML;
                                var lookProductLink4HTML = $('lookProductLink4_' + idNum).innerHTML;
                                var lookProductImage4HTML = $('lookProductImage4_' + idNum).innerHTML;
                            }else{
                                var lookProductName4HTML = '';
                                var lookProductLink4HTML = '';
                                var lookProductImage4HTML = '';
                            }
    
                            // $('lookVideo').setHTML('<a href="http://www.adobe.com/go/getflashplayer" target="_blank" title="Download Flash Player"><img src="/en_US/the_looks/images/flash_player.jpg" alt="Download Flash Player" /></a>');
                            var target = $('lookVideo');
                            
                            if (!window.ie)
                            {
                                target.replaceWith(new Element('div', {'id': 'lookVideo'}));	
                            }
                            else
                            {
                                target.empty();
                            }
                            
                            if($E('DIV.noFlashWarning') != null){
                                var flashWarning = $E('DIV.noFlashWarning').clone();
                                flashWarning.injectInside(target);
                            }
    
                            $('getTheLookTitle').setHTML(lookTitleHTML);
                            $('getTheLookDetails').setHTML(lookDescHTML);
                    
                            $E('img', 'lookImage').src = $E('img', 'lookImage' + idNum).src;
                            // $E('DIV#lookImage img', 'lookOverlay').alt = $E('img', 'lookImage' + idNum).alt; 
                            
                            $('downloadPhoto').setAttribute('href', lookProductDownload);
    
                            // Product One
                            if (lookProductName1HTML != "null")
                            {
                                $('productOne').setStyle('display', 'block');
                                
                                $E('a.overlayProductLink', 'productOne').setAttribute('href', lookProductLink1HTML);
                                
                                $E('img.productImage', 'productOne').src = $E('img', 'lookProductImage1_' + idNum).src;
                                
								$E('img.productImage', 'productOne').alt = $E('img', 'lookProductImage1_' + idNum).alt;
                                
								$E('span.productName', 'productOne').setHTML(lookProductName1HTML);
                            }
                            else
                            {
                                $('productOne').setStyle('display', 'none');
                            }
                            
                            // Product Two
                            if (lookProductName2HTML != '')
                            {
                                $('productTwo').setStyle('display', 'block');
                                
                                $E('a.overlayProductLink', 'productTwo').setAttribute('href', lookProductLink2HTML);
                                
                                $E('img.productImage', 'productTwo').src = $E('img', 'lookProductImage2_' + idNum).src;
                                 
								$E('img.productImage', 'productTwo').alt = $E('img', 'lookProductImage2_' + idNum).alt;
								
                                $E('span.productName', 'productTwo').setHTML(lookProductName2HTML);
                            }
                            else
                            {
                                $('productTwo').setStyle('display', 'none');
                            }
    
                            // Product Three
                            if (lookProductName3HTML != '')
                            {
                                $('productThree').setStyle('display', 'block');
                                
                                $E('a.overlayProductLink', 'productThree').setAttribute('href', lookProductLink3HTML);
                                
                                $E('img.productImage', 'productThree').src = $E('img', 'lookProductImage3_' + idNum).src;
                                
								$E('img.productImage', 'productThree').alt = $E('img', 'lookProductImage3_' + idNum).alt;
                                
								$E('span.productName', 'productThree').setHTML(lookProductName3HTML);
                            }
                            else
                            {
                                $('productThree').setStyle('display', 'none');
                            }
							
							 if (lookProductName4HTML != '')
                            {
                                $('productFour').setStyle('display', 'block');
                                
                                $E('a.overlayProductLink', 'productFour').setAttribute('href', lookProductLink4HTML);
                                
                                $E('img.productImage', 'productFour').src = $E('img', 'lookProductImage4_' + idNum).src;
                                
								$E('img.productImage', 'productFour').alt = $E('img', 'lookProductImage4_' + idNum).alt;
								
                                $E('span.productName', 'productFour').setHTML(lookProductName4HTML);
                            }
                            else
                            {
                                $('productFour').setStyle('display', 'none');
                            }
    
                            // Use VideoPlayer of Fallback Image?
                            var flvMoviePath = lookVideoHTML;
                            var extensionName = flvMoviePath.substr(flvMoviePath.length - 3);
                            
                            if (extensionName == "flv")
                            {
                                var newLookVideo = new Element('div', {id: 'lookVideo'});
                                var newLookVideoContent = new Element('div', {id: 'lookVideoContent'});
                                newLookVideoContent.injectInside(newLookVideo);
                                
                                $('lookVideo').replaceWith(newLookVideo);
                                
                                swfobject.embedSWF("/master/flash/VideoPlayer_small.swf", "lookVideoContent", "261", "225", "9.0.115", "/global/flash/expressInstall.swf", {flvPath: flvMoviePath}, {allowFullScreen: 'true'});
                            }
                            else if (extensionName == "swf")
                            {
                                var newLookVideo = new Element('div', {id: 'lookVideo'});
                                var newLookVideoContent = new Element('div', {id: 'lookVideoContent'});
                                newLookVideoContent.injectInside(newLookVideo);
                                
                                $('lookVideo').replaceWith(newLookVideo);
                                
                                swfobject.embedSWF(flvMoviePath, "lookVideoContent", "261", "225", "9.0.115", "/global/flash/expressInstall.swf", {allowFullScreen: 'true'});
                            }                        
                            else
                            {
    
                                $E('img', 'lookVideo' + idNum).clone().injectInside(newLookVideo);
    
                                $('lookVideo').replaceWith(newLookVideo);
                            }
                            
                            // Show Overlay
                            $('lookOverlay').setStyle('display', 'block');
                        }
    
                    });
                }
			});
		},
		
		closeOverlay: function()
		{
			$('lookOverlay').setStyle('display', 'none');
		},
		
		addTracking: function()
		{
			var downloadLink = $$('DIV.overlayDesc A.overlaySecHeading');
			downloadLink.addEvent('click', function(event) {
				event = new Event(event);
				
				var targetURL = event.target.getParent().getAttribute('href');
				var downloadTarget = targetURL.substr(targetURL.lastIndexOf("/") + 1);
				
				urchinTracker("the_looks/download/" + downloadTarget);
			});
		}
	});
	TheLooks.implement(new Events);
	
	window.addEvent('domready', function()
	{
		var theLooks = new TheLooks();
	});
	
	
