var catalog_id=0,new_points;
function rating(){
	var v=$('rating');
	for(c=1;c<6;c++){
		v.grab(new Element('a',{
			'html':'&nbsp;',
			'title':c,
			'events':{
				'click':function(){
					new Request.HTML({url:absPath+webLang+'/ubytovanie/',method:'get',onSuccess:function(tree,elements,html,js){
						$('rating_box').set('html',html);
						catalog_id=0;
					}}).send('webmin_ajax=1&catalog_action_type=rate&catalog_id='+catalog_id+'&catalog_points='+this.title);
					return false;
				},
				'mouseover':function(){v.setStyle('backgroundPosition',(-150+(this.title*30))+'px 0px');},
				'mouseout':function(){v.setStyle('backgroundPosition','-150px 0px');}
			}
		}));
	}
}

window.addEvent('domready',function(){
	if(catalog_id!=0)
		rating();
	if($('news_back'))
		$('news_back').addEvent('click',function(){
			history.go(-1);
			return false;
		});
});
