			function ChangeColor(src, obj){
				 
				var img = document.getElementById('photo');
				img.src = src;
			}
			function ChangeColor2(src, obj){
				 
				var img = document.getElementById('photo2');
				img.src = src;
			}

			$(function(){
			function runEffect(){
			//get effect type from 
			var selectedEffect = $('#effectTypes').val('blind');
			
			//most effect types need no options passed by default
			var options = {};
			//check if it's scale or size - they need options explicitly set
			if(selectedEffect == 'scale'){  options = {percent: 100}; }
			else if(selectedEffect == 'size'){ options = { to: {width: 280,height: 185} }; }
			
			//run the effect
			$("#effect").show('blind',options,500,callback);
		};
		
		//callback function to bring a hidden box back
		function callback(){
			
		};
		
		//set effect from select menu value
		$("#button").click(function() {
			runEffect();
			return false;
		});

	
	$(function() {

		//run the currently selected effect
		function runEffect(){
			//get effect type from 
			var selectedEffect = $('#effectTypes').val();
			
			//most effect types need no options passed by default
			var options = {};
			//check if it's scale or size - they need options explicitly set
			if(selectedEffect == 'scale'){  options = {percent: 0}; }
			else if(selectedEffect == 'size'){ options = { to: {width: 200,height: 60} }; }
			
			//run the effect
			$("#effect").hide('blind',options,500,callback);
		};
		
		//callback function to bring a hidden box back
		function callback(){
			
		};
		
		//set effect from select menu value
		$("#button2").click(function() {
			runEffect();
			return false;
		});

	});
				// Slider
				$("#slider").slider({
			range: true,
			min: 0,
			max: 100000,
			values: [0, 80000],
			slide: function(event, ui) {
				$("#amount").val(ui.values[0]);
				$("#amount2").val(ui.values[1]);
			}
		});
		$("#amount").val($("#slider").slider("values", 0));
		$("#amount2").val($("#slider").slider("values", 1));
				
				
				
				//hover states on the static widgets
				$('#dialog_link, ul#icons li').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);
				
			});
			$(function() {
		$("#button3").click(function() {
			$('#effect2').toggleClass('newClass', 1000);
			$('#effect3').toggleClass('newClass2', 1000);
			return false;
		});
		});
		$(function() {
		$("#button4").click(function() {
$('#effect3').toggleClass('newClass2', 1000);
			return false;
		});
	});


/*
			$(function() {
			$("#button3").click(function() {
			$('#effect2').toggleClass('newClass', 1000);
			$('#effect3').toggleClass('newClass2', 1000);
			return false;
		});
		});
		$(function() {
		$("#button4").click(function() {
		$('#effect3').toggleClass('newClass2', 1000);
			return false;
		});
	});*/
	$(function() {
		$("#button5").click(function(){
			$(".allbrands2").switchClass('allbrands2', 'allbrands3', 1000);
			$(".allbrands3").switchClass('allbrands3', 'allbrands2', 1000);
			return false;	
		});
	});



$(function() {

	$('.tabs A').click(function() {
		var A = $(this), li = A.parent();
		if (!li.hasClass('active')) {
			$(li.parent().find('LI.active').removeClass('active').find('A').attr('rel'))
				.animate({opacity: 'hide'}, 5, function() {
					$(A.attr('rel')).animate({opacity: 'show'}, 5);
					li.addClass('active');
				});
		}
		return!1;
	});


});

$(function() {

	$('.tabs-items A').click(function() {
		var A = $(this), li = A.parent();
		if (!li.hasClass('active')) {
			$(li.parent().find('LI.active').removeClass('active').find('A').attr('rel'))
				.animate({opacity: 'hide'}, 5, function() {
					$(A.attr('rel')).animate({opacity: 'show'}, 5);
					li.addClass('active');
				});
		}
		return!1;
	});


});

$(function() {

	$('.tabs-filter A').click(function() {
		var A = $(this), li = A.parent();
		if (!li.hasClass('active')) {
			$(li.parent().find('LI.active').removeClass('active').find('A').attr('rel'))
				.animate({opacity: 'hide'}, 1, function() {
					$(A.attr('rel')).animate({opacity: 'show'}, 1);
					li.addClass('active');
				});
		}
		return!1;
	});


});

