Event.observe(window,'load',function(){
	$$('#assessment div.rating_container').each(function(el){
		var value = 0; 
		try{value=el.up().down('input[name='+el.id+']').value;}catch(e){}
		new Control.Rating(el.id,{value:value,rated:true});
	});

	$$('#your_assessment div.rating_container').each(function(el){
		new Control.Rating(el.id,{value:2.5,input:'input_'+el.id,multiple:true});
	});

	$$('#opinions div.rating_container').each(function(el){
		var value=el.up().down('input[name='+el.id.replace(/_\d+$/,'')+']').value;
		new Control.Rating(el.id,{value:value,rated:true});
	});

	try{
		if($('send_opinion'))
		$('send_opinion').down('.submit').observe('click',function(e){
				Checker.check(Event.element(e).up('form'),{
					'email':/^[a-zA-Z0-9._+&*# -]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/,
					'username':/.+/,
					'ease':/^[1-5]$/,
					'service':/^[1-5]$/,
					'contents':/^[1-5]$/,
					'times':/^[1-5]$/,
					'comment':/.+/,
					'product_name':/.+/,
					'cons': /.+/,
					'pros': /.+/,
					'title': /.+/
				});
			});
	}catch(e){}

	try{if(!$$('#opinionsbox .content *').length) $('opinionsbox').hide();}catch(e){}
	try{if(!$$('#boxform .content *').length) $('boxform').hide();}catch(e){}

	$$('.just a').each(function(el){el.writeAttribute('href','javascript:(function(){})()');el.observe('click',function(e){
			var el=Event.element(e).up().next('.info').show();
		});
	});


	$$('#sections a').each(function(el){if(el.innerHTML=='NEGOZI') el.addClassName('current');});
	
});

