var panelinit = null;jQuery(function() {			var $body = jQuery('body');			var fixfooter = function() {		jQuery('#footer-nav').css('zoom',0.99).css('zoom',1);	}		if (jQuery.browser.msie) {		setInterval(fixfooter,4000);		setTimeout(fixfooter,1000);	}				if ($body.hasClass('home')) {		jQuery(window).load(function() { 			for(var x=2;x<=5;x++) jQuery('<img />').attr('src','/images/home-banners/bnr-home-'+x+'.jpg').addClass('fade').hide().appendTo('#banner');			jQuery('#banner').fadeimg({interval : 4, fade : 1});		});	}		if (typeof(DD_belatedPNG) == 'object') {		DD_belatedPNG.fix('img, #main-line, #right-line, #footer-line,#submenu-services, #submenu-carrieres, #header-wrapper, #tabs-opened, #shadow-wrapper, #gallery-infos, #gallery-details, #nav, #gal-details-close');	}		// External links..	jQuery('.external').attr('target','_blank');		// Full popup	jQuery('.fullpop').click(function() {		window.open('about:blank', 'fullpop',  'top=0,left=0,width='+screen.availWidth+',height='+screen.availHeight+',buttons=no,scrollbars=0,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no').focus();		jQuery(this).attr('target','fullpop');	});		// Dealer pop / Contact pop / Legal stuff pop / contest form pop...	jQuery('.contactus,.legal').attr('title','');	jQuery('.dealerpop,.contactus,.legal,.contest-form').attr('rel','iframe').prettyPhoto({allowresize:false,padding:10,modal:true});		jQuery('.object-gallery').attr('rel','prettyPhoto[gallery]');		jQuery("a[rel^='prettyPhoto']").prettyPhoto();		jQuery('#lnk-french').click(function() {		alert('La version française du site sera disponible bientôt!');		return false;	});			// ANIMATION MENU #nav	jQuery('#nav ul ul').hide();	jQuery('#nav > ul > li').hover(function() {		jQuery(this).find('ul').stop(false,true).fadeIn(200);	},	function() {		jQuery(this).find('ul').stop(false,true).fadeOut(200);	});		jQuery('#nav > ul > li > a').each(function() {		if (jQuery(this).find('img:first').attr('src').toString().indexOf('-active')==-1) {			jQuery(this).switchimg({onhover:false});			jQuery(this).parent().hover(function() {				jQuery(this).find('img:eq(1)').hide();				jQuery(this).find('img:eq(0)').show();			},function() {				jQuery(this).find('img:eq(0)').hide();							jQuery(this).find('img:eq(1)').show();			});		}	});		// PAGE profile/colorshop-quality	if (jQuery('#flashbox').length>0) {		jQuery('#btn-table').click(function() {			var so = new SWFObject("../swf/table.swf", "flashbox", 510,348, "8", "#FFFFFF");			so.write("flashbox");				return false;		});		jQuery('#btn-stool').click(function() {			var so = new SWFObject("../swf/stool.swf", "flashbox", 510,348, "8", "#FFFFFF");			so.write("flashbox");				return false;		});		jQuery('#btn-chair').click(function() {			var so = new SWFObject("../swf/chair.swf", "flashbox", 510,348, "8", "#FFFFFF");			so.write("flashbox");				return false;		});		jQuery('#btn-buffet').click(function() {			var so = new SWFObject("../swf/buffet.swf", "flashbox", 510,348, "8", "#FFFFFF");			so.write("flashbox");				return false;		});		jQuery('#btn-table').click();	}		// CATALOGS SHOWN ON THE RIGHT		jQuery('#catalogs-tab .next').click(function() {		jQuery(this).parent().find('ul:visible').addClass('hidden').next().removeClass('hidden');		jQuery(this).addClass('hidden').prev().removeClass('hidden');		jQuery(this).find('.rollover').css('display','none');		return false;	});	jQuery('#catalogs-tab .previous').click(function() {		jQuery(this).parent().find('ul:visible').addClass('hidden').prev().removeClass('hidden');		jQuery(this).find('.rollover').css('display','none');		jQuery(this).addClass('hidden').next().removeClass('hidden');		return false;	});		// GALLERY NAV SCRIPT	if ($body.hasClass('gallery')) {		// First hide the prev btn because we are at the first ul...		// Hide with visibility, hide would break layout...		jQuery('#gal-nav-prev').css('visibility','hidden');				// Hide next if we have only one ul.lst-thumbs...		if (jQuery('ul.lst-thumbs').length==1) jQuery('#gal-nav-next').css('visibility','hidden');		// Next / previous click handler..		jQuery('#gal-nav-next').click(function() {			// Show next UL			jQuery('ul.lst-thumbs:visible').addClass('hidden').next().removeClass('hidden');						// if its the last one, hide the next btn...			if (!jQuery('ul.lst-thumbs:visible').next().hasClass('lst-thumbs')) jQuery(this).css('visibility','hidden');			else this.blur();						// ensure the prev btn is visible..			jQuery('#gal-nav-prev').css('visibility','visible');						// prevent defaults...			return false;		});		jQuery('#gal-nav-prev').click(function() {			// Show previous UL			jQuery('ul.lst-thumbs:visible').addClass('hidden').prev().removeClass('hidden');						// if its the first one, hide the prev btn...			if (!jQuery('ul.lst-thumbs:visible').prev().hasClass('lst-thumbs')) jQuery(this).css('visibility','hidden');			else this.blur();						// ensure the next btn is visible..			jQuery('#gal-nav-next').css('visibility','visible');						// prevent defaults...			return false;		});						// Flash writer for zoom gallery		var writegalimage = function(num) {			jQuery('#gallery-details').hide();			var uleq = Math.ceil(num/8)-1;			var lieq = num - (uleq*8)-1;			var imgpath = jQuery('ul.lst-thumbs:eq('+uleq+') li:eq('+lieq+') a img').attr('src').toString().replace('/90_','/720_');			var so = new SWFObject("http://"+window.location.hostname+"/swf/zoom.swf", "gallery-flash", 720,542, "9", "#FFFFFF");				so.addVariable("image",imgpath);			so.addParam("menu","false");	  		so.addParam("wmode","opaque");			so.write("gallery-flash");		}				// variables for navigation...		var totalimages,currentimage,imagepath;				// Clicks on thumbnails to show large images...		jQuery('.lst-thumbs a').click(function() {			var tmparr = jQuery(this).attr('rel').toString().split('|');			imagepath = tmparr[0];			currentimage = parseInt(tmparr[1],10);			totalimages = parseInt(tmparr[2],10);			writegalimage(currentimage);			// prevent defaults			return false;		});				// Click first thumb		jQuery('.lst-thumbs:first a:first').click();				// Next / previous image nav..		jQuery('#gal-prev-pic').click(function() {			if (currentimage==1) return false;			currentimage--;			writegalimage(currentimage);						// Change page if needed			if (currentimage % 8 == 0) jQuery('#gal-nav-prev').click();						// prevent defaults			return false;		});		jQuery('#gal-next-pic').click(function() {			if (currentimage==totalimages) return false;			currentimage++;			writegalimage(currentimage);			// Change page if needed			if ((currentimage-1) % 8 == 0) jQuery('#gal-nav-next').click();			// prevent defaults			return false;		});				// Gallery fullscreen		jQuery('#gal-fs').click(function() {			jQuery(this).attr('href','/gallery-fullscreen/'+imagepath+'/'+currentimage);		});				// Gallery details 		jQuery('#gal-details-show').click(function() {			if (jQuery('#gallery-details').is(':visible')) jQuery('#gallery-details').hide();			else {				jQuery('#gallery-details').html('<a id="gal-details-close" href="#" title="Close"></a>').load('/gallerydetails/'+imagepath+'/'+currentimage,function() {					jQuery(this).prepend('<a id="gal-details-close" href="#" title="Close"></a>');				}).show();			}			// prevent defaults			return false;		});				jQuery('#gal-details-close').live('click',function() {			jQuery('#gallery-details').hide();			// prevent defaults			return false;				});				jQuery('#gal-print').click(function() {			jQuery('#gal-print-info').remove();			var num = currentimage;			var uleq = Math.ceil(num/8)-1;			var lieq = num - (uleq*8)-1;			var imgpath = jQuery('ul.lst-thumbs:eq('+uleq+') li:eq('+lieq+') a img').attr('src').toString().replace('/90_','/720_');			jQuery('body').append('<div id="gal-print-info"><div id="imageview"><img src="'+imgpath+'" /></div><div id="gal-print-data"></div></div>');			jQuery('#gal-print-data').load('/gallerydetails/'+imagepath+'/'+currentimage,function() {				window.print();			});			// prevent defaults			return false;		});				jQuery('#gal-facebook').click(function() {			var num = currentimage;			var uleq = Math.ceil(num/8)-1;			var lieq = num - (uleq*8)-1;			var imgpath = jQuery('ul.lst-thumbs:eq('+uleq+') li:eq('+lieq+') a img').attr('src').toString().replace('/90_','/720_');						if (imgpath.indexOf('http://')==-1) imgpath = 'http://'+window.location.hostname+imgpath;			jQuery(this).attr('href','http://www.facebook.com/share.php?u='+escape(imgpath)+'&t='+escape('Color Shop Photo Gallery'));		});				// Play / stop gallery		var galinterval;		var switchgalimg = function() {			if (currentimage == totalimages) {				jQuery('#gal-playstop').click();				return;			}			else jQuery('#gal-next-pic').click();			if (currentimage == totalimages) jQuery('#gal-playstop').click();		}				jQuery('#gal-playstop').click(function() {			var $img = jQuery(this).find('img');			if ($img.attr('src').toString().indexOf('play')>0) {				$img.attr('src','/images/btn-stop.png');				galinterval = setInterval(switchgalimg,12000);				switchgalimg();			} else {				$img.attr('src','/images/btn-play.png');				clearInterval(galinterval);			}			return false;		});	}	// CUSTOM OPTIONS PAGING...		if ($body.hasClass('listing') && $body.hasClass('custom')) {		jQuery('.page-selector a').click(function() {			// if its the current page, do nothing...			if (jQuery(this).parent().hasClass('active')) return false;						// if its the "show all" item, show all items...			if (jQuery(this).parent().hasClass('all')) {				jQuery('#anchor').attr('name','all');				var stritems = '';				jQuery('.lst-custom-thumbs').each(function() {					stritems += jQuery(this).html();				});				jQuery('#lst-items').html('<ul class="lst-custom-thumbs">'+stritems+'</ul>');				jQuery('.page-selector').hide();				if (jQuery.browser.msie) fixfooter();				return true;			}						// for every other pages...			jQuery('#anchor').attr('name',jQuery(this).html());			jQuery('.page-selector .active').removeClass('active');			jQuery('.lst-custom-thumbs:not(.hidden)').addClass('hidden').parent().find('.lst-custom-thumbs:eq('+(parseInt(jQuery(this).html(),10)-1)+')').removeClass('hidden');						jQuery('.page-selector:first li:eq('+(parseInt(jQuery(this).html(),10)-1)+')').addClass('active');			jQuery('.page-selector:last li:eq('+(parseInt(jQuery(this).html(),10)-1)+')').addClass('active');			if (jQuery.browser.msie) fixfooter();			return true;		});		if (location.hash) {			pg = location.hash.substring(1);			if (pg=='all') jQuery('.page-selector:first li.all a').click();			if (!isNaN(parseInt(pg,10))) jQuery('.page-selector:first li:eq('+(parseInt(pg,10)-1)+') a').click();		}	}		// MERCHANDISE LISTING PAGING...		if ($body.hasClass('listing') && $body.hasClass('merchandise')) {				window.prelimgs = new Image();		window.prelimgs.src = '/images/merch/item-small-bg_hover.gif';		jQuery('.page-selector a').click(function() {			// if its the current page, do nothing...			if (jQuery(this).parent().hasClass('active')) return false;						// if its the "show all" item, show all items...			if (jQuery(this).parent().hasClass('all')) {				jQuery('#anchor').attr('name','all');				var stritems = '';				jQuery('.lst-merch-items').each(function() {					stritems += jQuery(this).html();				});				jQuery('#lst-items').html('<ul class="lst-merch-items">'+stritems+'</ul>');				jQuery('.page-selector').hide();				if (jQuery.browser.msie) fixfooter();				return true;							}						// for every other pages...			jQuery('#anchor').attr('name',jQuery(this).html());			jQuery('.page-selector .active').removeClass('active');			jQuery('.lst-merch-items:visible').addClass('hidden');			jQuery('.lst-merch-items:eq('+(parseInt(jQuery(this).html(),10)-1)+')').removeClass('hidden');			jQuery('.page-selector:first li:eq('+(parseInt(jQuery(this).html(),10)-1)+')').addClass('active');			jQuery('.page-selector:last li:eq('+(parseInt(jQuery(this).html(),10)-1)+')').addClass('active');			if (jQuery.browser.msie) fixfooter();			return true;		});				// CHECK BROWSER HASH TO LOAD THE PAGE (if hash exists...)		if (location.hash) {			pg = location.hash.substring(1);			if (pg=='all') jQuery('.page-selector:first li.all a').click();			if (!isNaN(parseInt(pg,10))) jQuery('.page-selector:first li:eq('+(parseInt(pg,10)-1)+') a').click();		}	}		// CUSTOM OPTIONS / DETAILS	if ($body.hasClass('custom') && $body.hasClass('details')) {		// Hide previous page, we are at the first and set previous page handler		jQuery('#thumbs-container .prev').css('visibility','hidden').click(function() {			jQuery('#thumbs-container ul:visible').addClass('hidden').prev().removeClass('hidden');			jQuery('#thumbs-container .next').css('visibility','visible');			if (!jQuery('#thumbs-container ul:visible').prev().is('ul')) jQuery('#thumbs-container .prev').css('visibility','hidden');			return false;		});				// Hide next page if we have only one.		if (jQuery('#thumbs-container ul').length==1) jQuery('#thumbs-container .next').css('visibility','hidden');		// Next page handler...		jQuery('#thumbs-container .next').click(function() {			jQuery('#thumbs-container ul:visible').addClass('hidden').next().removeClass('hidden');			jQuery('#thumbs-container .prev').css('visibility','visible');			if (!jQuery('#thumbs-container ul:visible').next().is('ul')) jQuery('#thumbs-container .next').css('visibility','hidden');			return false;		});	}		// MERCHANDISE / DETAILS	if ($body.hasClass('merchandise') && $body.hasClass('merch-details')) {		window.prelimgs = new Image();		window.prelimgs.src = '/images/merch/lst-item-thumb-bg_hover.gif';		// Hide previous page, we are at the first and set previous page handler		jQuery('#thumbs-container .prev').css('visibility','hidden').click(function() {			jQuery('#thumbs-container ul:visible').addClass('hidden').prev().removeClass('hidden');			jQuery('#thumbs-container .next').css('visibility','visible');			if (!jQuery('#thumbs-container ul:visible').prev().is('ul')) jQuery('#thumbs-container .prev').css('visibility','hidden');			return false;		});				// Hide next page if we have only one.		if (jQuery('#thumbs-container ul').length==1) jQuery('#thumbs-container .next').css('visibility','hidden');		// Next page handler...		jQuery('#thumbs-container .next').click(function() {			jQuery('#thumbs-container ul:visible').addClass('hidden').next().removeClass('hidden');			jQuery('#thumbs-container .prev').css('visibility','visible');			if (!jQuery('#thumbs-container ul:visible').next().is('ul')) jQuery('#thumbs-container .next').css('visibility','hidden');			return false;		});		jQuery('#lst-options a').click(function() { 			jQuery('#lst-options img.selected').remove();			jQuery(this).parent().prepend('<img class="selected" src="'+jQuery(this).find('img.rollover').attr('src')+'" alt="" />');			panelinit = null;			jQuery('#content-right-right').load('/merchandise/panel/'+jQuery(this).attr('rel'),function() {				if (typeof(panelinit)=='function') {					panelinit();				}			}).html('<div id="panelloader"><img src="/images/loading.gif" alt="" /></div>');			return false;		});				if ($body.hasClass('chair')) {			var oldsrc;			jQuery('.item-size').css('cursor','help').hover(function() {				oldsrc = jQuery('#item-image-full img:first').attr('src');				jQuery('#item-image-full img:first').attr('src','/images/chairsize.jpg');			},function() {				jQuery('#item-image-full img:first').attr('src',oldsrc);			});		}				if ($body.hasClass('stool')) {			var oldsrc;			jQuery('.item-size').css('cursor','help').hover(function() {				oldsrc = jQuery('#item-image-full img:first').attr('src');				jQuery('#item-image-full img:first').attr('src','/images/stoolsize.jpg');			},function() {				jQuery('#item-image-full img:first').attr('src',oldsrc);			});		}				if ($body.hasClass('bench')) {			var oldsrc;			jQuery('.item-size').css('cursor','help').hover(function() {				oldsrc = jQuery('#item-image-full img:first').attr('src');				jQuery('#item-image-full img:first').attr('src','/images/benchsize.jpg');			},function() {				jQuery('#item-image-full img:first').attr('src',oldsrc);			});		}				if ($body.hasClass('storage')) {			var oldsrc;			jQuery('.item-size').css('cursor','help').hover(function() {				oldsrc = jQuery('#item-image-full img:first').attr('src');				jQuery('#item-image-full img:first').attr('src','/images/buffetsize.gif');			},function() {				jQuery('#item-image-full img:first').attr('src',oldsrc);			});		}				if (typeof panelinit == 'function') panelinit();	}		// CONTEST PAGING...		if ($body.hasClass('contest')) {		jQuery('.page-selector a').click(function() {			// if its the current page, do nothing...			if (jQuery(this).parent().hasClass('active')) return false;						// if its the "show all" item, show all items...			if (jQuery(this).parent().hasClass('all')) {				var stritems = '';				jQuery('.lst-contest-thumbs').each(function() {					stritems += jQuery(this).html();				});				jQuery('#contest-participants').html('<ul class="lst-contest-thumbs">'+stritems+'</ul>');				jQuery('.page-selector').css('visibility','hidden');				jQuery("a[rel^='prettyPhoto']").prettyPhoto();				if (jQuery.browser.msie) fixfooter();				return true;			}						// for every other pages...			jQuery('.page-selector .active').removeClass('active');			//jQuery(this).parent().addClass('active');			jQuery('.lst-contest-thumbs:visible').addClass('hidden');			jQuery('.lst-contest-thumbs:eq('+(parseInt(jQuery(this).html(),10)-1)+')').removeClass('hidden');			jQuery('.page-selector:first li:eq('+(parseInt(jQuery(this).html(),10)-1)+')').addClass('active');			jQuery('.page-selector:last li:eq('+(parseInt(jQuery(this).html(),10)-1)+')').addClass('active');			if (jQuery.browser.msie) fixfooter();			return true;		});		jQuery("a.contestimg").live('click',function() {			jQuery(this).next('a').click();			return false;		});	}		if (jQuery.browser.msie) jQuery('#breadcrumb').css('zoom',1);});