$(function() {
/*
	$('.title A.pick').click(function() {
		var A = $(this), li = A.parent();
			$(li.parent().find('LI.active').addStyle('display: block;'))
				.animate({opacity: 'show'}, 1, function() {
					li.addClass('active');
				});
		return!1;
	});

	$('.title A.pick').click(function() {
		var A = $(this), li = A.parent();
		if (!li.hasClass('active')) {
			$(li.parent().find('LI.active').removeClass('active').find('A').attr('rel'))
				.animate({opacity: 'hide'}, 1, function() {
					$(A.attr('rel')).animate({opacity: 'show'}, 1);
					li.addClass('active');
				});
		}
		return!1;
	});
*/

});

$(document).ready(function() {
	searchinput = $("#search input");
	searchfield();
	searchload();
	//searchGo();
});



function searchfield() {
	if (!searchinput.attr("value")) { searchinput.attr("value", "").addClass("no"); }
	$(document).unbind("click", searchfield);
	searchinput.unbind("mouseenter").unbind("mouseleave");
}

function searchload() {
	$("#searchex").click(function () { $("#search input").attr("value", $("#searchex").text()).removeClass("no"); return false;});

	searchinput.click(function () { 
		if ($(this).hasClass("no")) {
			$(this).attr("value", "").removeClass("no");
		}
		$(this).mouseenter(function () { $(document).unbind("click", searchfield); }).mouseleave(function () { $(document).click(searchfield); });
	});
}

jQuery(function() {
	jQuery('.dialog-trigger').click(function() {
		var h = jQuery('html').height(), w = jQuery('html').width();
		var overlay = jQuery('#overlay');
		if (overlay.length == 0) overlay = jQuery('<div id="overlay" class="hidden"/>').appendTo('body');
		overlay.height(h).width(w).show();
		var form = jQuery(jQuery(this).attr('rel'));
		form.css({ top: parseInt((h - form.outerHeight())/2)+'px',
				   left: parseInt((w - form.outerWidth())/2)+'px' }).animate({ opacity: 'show' }, 400);
		var close = form.find('.close-trigger').click(function() {
			form.animate({ opacity: 'hide' }, 200);
			overlay.hide();
			return!1;
		});
		var close = form.find('.close-link').click(function() {
			form.animate({ opacity: 'hide' }, 200);
			overlay.hide();
			return!1;
		});
		form.find('.submit').click(function() {
			close.trigger('click');
		});
		return!1;
	});
});

jQuery(function() {
	jQuery('.dialog-trigger-2').click(function() {
		var h = jQuery('html').height(), w = jQuery('html').width();
		var overlay = jQuery('#overlay2');
		if (overlay.length == 0) overlay = jQuery('<div id="overlay2" class="hidden"/>').appendTo('body');
		overlay.height(h).width(w).show();
		var form = jQuery(jQuery(this).attr('rel'));
		form.css({ top: parseInt((h - form.outerHeight())/2)+'px',
				   left: parseInt((w - form.outerWidth())/2)+'px' }).animate({ opacity: 'show' }, 400);
		var close = form.find('.close-trigger').click(function() {
			form.animate({ opacity: 'hide' }, 200);
			overlay.hide();
			return!1;
		});
		var close = form.find('.close-link').click(function() {
			form.animate({ opacity: 'hide' }, 200);
			overlay.hide();
			return!1;
		});
		form.find('.submit').click(function() {
			close.trigger('click');
		});
		return!1;
	});
});


$(function() {
	var settboxs = $('.box.settings');
	settboxs.find('.title .pick').click(function() {
		var b = $(this).parents('.box');
		if (!b.hasClass('active')) {
			var c = b.find('.content');
			settboxs.find('.content').not(c).slideUp(200).parents('.settings').removeClass('active');
			c.slideDown(200, function() { b.addClass('active'); });
		}
		else b.removeClass('active').find('.content').slideUp(200);
		return!1;
	});
});

