// JavaScript Document



function ylib_Browser()
{
	d=document;
	this.agt=navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.dom=(d.getElementById)?1:0;
	this.ns=(d.layers);
	this.ns4up=(this.ns && this.major >=4);
	this.ns6=(this.dom&&navigator.appName=="Netscape");
	this.op=(window.opera? 1:0);
	this.ie=(d.all);
	this.ie4=(d.all&&!this.dom)?1:0;
	this.ie4up=(this.ie && this.major >= 4);
	this.ie5=(d.all&&this.dom);
	this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1));
	this.mac=(this.agt.indexOf("mac")!=-1);
};

var oBw = new ylib_Browser();
var g_oButtonMenu;
var picTimer;


function Mark_Click(p_oSender,p_oEvent,s_origbutton, updatepic)
	{
		
		
		if(document.all) p_oEvent.cancelBubble = true;
		else p_oEvent.stopPropagation();

		if(typeof g_oButtonMenu != 'undefined' && g_oButtonMenu && g_oButtonMenu.id != "markoptions") g_oButtonMenu.style.visibility = "hidden";
					
		g_oButtonMenu = ylib_getObj(s_origbutton);



		var x = ylib_getPageX(p_oSender);
		var y = ylib_getPageY(p_oSender);
		var h = ylib_getH(p_oSender);
		
		
		
		ylib_moveTo(g_oButtonMenu,x,y+h+2);
	
		g_oButtonMenu.style.visibility = "visible";
		//document['imgMain'].src = "img/" + s_origbutton + ".gif"
		
		if (updatepic)
			flvFSTI1('imgMain', "img/" + s_origbutton + ".gif",0,0,0.5,1)
		


	
	}

	function reporter(txt)
	{
		//document.getElementById("ta").value = txt + "\n" + document.getElementById("ta").value;
	}
	

	function resetPic(imgFileName)
	{
		
		//document['imgMain'].src = "img/" + imgFileName
		flvFSTI1('imgMain', "img/" + imgFileName,0,0,0.5,1);

	}

	function imgSwap(imgName, e)
	{
		if(document.all) e.cancelBubble = true;
		else e.stopPropagation();
		closeAllMenus();
		clearTimeout(picTimer);
		
		//document['imgMain'].src = "img/" + imgName + ".gif"
		flvFSTI1('imgMain', "img/" + imgName,0,0,0.5,1)	
	}

	function closeAllMenus()
	{
		//reporter("settimer-all");
		for (var i=0; i<theMenus.length;i++)
		{
			clearTimeout(theMenus[i].timerVal);
			theMenus[i].timerVal = SetCloseTimer(theMenus[i].menName, i)
			//reporter("--time-" +theMenus[i].menName+ "(" + theMenus[i].timerVal + ")" )
		}
		
		
		SetPicTimer();
	}
	
	function closeAllMenusx()
	{
		//reporter("settimer-all");
		for (var i=0; i<theMenus.length;i++)
		{
			clearTimeout(theMenus[i].timerVal);
			theMenus[i].timerVal = SetCloseTimer(theMenus[i].menName, i)
			//reporter("--time-" +theMenus[i].menName+ "(" + theMenus[i].timerVal + ")" )
		}
	}

	function closeOtherMenusAndCancelBubbling(e)
	{
	
	
		e.cancelBubble = true;
		if (e.stopPropagation) e.stopPropagation();
		
		
		var elName = "";
	
		if (e.srcElement)
			elName = e.srcElement.id;
		else
			elName = e.target.id;
		
		var menuRef;
		var blnFound = false;

		
		if (elName != "")
		{
			for (var i=0; i<theMenus.length;i++)
			{
				if (theMenus[i].menName==elName || theMenus[i].menLink==elName)
				{
					
					menuRef = i;
					blnFound = true;
					if (theMenus[i].menLink==elName)
					{

						
						Mark_Click(document.getElementById(elName),e,theMenus[menuRef].menName,theMenus[menuRef].timerVal, true);
						
					}
					continue;
					
				}
			}
	
			
			//reporter("cantimer-" + theMenus[menuRef].menName + "(" + theMenus[menuRef].timerVal + ")");
			ResetTimer(theMenus[menuRef].timerVal);
			

			for (var i=0; i<theMenus.length;i++)
			{
				if (i != menuRef)
				{
				clearTimeout(theMenus[i].timerVal);
				theMenus[i].timerVal = SetCloseTimer(theMenus[i].menName, i)
				}
			}
		}
		

	}


	function closeOtherMenusAndCancelBubblingx(e)
	{
	
	
		e.cancelBubble = true;
		if (e.stopPropagation) e.stopPropagation();
		
		
		var elName = "";
	
		if (e.srcElement)
			elName = e.srcElement.id;
		else
			elName = e.target.id;
		
		var menuRef;
		var blnFound = false;

		
		if (elName != "")
		{
			for (var i=0; i<theMenus.length;i++)
			{
				if (theMenus[i].menName==elName || theMenus[i].menLink==elName)
				{
					
					menuRef = i;
					blnFound = true;
					if (theMenus[i].menLink==elName)
					{

						
						Mark_Click(document.getElementById(elName),e,theMenus[menuRef].menName,theMenus[menuRef].timerVal, false);
						
					}
					continue;
					
				}
			}
	
			
			//reporter("cantimer-" + theMenus[menuRef].menName + "(" + theMenus[menuRef].timerVal + ")");
			ResetTimer(theMenus[menuRef].timerVal);
			

			for (var i=0; i<theMenus.length;i++)
			{
				if (i != menuRef)
				{
				clearTimeout(theMenus[i].timerVal);
				theMenus[i].timerVal = SetCloseTimer(theMenus[i].menName, i)
				}
			}
		}
		

	}
	
	function SetCloseTimer(menuDivName, i)
	{
		//
		var timerVar = setTimeout('HideDiv("' + menuDivName + '",' + i + ')',200);
		//reporter("settimer("+timerVar+")");
		return timerVar;
	}
	
	function SetPicTimer()
	{
		clearTimeout(picTimer);
		picTimer = setTimeout('resetPic("about1.jpg")',200);
	}
	
	function HideDiv(menuDivName, i)
	{
		//reporter("close-" + menuDivName + "(" + theMenus[i].timerVal + ")");
		document.getElementById(menuDivName).style.visibility = "hidden";
	}

	function ResetTimer(timerVar)
	{
		//alert(timerVar);
		clearTimeout(timerVar);
		clearTimeout(picTimer);
	}



	
	
