// Selection boxes
function one2two(m1, m2) {
    var m1len = m1.length ;
    var i = 0;
    for ( i=0; i<m1len ; i++){
        if (m1.options[i].selected == true ) {
            var m2len = m2.length;
            m2.options[m2len]= new Option(m1.options[i].text, m1.options[i].value);
        }
    }

    for ( i = (m1len -1); i>=0; i--){
        if (m1.options[i].selected == true ) {
            m1.options[i] = null;
        }
    }
}
function selectall (m1) {
  for (i=0; i<m1.length; i++) { 
    m1.options[i].selected = true; 
  }
}

function choose_image(img, img2, form) {
  window.opener.document.images[window.name].src = img;
  window.opener.document.edit.elements[form].value=img2;
  if (confirm("Picture is placed into article...\nClose this window?")) {
    self.close();
  }
  else {
    return true;
  }
}

function vindu(url,title,width,height,movx, movy) {
  newwin=window.open(url,title,'width='+width+',height='+height+',scrollbars=yes,resizable=yes,menubar=no,toolbar=no');
  //newwin.resizeTo(width,height);
  newwin.focus();
  x = screen.width;
  y = screen.height;
  if( movx && movy ){
    newwin.moveTo(movx,movy);
  } else{
    newwin.moveTo((x/2)-(width/2),(y/2)-(height/2));
  }
}

function vindu_no(url,title,width,height,movx, movy) {
  newwin=window.open(url,title,'width='+width+',height='+height+',scrollbars=no,resizable=no,menubar=no,toolbar=no');
  //newwin.resizeTo(width,height);
  newwin.focus();
  x = screen.width;
  y = screen.height;
  if( movx && movy ){
    newwin.moveTo(movx,movy);
  } else{
    newwin.moveTo((x/2)-(width/2),(y/2)-(height/2));
  }
}

function vindu_tja(url,title,width,height,movx, movy) {
  newwin=window.open(url,title,'width='+width+',height='+height+',scrollbars=no,resizable=yes,menubar=no,toolbar=no');
  //newwin.resizeTo(width,height);
  newwin.focus();
  x = screen.width;
  y = screen.height;
  if( movx && movy ){
    newwin.moveTo(movx,movy);
  } else{
    newwin.moveTo((x/2)-(width/2),(y/2)-(height/2));
  }
}



// Copyright Sorenso AS - 2004 
function tdHover(myTd, status, color) {
  if (status) {
    myTd.style.backgroundColor = color;
  }
  else {
    myTd.style.backgroundColor = color;
  }
}
function tdClick( myTd, color, url ) {
  tdHover(myTd, 0, color);
  tdJump(url);
}
function tdJump ( url ){
  window.location.href = url;
}
