function $(e){if(typeof e=="string")e=document.getElementById(e);return e};
var combostate = 0;

function menushow(id)
{
  $(id).style.display = "inline";
}

function menuhide(id)
{
  $(id).style.display = "none";  
}

function comboshowhide(id)
{
    if (combostate == 0)
      {
        menushow(id);
        combostate = 1;
      }
    else
     {
        menuhide(id);
        combostate = 0;
     }
}

function setField(obj)
{
  $('combocontent').firstChild.nodeValue = obj.firstChild.nodeValue;
}


function changeFontSize(size)
{
  if (size == '11')
    {
      $('path').style.fontSize = '10px';
    }
    else
    {
      $('path').style.fontSize = size + 'px';
    }
  $('languages').style.fontSize = size + 'px';
  $('columns').style.fontSize = size + 'px';
  $('footer').style.fontSize = size + 'px';
  document.cookie = "page-font-size=" + size + ";"
}

function getCookies()
{
  var cookie = " " + document.cookie;
  var search = " " + "page-font-size=";
  var setStr = null;
  var offset = 0;
  var end = 0;
  if (cookie.length > 0)
  {
    offset = cookie.indexOf(search);
     if (offset != -1)
       {
         offset += search.length;
         end = cookie.indexOf(";", offset)
         if (end == -1)
           {
             end = cookie.length;
           }
         setStr = unescape(cookie.substring(offset, end));
       }
   }
  changeFontSize(setStr);
}


function searchSelectionChanged(select) {
	
	value = select.options[select.selectedIndex].value;
	form = document.getElementById('topSearchForm');
	
	
	if(value == 933) {
		// Ansatte
		form.action = '/ansatte/sok';
		document.getElementById('searchtext').name = 'textSearch';
		
	} else {
		// Andre
		form.action = '/content/search';
		document.getElementById('searchtext').name = 'SearchText';
	}
	
}






