// Misc functions for www.apelsin.nu
// 2003-07-29

function openWin( windowURL, windowName, windowFeatures ) { 
  remote=window.open( windowURL, windowName, windowFeatures ); 
  return;
}
function fullscreen( windowUrl ) {
  win=window.open(windowUrl,"fullscreen","fullscreen,scroll=no",true);
  win.focus();
}
function openCookies() { remote=window.open( 'http://www.apelsin.nu/cookies.htm','Cookies','width=500,height=300,toolbar=0,location=0,directories=0,scrollbar=1,scrollBars=1,resizable=1' ); }
function privacy() { remote=window.open( 'http://www.apelsin.nu/privacy.htm','Privacy','width=400,height=200' ); }
function feedback() { remote=window.open( 'http://www.apelsin.nu/feedback.php','Feedback','width=400,height=200' ); }
function viewProfile( id ) {
  remote=window.open('http://www.apelsin.nu/profile_view.php?id='+id,id,'width=400,height=300,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbar=1,scrollBars=1,resizable=1' );
  remote.focus();
  return;
}

function openWho( ) {
  remote=window.open('http://www.apelsin.nu/who.php','Who','width=400,height=300,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbar=1,scrollBars=1,resizable=1' );
  remote.focus();
  return;
}

function openMsg( id ) {
  remote=window.open( "http://www.apelsin.nu/msg_read.php?id="+id, 'Message', 'width=400,height=300,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1' ) ; 
  return;
}

function hilite(row, col) {
  if (col == '' || typeof(row.style) == 'undefined') {
    return false;
  }
  if (typeof(document.getElementsByTagName) != 'undefined') {
    var cells = row.getElementsByTagName('td');
  } else if (typeof(row.cells) != 'undefined') {
    var cells = row.cells;
  } else {
    return false;
  }
  var cnt  = cells.length;
  for (var c = 0; c < cnt; c++) {
    cells[c].style.backgroundColor = col;
  }
  return true;
}

var areTheyChecked = false
function swapAll (theForm) {
  areTheyChecked = !areTheyChecked
  for(var i=0; i<theForm.length; i++) {
    var el= theForm.elements[i];
    el.checked = areTheyChecked;
  }
}

// functions to handle browsing (changing background colors)
function mOvr(src,col){ src.style.backgroundColor=col; src.style.cursor = 'pointer'; }
function mOut(src,col){ src.style.backgroundColor=col; src.style.cursor = 'default'; }
function mClk(src) { src.children.tags('A')[0].click(); }

// Function to hide information div-layer, if any
function HideInfoLayer() { var o = document.getElementById('infolayer'); o.style.visibility = 'hidden'; }
