$(function(){

function get_skin_preview() {
	layout = $("select#layout").val();
	color_value = $("select#color").val();
	tmp_array = color_value.split('_');
	color = tmp_array.pop()
	preview = '/qtbuilder/img/skin/' + layout + '_' + color + '.jpg';
	return preview;
}

$("select#layout").change(function() {
	preview = get_skin_preview();
	$("#skin-preview").attr('src',preview);
})

$("select#color").change(function() {
	preview = get_skin_preview();
	$("#skin-preview").attr('src',preview);
})

});
