function pop_up(my_file, width, height, title)
{ 
	if(!width) width = 600;      
	if(!height) height = 700;      
	 wnd = window.open(my_file,"wind",'width='+width+',height='+height+',left='+((screen.width-width)/2)+',top='+((screen.height-height)/2)+',scrollbars=yes,resizable=no');
	
	
	
	if(title)
	{
		wnd.document.title = title;
	
	}
	
  }
  
  
  function pop_up_t(my_file, width, height, title)
{ 
	if(!width) width = 600;      
	if(!height) height = 700;	
	 var wnd = window.open("/popups/?f="+my_file+"&t="+title ,"wind",'width='+width+',height='+height+',left='+((screen.width-width)/2)+',top='+((screen.height-height)/2)+',scrollbars=yes,resizable=no');
	
	return wnd;

  }
  
  
 
 function GetYPos(elem)
  {
   var pos = elem.offsetTop;
   while (elem.offsetParent != null)
     {
      elem = elem.offsetParent;
      pos += elem.offsetTop;
      if (elem.tagName == 'BODY') break;
     }
   return pos;
  }  

function ScrollTo(which)
  {
   if (document.all.item(which) == null)
     return true;
   var elem = eval(which);
   targetPos=GetYPos(elem);
   docLength=GetYPos(docEndImg);
   if ((docLength-targetPos) > (document.body.clientHeight-Header.offsetHeight))
     document.body.scrollTop = targetPos-Header.offsetHeight;
   else 
     document.body.scrollTop = docLength-document.body.clientHeight;
   CloseAll(0);
   return false;
  }

function skidka()
  {
   if (document.body.scrollTop>42)
     {
      plashka.style.top = document.body.scrollTop-42;
      var i=0;
      while (elem=document.all.item("grouplist"+i++))
        elem.style.top = document.body.scrollTop+1;
     }
   else
     {
      plashka.style.top = 0;
      var i=0;
      while (elem=document.all.item("grouplist"+i++))
        elem.style.top = 1;
     }
  }

  var ratesNames = {1: '(очень плохо)', 2: '(плохо)', 3: '(средне)', 4: '(хорошо)', 5: '(отлично)'};

function onOverStar(n) {
	rating_scroll.style.width = 20*n;
	rates_names.innerHTML = ratesNames[n];
}
function setRater(n) {	
	response_form.rate.value = curr_rate = n;
	rates_names.innerHTML = curr_rate_name =  ratesNames[n];
}
function restoreRate() {
	rating_scroll.style.width = 20*curr_rate;
	rates_names.innerHTML = curr_rate_name;
}

var curr_rate = 3;
var curr_rate_name = ratesNames[curr_rate];
