function switchnav(newtid, newsection, selected) {
  if(tid != newtid) {
        //change selected tid
        $("#listnav li").eq(tid-1).removeClass("selected");
        $("#listnav li").eq(newtid-1).addClass("selected");
        tid = newtid;  
  }
  if(section != newsection) {
        section = newsection;
  }
  $.get('/nav.php?tid='+tid+'&section='+section+'&selected='+selected,  function(data) { $('div#top5container').html(data); } );
}


//Vitaly's
function sendtofriends(title, address){
  b="";
  b="<html><head><title>Email video to friends</title></head><body style='background-color: #fff;'><h3>Email video to friends ...</h3>"+b;
  b=b+'<form action="http://viralvideos.com/tomail.php" method="POST"><table width="530px" align="center">';
  b=b+'<tr><td width="80px"><b>From:</b></td><td width="450px"><input name="from" id="from" value="" style="width:250px"> <font face="Arial" size="2"> (Your name)</font></td></tr>';
  b=b+'<tr><td width="80px"><b></b></td><td width="450px"><input name="fromem" id="fromem" value="" style="width:250px"> <font face="Arial" size="2"> (Your e-mail)</font></td></tr>';
  b=b+'<tr><td width="80px"><b>To:</b></td><td width="450px"><input name="address" id="address" value="" style="width:450px"></td></tr>';
  b=b+'<tr><td width="80px"><b>Subject:</b></td><td width="450px"><input name="subj" id="subj" value="Check out this cool video I found on ViralVideos.com!" style="width:450px"></td></tr>';
  b=b+'<tr><td width="80px" valign="top"><b>Message:</b></td><td width="450px"><textarea name="body" id="body" style="height:183px; width:450px">' + title + '\n' + address + '</textarea></td></tr>';
  b=b+'<tr><td><br>&nbsp;</td><td align="right"><br><input name="submit" type="submit" value="Send" style="width:100px; height:40px;" align="right"></td></tr></table></form>';
  
  window.gt=b+"</h1></body></html>";
  var u=window.open("javascript:window.opener.gt","","height=425px,width=560px");
}


//Vitaly's
function enlarge(title, embed) {
  b="";
  b="<html><head><title>"+title+"</title><style type='text/css'>background-color: #fff;</style></head><body>"+b;
  b=b+'<div id="shower" align="left" width="700" height="560" style="position:absolute; top:0px; left:0px">'+embed+"</div></body></html>";
  window.gtb=b;
  var u=window.open("javascript:window.opener.gtb","","height=570,width=710;left=70");
}