function ylib_getPageX(o) { if(oBw.ns) { var x=(o.pageX)? o.pageX:o.x; return x; } else if (oBw.op) {  var x=0; while(eval(o)) { x+=o.style.pixelLeft; o=o.offsetParent; } return x; } else { var x=0; while(eval(o)) { x+=o.offsetLeft; o=o.offsetParent; } return x; } }
function ylib_getH(o) { var h=0; if (oBw.ns) { h=(o.height)? o.height:o.clip.height; return h; } h=(oBw.op)? o.style.pixelHeight:o.offsetHeight; return h; }
function ylib_getPageY(o) { if(oBw.ns) { var y=(o.pageY)? o.pageY:o.y; return y; } else if (oBw.op) {  var y=0; while(eval(o)) { y+=o.style.pixelTop; o=o.offsetParent; } return y; }  else { var y=0; while(eval(o)) { y+=o.offsetTop; o=o.offsetParent; } return y; } }
function ylib_moveTo(o,x,y) {
	ylib_setX(o,x);
	ylib_setY(o,y); 
	}
function ylib_setX(o,x) { o.style.left=x+'px'; };
function ylib_setY(o,y) { o.style.top=(y-1) + 'px'; };


function ylib_getObj(id,d) {

  var i,x;  if(!d) d=document; 
  if(!(x=d[id])&&d.all) x=d.all[id]; 
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][id];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=ylib_getObj(id,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(id); 
  return x;
}


function flvFSTI1()
{//v1.01
	var v1=arguments,v2=document,v3;
	v2.STI4=new Array();
	v2.STI7=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);
	for (var v4=0;v4<v1.length-2;v4+=5)
	{
		v3=MM_findObj(v1[v4]);
		if (v3)
		{
			v3.STI5=v3.src;
			v3.STI6=v1[v4+1];
			v3.STI2=v1[v4+2];
			v3.STI3=v1[v4+3];
			v3.STI8=v1[v4+4];
			v2.STI4[v2.STI4.length]=v3;
			if (v3.filters&&!v2.STI7)
			{
				flvFSTI3(v3,v3.STI2);
				v3.onfilterchange=flvFSTI4;
				v3.filters[0].Apply();
			}
			v3.src=v3.STI6;
			if (v3.filters&&!v2.STI7)
			{
				v3.filters[0].Play();
			}
		}
	}
}

function flvFSTI4(){//v1.01
this.style.filter="";}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function flvFSTI3(v1,v2){//v1.01
var v3;if (v1.filters[0]&&v1.filters[0].status==2){v1.filters[0].Stop();}if (v2==0){v3="blendTrans(Duration="+v1.STI8+")";}else {v3="revealTrans(Duration="+v1.STI8+",Transition="+(v2-1)+")";}v1.style.filter=v3;}