function $()
{
  return document.getElementById(arguments[0]);
}



/****** :hover for IE *******/

sfHover = function() 
{
	var sfEls = $("main-nav").getElementsByTagName("LI");
	for (var i=0; i < sfEls.length; i++) 
	{
		sfEls[i].onmouseover=function() 
		{
			this.className="sfhover";
		}
		sfEls[i].onmouseout=function() 
		{
			this.className="";
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);



/****** calendar  *******/

function addOption(oListbox, text, value, sel)
{
  var oOption = document.createElement("option");  
  oOption.appendChild(document.createTextNode(text));  
  oOption.setAttribute("value", value);
  oOption.defaultSelected = false;
  oOption.selected = sel;
  oListbox.appendChild(oOption);
}


function changeCalendar()
{ 
  var year = $('year').options[$('year').selectedIndex].value; 
  var month = $('month').options[$('month').selectedIndex].value;
  $('year' + curYear + 'month' + curMonth).style.display = 'none';
  $('year' + year + 'month' + month).style.display = 'block';
  curYear = year;
  curMonth = month;
}

/****** anketa  *******/
function trigger(){
n=arguments.length;
for (i=0;i<n;i++){
	$(arguments[i]).disabled = ($(arguments[i]).disabled)?false:true;
	}
	}
	
function triggerAdv(){
n=arguments.length;
if($('driver').checked){
for (i=0;i<n;i++){
	$(arguments[i]).disabled = false;
	}
	}else{
	for (i=0;i<n;i++){
	$(arguments[i]).disabled = true;
	}
	
	}
	}
	
function resetForm(id){
	$(id).reset();
	}
