var path = 'http://www.roboprice.ru/stars/';	
var words = true;	
var def = 'Оценить';	
var ask = 'Вы подтверждаете оценку "$MARK$" ?'	
var marks = 'Отвратительно!,Плохо,Посредственно,Хорошо,Отлично!';

function set(a,b,y)
{
	mod=y;mark=marks.split(",");
	var b=b.toString();
	for(var i=1;i<=5;++i)
		{
			if(a>=i){document.getElementById(b+i).src=path+"cur.png"}
			if(a<i){document.getElementById(b+i).src=path+"off.png"}
		}
}

function send_m(mark,model,menu)
{
	document.write('<form id="go" method=post action="" style=display:none><input type="hidden" name="mark" value="' + mark + '"><input type="hidden" name="kod_model" value="' + model +'"><input type="hidden" name="menu" value="' + menu + '"></form>');
	f = document.getElementById("go");
    f.submit();
}
			
function rate(a)
{
	var c=a.id.replace(/\d$/,"");
	var d=a.id.replace(c,"");
	if(confirm(ask.replace("$MARK$",mark[d-1])))
		{
			function rf()
				{
					var r=document.location.href;var i=r.indexOf("/",7);
					var l=r.substring(0,i);if(mod=="blog")
					{
						return l+"/blog/0-0-"+d+"-"+c+"-14-1"}
						if(mod=="news"){return l+"/news/0-0-"+d+"-"+c+"-15-1"}
						if(mod=="publ"){return l+"/publ/0-1-"+d+"-"+c+"-3"}
						if(mod=="photo"){return l+"/photo/1-1-"+c+"-13-"+d}
						if(mod=="board"){return l+"/board/0-1-"+d+"-"+c+"-3"}
						if(mod=="dir"){return l+"/dir/0-1-"+d+"-"+c+"-3"}
						if(mod=="load"){return l+"/load/0-1-"+d+"-"+c+"-3"}}_uPostForm('',{url:rf()})}
					}
					
						function on(a)
						{
							var c=a.id.replace(/\d$/,"");var d=a.id.replace(c,"");
							if(words)
								{
									document.getElementById(c+"rt").innerHTML=mark[d-1]
								}
						
						for(var i=1;i<=5;++i)
							{	
								if(d>=i)
									{
										document.getElementById(c+i).src=path+"on.png"
									}
							}
							
				  }
						
						function off(a,b)
							{
								var d=a.id.replace(/\d$/,"");
								
								if(words)
									{
										document.getElementById(d+"rt").innerHTML=def
									}
								
								for(var i=1;i<=5;++i)
									{
										if(b>=i){document.getElementById(d+i).src=path+"cur.png"}
										if(b<i){document.getElementById(d+i).src=path+"off.png"}
									}
};