/** WP mcookie skin **/
function _skin(name, expires, path, message) {
	var link = null;
	this.get = function() {
		return WP.mcookie.get('skin');
	}
	
	this.set = function(url){
		WP.mcookie.set('skin',url);
		this.show();
		return false;
	}
	
	this.reset = function()	{
		WP.mcookie.set('skin','ped');
		this.show();
	}
	
	this.show = function(){
		var skin = this.get();
		link = document.getElementsByTagName('link')[1];
		if(link) link.setAttribute('href', 's_'+skin+'.css');
	}
	if (WP.mcookie.get('skin')==null) { WP.mcookie.set('skin','ped'); }

	//do gwiazdek z ocena internautów (jeżeli sa na stronie)
	WP.event.set(
			'onload',
			function(){
				if(document.getElementById('actVote'))
					$('actVote').src        = $('actVote').src.replace(/gw_[^\/]*/, 'gw_'+WP.mcookie.get('skin'));
				if(document.getElementById('actVoteWeekly'))
					$('actVoteWeekly').src  = $('actVoteWeekly').src.replace(/gw_[^\/]*/, 'gw_'+WP.mcookie.get('skin'));
				if(document.getElementById('actVoteMonthly'))
					$('actVoteMonthly').src = $('actVoteMonthly').src.replace(/gw_[^\/]*/, 'gw_'+WP.mcookie.get('skin'));
				if(document.getElementById('imgVote'))
					$('imgVote').src        = $('imgVote').src.replace(/gw_[^\/]*/, 'gw_'+WP.mcookie.get('skin'));
				if(document.getElementById('imgVoteBlock'))
					$('imgVoteBlock').src   = $('imgVoteBlock').src.replace(/gw_[^\/]*/, 'gw_'+WP.mcookie.get('skin'));
			}
		);

	this.show();
}

var skin = new _skin();
