function showFlash(fileName, width, height, flashvars) {	
	var text;
	text = "";
	
	if ((null == flashvars)||(flashvars == "")) {
		paramflashvars = "";
		embedflashvars = "";
	} else {
		paramflashvars = "<param value=\"" + flashvars + "\" name=\"flashvars\" />";
		embedflashvars = " flashvars=\"" + flashvars + "\"";
	}
	 
	text +="<object height=\"" + height + "\" width=\"" + width + "\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\">";
	text +="<param value=\"" + fileName + "\" name=\"movie\" />";
	text +="<param value=\"high\" name=\"quality\" />";
	text += paramflashvars;
	text += "<embed pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" name=\"movie\" quality=\"high\" height=\"" + height + "\" width=\"" + width + "\" src=\"" + fileName + "\"" + embedflashvars + "></embed></object>";
	document.write(text);
}

function toggleEventDisplay(el)
{
	var children = el.childNodes;
	toggleElementSize(children[1]);
	toggleElementDisplay(children[2]);
	/*alert(el.childNodes[3].className);
	var output;
	var i;
	for(i=0;i<10;i++){
		output += i+" "+children[i]+"\n";
	}
	alert(output);*/
}

function toggleElementDisplay(el)
{
	el.style.display = (el.style.display != 'none' ? 'none' : '' );
}

function toggleElementSize(el)
{
	el.style.fontSize = (el.style.fontSize != '16px' ? '16px' : '' );
}

// makeLayer(ID,left,top,width,height,color,visible,zIndex,additionalStyle,innerHTML, removeOnClick)

function makeLayer(id,L,T,W,H,bgColor,visible,zIndex,additionalStyle,iHTML, ronc) {
 if (document.getElementById) {
  if (document.getElementById(id)) {
   //alert ('Layer with this ID already exists!')
   //return
	document.body.removeChild(document.getElementById(id));
  }

  var ST= 'position:absolute'
  +'; left:'+L
  +'; top:'+T
  +'; width:'+W
  +'; height:'+H
  //+'; clip:rect(0,'+W+','+H+',0)'
  +'; visibility:'+(null==visible || 1==visible ? 'visible':'hidden')
  +(null==zIndex  ? '' : '; z-index:'+zIndex)
  +(null==bgColor ? '' : '; background-color:'+bgColor)
  +'; ' + additionalStyle;

  var oncl = ronc==1 ? 'document.body.removeChild(this)' : 'false';

  var LR= '<DIV id='+id+' style="'+ST+'" onclick='+oncl+'>'+iHTML+'</DIV>'

  if (document.body) {
   if (document.body.insertAdjacentHTML) document.body.insertAdjacentHTML("BeforeEnd",LR);
   else if (document.createElement && document.body.appendChild) {
    var newNode = document.createElement('div');
    newNode.setAttribute('id',id);
    newNode.setAttribute('style',ST);
    newNode.setAttribute('onclick',oncl);
    newNode.innerHTML = iHTML;
    document.body.appendChild(newNode);
   }
  }
 }
}

function findPos(obj) {
	var curleft = curtop = 0;
		if (obj.offsetParent) {
			do {
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);
		}
	return [curleft,curtop];
}

function makeAndShowEvent(obj) {
	var children = obj.childNodes;
	var pos = findPos(obj);
	var additionalStyle = 'border: solid 1px #CCC; overflow: auto;padding:3px;';
	// makeLayer(ID,left,top,width,height,color,visible,zIndex,additionalStyle,innerHTML,removeOnClick)
	makeLayer('showEvent', pos[0]-280, pos[1]-280, 300, 300, 'white', 1,100,additionalStyle,children[2].innerHTML,1);
}

