
$(document).ready(function()
{
  $('#bar').corner("6px");  
});


function swf(swf, width, height) {
  var date = new Date();
  var id = hex_md5(swf + date.getUTCSeconds() + Math.random());
  document.write('<div id="' + id + '"></div>');
  
  var swfo = new SWFObject(swf, id + 'movie', width, height, "9", "#FFFFFF");
  swfo.write(id);  
}

function play_video(src)
{
  popup('play_video.php?src='+src, 420, 395);
}

function play_video_old(src)
{
  popup('play_video.php?old=1&src='+src, 530, 425);
}

function startup()
{
  fixanchors();
}

function fixanchors()
{
  base = document.location.href;
  pos = base.indexOf('#');
  if (pos > -1) {
    base = base.substring(0, pos);
  }
  
  anchors = document.getElementsByTagName('a');
  log = '';
  for (x in anchors) {
    log += anchors[x] + "\r\n";
    href = new String(anchors[x].href);
    pos = href.indexOf('#');
    if (pos > -1) {
      log += 'anchor: ' + href.substring(pos) + "\r\n";
      anchors[x].href = base + href.substring(pos);
    }
  }
  //alert(log);
}




function popup(url, width, height)
{
  if (width == undefined) width = 500;
  if (height == undefined) height = 500;
  var base = document.getElementsByTagName('base')[0].href;
  var left =  (screen.availWidth - width) / 2;
  var top =  (screen.availHeight - height) / 3;
  window.open(base + url, '', 'width='+width+',height='+height+',left='+left+',top='+top
                              +',resizable,scrollbars=auto');
}
