function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1) 
      return element;

    elements.push(element);
  }

  return elements;
}		

function popWin (url, width, height) {			
	//center the pop-up	
	if (parseInt(navigator.appVersion) >= 4 ) {
		xposition = (screen.width - width) / 2;
		yposition = (screen.height - height) / 2;}

	args = "width=" + width + ","
	+ "height=" + height + ","
	+ "location=0," 
	+ "menubar=0,"
	+ "resizable=1,"
	+ "scrollbars=1,"
	+ "status=1," 
	+ "titlebar=1,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	+ "screenx=" + xposition + ","  //NN Only
	+ "screeny=" + yposition + ","  //NN Only
	+ "left=" + xposition + ","     //IE Only
	+ "top=" + yposition;           //IE Only
	
	window.open(url,'popup',args );
}

function loadFlash(flash, fl_width, fl_height, flashvars) {
		// we have to use this to auto-activate flash activeX controls in IE, instead of the user having to click to activate first.
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
		document.write('width="' + fl_width + '" height="' + fl_height + '" id="flashItem" align="middle">');
		document.write('<param name="FlashVars" value="' + flashvars + '" />');					
		document.write('<param name="movie" value="' + flash + '" />');
		document.write('<param name="quality" value="high" />');
		document.write('<param name="bgcolor" value="#F7F7F7" />');
		document.write('<param name="scale" value="noscale" />');
		document.write('<param name="wmode" value="transparent" />');
		document.write('<embed src="' + flash + '" quality="high"');
		document.write('FlashVars="' + flashvars + '"');
		document.write('bgcolor="#F7F7F7"'); 
		document.write('scale="noscale"');
		document.write('width="' + fl_width + '"'); 
		document.write('height="' + fl_height + '"'); 
		document.write('wmode="transparent"');
		document.write('type="application/x-shockwave-flash"'); 
		document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
		
}