function dignore() { ignore = 1; }
function flip( id ) {
  if( ignore ) { ignore = 0; return };
  
  clearvid();
  
  if( curstory != -1 && id != curstory ) {
    var a = curstory;
    curstory = -1;
    flip( a );
  }
  if( vis[ id ] ) {
    _hide( _getel( 'story_' + id ) );
    vis[ id ] = 0;
    curstory = -1;
    _getel('dot_'+id).src = '/images/plus.gif';
    _show(_getel('aimg'))
  }
  else {
    _show( _getel( 'story_' + id ) );
    vis[ id ] = 1;
    curstory = id;
    _getel('dot_'+id).src = '/images/minus.gif';
  }
}
var hover = {};
function over( id ) {
  var div = _getel('div_'+id);
  if( div.className == 'aline odd' ) hover[ id ] = ' odd';
  else hover[ id ] = '';
  div.onmouseout = out.bind(0,id);
  div.className = 'alineover';
}
function out( id ) {
  var div = _getel('div_'+id);
  div.className = 'aline'+hover[id];
}

var vis = {  };
var curstory = -1;
var ignore = 0;
var curvid = 0;
function clearvid() {
  if( curvid ) { _hide(_getel('aimg')); _del( curvid ); curvid = 0; }
}
function playvid( vid, mature ) {
  if( mature ) {
    var ok = confirm(
    "This video is intended only for mature audiences\n"+
    "and may include content that is not suitable for children.\n\n"+
    "If you are 18 or older and are not bothered by such mature content\n"+
    "click OK to view it or CANCEL to skip it");
    if( !ok ) return;
  }
  var vidstring ='/template/flashplayers/xmlstreamplayer.swf?xmlfile='+vid+'&autostart=true';
  
  addvid(vidstring, 480, 380, 0 );
  
  //_hide( _getel('aimg') );
}
function addvid( path, width, height, noheight ) {
  //_clear( _getel('vidPane') );
  clearvid();
  var vidwin    = _newel('div');
  vidwin.id     = 'vidwin';
  var newob     = _newel( 'object' );
  newob.classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
  newob.data    = path;
  newob.width   = width;
  newob.height  = height;
  newob.id      = 'movie';
  if( noheight ) vidwin.style.height = '30px !important';
  _hide(_getel('aimg') );
  //_insertafter( _getel( 'aimg' ), _append( vidwin, newob ) );
  _append( _getel( 'vidPane' ), _append( vidwin, newob ) );
  newob.movie   = path;
  curvid = vidwin;
}
var hover = {};
function over( id ) {
  var div = _getel('div_'+id);
  if( div.className == 'aline odd' ) hover[ id ] = ' odd';
  else hover[ id ] = '';
  div.onmouseout = out.bind(0,id);
  div.className = 'alineover';
}
function out( id ) {
  var div = _getel('div_'+id);
  div.className = 'aline'+hover[id];
}