var activeNewsTab = 'nyheter'; 

/*********************
 * Newsbox changer
 **********************
 */
function newsbox_change(url, obj)
{
  var el = document.getElementById(obj);
  el.className = 'current';

  if(obj != activeNewsTab) {
    var el = document.getElementById(activeNewsTab);
    el.className = ' ';
  }

  activeNewsTab = obj;

  request( url, '', false );
}
/*********************
 * Enkel Ok/Cancel test
 **********************
 */
function confirm_entry()
{
  input_box=confirm("Er du sikker?");
  if (input_box==true) { 
      return true;
  } else {
    return false;
  } 
}
/***********************************
 * Sender formen til gitt plassering
 ***********************************
 */
function changeActionSubmit(id, action, submit, confirm)
{
  var myElem = eval('document.'+id);
  myElem.action = action;
  if (submit==1){
    if(confirm==1){
      if(confirm_entry()){
	myElem.submit();
      }
    }else{ myElem.submit(); }
  }
  return id;
}
/********************************
 * Gå til link med bekreftelse
 ********************************
 */
function linkConfirm(link) {
  if (confirm_entry()){
    window.location.href = link;
  }
}
/********************************
 * Skriver ut annonser
 ********************************
 */
function adprint(adText)
{
  document.write(adText);
}

function setFocus()
{
  if( document.getElementById( 'search_input') )
  {
    document.getElementById( 'search_input').focus();
    document.getElementById( 'search_input').select();
  }
}

/********************************
 * Search functions
 ********************************
 */
  function ss(w){
    window.status=w;
    return true;
  }

  function cs(){
    window.status='';
  }
 
	function ga(o,e)
	{
		if (document.getElementById)
		{
	 		a=o.id.substring(1);
			p = "";
			r = "";
			g = e.target;
	 		if (g)
			{
				t = g.id;
				f = g.parentNode;
				if (f) 
				{
					p = f.id;
					h = f.parentNode;
					if (h)
						r = h.id;
				}
			}
			else
			{
				h = e.srcElement;
				f = h.parentNode;
				if (f)
					p = f.id;
					t = h.id;
			}
			
			if (t==a || p==a || r==a)
				return true;
			
			location.href=document.getElementById(a).href;
		}
	}

	function googleclick( url )
	{
		location.href = url;
	}
