 $(document).ready(function() {




$('select#right-backgrounds').change(function () { 
	var n = $(this).children(":selected").val();
	$('body').removeClass().addClass(n);
});	


$('select#right-backgrounds').change(function () { 
	var n = $(this).children(":selected").val();
	if (n == 'rbg1') {
		$('#right').css('backgroundColor', '#f7f7f7').removeClass().addClass("lines-1");
	}
	
	else if (n == 'rbg2') {
		$('#right').css('backgroundColor', '#f7f7f7').removeClass().addClass("lines-2");
	}
	else if (n == 'rbg3') {
		$('#right').css('backgroundColor', '#f7f7f7').removeClass().addClass("square-grid");
	}
	else if (n == 'rbg4') {
		$('#right').css('backgroundColor', '#f7f7f7').removeClass().addClass("square-grid-big");
	}
	else if (n == 'rbg5') {
		$('#right').css('backgroundColor', '#f7f7f7').removeClass().addClass("cross");
	}
	else if (n == 'rbg6') {
		$('#right').css('backgroundColor', '#f7f7f7').removeClass().addClass("cross-big");
	}
});	

/*var q = ["h2", "h3", "h4", "a", "th", "caption", ".author", ".dropcap-1", "#navigation li a:hover", "#navigation li a.active", "#content-slider h2 span", ".tagline-text h3 span", ".box-title h3", ".box-title h4", ".latest-news li a:hover", ".latest-news li strong:hover", ".comment-text cite", ".latest-news li span"];
var all = q.join(", ");
*/


$('#colorpickerField').ColorPicker({
	
	onChange: function (hsb, hex, rgb) {
		$("body").css('backgroundColor', '#' + hex);
	},

	onSubmit: function(hsb, hex, rgb, el) {
		$(el).val(hex);
		$(el).ColorPickerHide();
	},
	onBeforeShow: function () {
		$(this).ColorPickerSetColor(this.value);	
	}
		
})

$('#colorpickerField2').ColorPicker({
	
	onChange: function (hsb, hex, rgb) {
		$("#footer").css('backgroundColor', '#' + hex);
	},

	onSubmit: function(hsb, hex, rgb, el) {
		$(el).val(hex);
		$(el).ColorPickerHide();
	},
	onBeforeShow: function () {
		$(this).ColorPickerSetColor(this.value);	
	}
		
})



$('select#layout').change(function () { 
	var w = $(this).children(":selected").val();
	if (w == 'boxed') {
		window.location.href = "../../boxed/red/index.html";
	}
	
	else if (w == 'full') {
		window.location.href = "../../stretched/red/index.html";
	}
});	

	
$('.close').click(function () {
	$('#optwrap').animate({"left": "-=210px"}, "4000");
	$(this).hide();
	$('.open').show();
});

$('.open').click(function () {
	$('#optwrap').animate({"left": "+=210px"}, "4000");
	$(this).hide();
	$('.close').show();
});



}); // end of jquery
  
  
  
  
  
  
