function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function doOpen(url,target){
var w = window.open(url,target,"width=450,height=400");
w.focus();
return false; //cancels href
}

function highlightCurrent(current){
cat=document.getElementById(current);
cat.className="highlight";
}


function add2fav(vid, user)
{
  if (!user)
  {
     alert("Please Login to Add this video to your Favorites");
  }

  else
  {
   if (window.XMLHttpRequest)
    { // Mozilla, Safari, ...
      request2 = new XMLHttpRequest();
    }
  else if (window.ActiveXObject)
    { // IE
      request2 = new ActiveXObject("Msxml2.XMLHTTP");
    }

  request2.open("GET",'/video/add2fav.php?vid='+vid+'&user='+user);
  request2.send(null);

  hideObj("no_fav");
  unhideObj("add_fav");


  return false;
}

}
