
/*
 * Opens a popup window and places focus on it.
 * Pass flags as true or false.
 */
function openPopupWindow( urlString, windowName,
                          includeToolbar, includeStatus, isScrollable, isResizable,
                          width, height )
{
  var attributes = '';

  if ( includeToolbar == true )
  {
      attributes = attributes + 'toolbar=yes,';
  }
  else
  {
      attributes = attributes + 'toolbar=no,';
  }

  if ( includeStatus == true )
  {
      attributes = attributes + 'status=yes,';
  }
  else
  {
      attributes = attributes + 'status=no,';
  }

  if ( isScrollable == true )
  {
      attributes = attributes + 'scrollbars=yes,';
  }
  else
  {
      attributes = attributes + 'scrollbars=no,';
  }

  if ( isResizable == true )
  {
      attributes = attributes + 'resizable=yes,';
  }
  else
  {
      attributes = attributes + 'resizable=no,';
  }

  attributes = attributes + 'width=' + width + ",";

  attributes = attributes + 'height=' + height;

  var popupWindow = window.open( urlString, windowName, attributes );

  popupWindow.focus();

  return popupWindow;
}

/*
 * see if Netscape or a Mac is in use
 *
 */
function isNetscapeOrMac()
{
  browser_version = parseInt( navigator.appVersion );
  browser_type    = navigator.appName;
  platform        = navigator.platform;
  platform_slice  = platform.slice( 0, 3 );

  
//  alert( 'browser_version:' + browser_version + ':\n' +
//         'browser_type:'    + browser_type    + ':\n' +
//         'platform:'        + platform        + ':\n' +
//         'platform_slice:'  + platform_slice  + ':' );

  if ( (browser_type == "Netscape") ||
       (platform_slice == "Mac"   )  )
  {
    return true;
  }

  return false;
}

/**
 * See if Mac is in use.
 */
function isMac( )
{
  platform        = navigator.platform;
  platform_slice  = platform.slice( 0, 3 );

  if ( platform_slice == "Mac" )
  {
    return true;
  }

  return false;
}

/* -- seats left -- */
s_userAgent = window.navigator.userAgent
isIE = (document.all) ? 1 : 0;
isKHTML = (s_userAgent.indexOf("KHTML")>-1) ? 1 : 0;
isMac = (s_userAgent.indexOf("Mac")>-1) ? 1 : 0;
t_hideinfo = null;
t_fade = null;
function getscrollamt(s_dir){
	i_amt = (s_dir=='y') ? (document.all) ? document.body.scrollTop : window.scrollY : (document.all) ? document.body.scrollLeft : window.scrollX;
	return i_amt;
}
function showinfo(evt,s_info){
	clearTimeout(t_hideinfo);
	o_info = document.getElementById(s_info);
	resetfade(o_info);
	o_info.style.left = "-10000px";
	o_info.style.display="block";
	i_infoh = o_info.offsetHeight;
	i_infow = parseInt(o_info.offsetWidth/2,10);
	evt = (window.event) ? window.event : evt;
	i_mousey = evt.clientY;
	i_mousex = evt.clientX;
	o_content = document.getElementById("mainContent")
	i_y = (i_mousey>i_infoh) ?  getscrollamt('y')-document.getElementById("mainContent").offsetTop + i_mousey-i_infoh-10 : getscrollamt('y')-document.getElementById("mainContent").offsetTop + i_mousey+10;
	if(isKHTML) i_y = (i_mousey-getscrollamt('y')<i_infoh) ?  i_mousey-document.getElementById("mainContent").offsetTop : i_mousey-document.getElementById("mainContent").offsetTop-i_infoh-20;
	i_x = o_content.offsetWidth-o_info.offsetWidth-14;
	o_info.style.top = i_y
	o_info.style.left = i_x
}
function resetfade(o_fade){
	clearTimeout(t_fade);
	o_fade.style.MozOpacity = 1;
	o_fade.style.opacity = 1;
	o_fade.style.filter = "alpha(opacity=100)";
}
function fadeout(s_fade){
	o_fade =document.getElementById(s_fade);
	o_info.style.MozOpacity = i_fade/100;
	o_info.style.opacity = i_fade/100;
	o_info.style.filter = "alpha(opacity="+i_fade+")";
	i_fade-=20;
	if(i_fade>=0)t_fade = setTimeout("fadeout('"+s_fade+"')",50);
	else{o_info.style.display="none";}
}
function hideinfo(){
   	i_fade = 100;
	if(isMac&&!isKHTML)o_info.style.display="none";
	else t_fade = setTimeout("fadeout('info_seatsLeft')",500);
}
/* -- /seats left -- */
