$('document').ready(function() {
	$('#searchfield').bind('click', function () {
		$('#searchfield').attr('value') == 'sök bland bloggar' ? $('#searchfield').attr('value', '') : null;
	});
});

function setHeader($headerVar)
{
	$('#header').attr('style', '');
	$('#header_value').attr('value', $headerVar);
	$header = $('#header_value').attr('value');
	$color = $('#color_value').attr('value');
	$headertextvalue = $('#header_text_value').attr('value');
	$headerclass = $headertextvalue != 'undefined' ? 'headertext_' + $headertextvalue : '';
	
	if($headerVar == 'custom')
	{
		$('#header').removeClass().addClass('header_custom ' + $headerclass);
	}else{
		$('#header').removeClass().addClass('header_' + $header + '_' + $color + ' ' + $headerclass);
	}
}

function setBackground($backgroundVar)
{
	$('#background_value').attr('value', $backgroundVar);
	$background = $('#background_value').attr('value');
	$color = $('#color_value').attr('value');
	
	$('#body').removeClass().addClass('background_' + $('#background_value').attr('value') + '_' + $('#color_value').attr('value') + ' ' + 'color_' + $color);
}

function setColor($colorVar)
{
	$('#color_value').attr('value', $colorVar);
	$header = $('#header_value').attr('value');
	$background = $('#background_value').attr('value');
	$color = $('#color_value').attr('value');
	
	$('#header').removeClass().addClass('header header_' + $header + '_' + $color);
	$('#body').removeClass().addClass('background_' + $background + '_' + $color + ' ' + 'color_' + $color);
}

function setHeaderText($headerTextVar)
{
	$('#header_text_value').attr('value', $headerTextVar);
	$header = $('#header_value').attr('value');
	$color = $('#color_value').attr('value');
	
	$('#header').removeClass().addClass('header header_' + $header + '_' + $color + ' headertext_' + $headerTextVar);
}
