<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function remote(url){
		window.opener.location=url
}
function popup(Url, WindowName, Width, Height){
	PopupWin = window.open("" +Url+ "","" + WindowName + "","width=" + Width + ",height=" + Height + ",location=0,menubar=0,resizable=1,scrollbars=1,status=1,titlebar=1,toolbar=0,screenX=50,left=50,screenY=50,top=50");
        PopupWin.focus();
}

function bgcChange(obj, newColor){
	obj.style.backgroundColor=newColor
}


function validate_required( field, alternate, alerttxt ) {
  with (field) {
    if ( value==null || value=="" || value==alternate ) {
  	alert(alerttxt);
	return false;
    } else {
        searching();
        return true;
    }
  }
}

function urchinClick() {
  if( typeof _uOsr != 'undefined' ) {
    _uacct = "UA-968897-2";
    _uOsr[24]="goggle";     _uOkw[24]="q";
    _uOsr[25]="eniro";      _uOkw[25]="search_word";
    _uOsr[26]="search.jubii.dk";    _uOkw[26]="query";
    _uOsr[27]="find.tdconline.dk";  _uOkw[27]="q";
    _uOsr[28]="kvasir.no";  _uOkw[28]="searchExpr";
    urchinTracker('click');
  }
}

function validate_required_adv( fields, alerttxt ) {
  /*
  var fields = new Array(3);
  
  fields[0] = document.advanced.title;
  fields[1] = document.advanced.author;
  fields[2] = document.advanced.isbn;
  */

  for( x in fields ) {
    if ( fields[x].value!=null && fields[x].value!="" ) {
        searching();
        return true;
    }
  }
  
  alert( alerttxt );
  return false;
}


  function searching() {
    return showHideLayers('searching','','show','content','','hide');
  }

  function showHideLayers() {
    var i,p,v,u,obj,args=showHideLayers.arguments;
    for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) {
      u=v=args[i+2];
      if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; u=(u=='show')?'block':(u=='hide')?'none':u; }
      obj.visibility=v;
      obj.display=u;
    }
    return true;
  }
	
 function showHideLayersMouse() {
    var i,p,v,u,obj,args=showHideLayersMouse.arguments;
    var posx = 0;
    var posy = 0;
    var e = args[0];


    if (e.pageX || e.pageY) {
      posx = e.pageX;
      posy = e.pageY;
    } else if (e.clientX || e.clientY) {
      posx = e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
      posy = e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop );
    }

	//	alert( 'posy: '+posy );

    for (i=1; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) {
      u=v=args[i+2];
      if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; u=(u=='show')?'block':(u=='hide')?'none':u; }
      obj.visibility=v;
      obj.display=u;
      obj.top  = (posy-20) + 'px';
      obj.left = posx + 'px';
    }
    return true;
  }


  function findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length)
    {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
        x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
  }


  function comparing(id) {
    return showHideLayers('agent4_comparing_'+id,'','show','agent4_book_'+id,'','hide');
  }

  function colorRed(id) {
      var obj;
      if ( (obj=findObj('tr_'+id))!=null ) {
	  obj = obj.style;
	  obj.background = '#FF9999';
      } else {
      }
  }
//-->

