$(function() 
{
	$('#styleswitch').change(function() {
		switchStylestyle(this.value);
		return false;
	});
	
	if(c) {
		$('#styleswitch').selectOptions(c);
	}
});

function switchStylestyle(styleName)
{
	$('link').each(function(i)
	{
		if(this.getAttribute('href').indexOf(url) != -1 && (this.getAttribute('rel') == 'stylesheet' || this.getAttribute('rel') == 'alternate stylesheet')) 
		{
			this.disabled = true;
			
			if(this.getAttribute('title') == styleName) 
			{
				this.disabled = false;
				
				$('body').addClass(this.getAttribute('href').substring(this.getAttribute('href').indexOf('/css/')+5,this.getAttribute('href').indexOf('.css')));
			}
		}
	});
	
	$.cookie('style', styleName, { expires: 365, path: '/', domain: url.substring(7,url.length) });
}

var c = $.cookie('style');
	
if(c) {
	switchStylestyle(c);
}