(function($){
	var Website = {
		run: function(){
			var isIE6 = !$.support.opacity && !window.XMLHttpRequest;;
			//Dirty IE6 Fixes/Hacks
			
			if(isIE6 && typeof(DD_belatedPNG) != 'undefined'){
				DD_belatedPNG.fix('.image, .content-box-contact span , .block-button, .color-selector, #progressbar, .block-filter, .top, .bottom, .shoppingcart, .image-bin, .block-followup-top, .block-followup-bottom, .block-followup, .form-submit, .form-submit span, .fold, .fold span, .green, .green span, .block-image, .block-steel-top, .block-steel-bottom, .block-steel-image, .print, .email, form-text, .readmore');
			}

			this.setEvents();
		},
		setEvents: function(){
			
			var oColorPicker = $('#color-picker');
			if(oColorPicker.length > 0){
				oColorPicker.click(this.showColors);
				$('#ralpicker').click(this.appendColor);
				$('#ralpicker-close').click(function(){$(this).parent().hide(); return false});
			}
		},
		showColors: function(){
			var oTarget = $(this);
			var oRalPicker = $('#ralpicker');
			oRalPicker.css({ 'left': oTarget.position().left, 'top': oTarget.position().top }).show();
			return false;
		},
		appendColor: function(oEvent){
			var oTarget = oEvent.target;
			if(oTarget.nodeName == 'A' && oTarget.id.indexOf('ralpicker-close')== -1){
				$('#edit-color-input')[0].value = oEvent.target.rel;
				$(this).hide();
				return false;
			}
		}
	};
	$(document).ready(function(){
		Website.run();
		
	});
})(jQuery);

