


function highlight(id,colour)
{
	var t = document.getElementById(id)
	if (t)
	{	
		t.style.backgroundColor=colour;
	}
}
function lowlight(id,colour)
{
	var t = document.getElementById(id)
	if (t)
	{
		t.style.backgroundColor=colour;
	}
}

function shrinkthis(targetid,currentheight)
{
}
function growthis(targetid,currentheight)
{
}


var cangrow=true;
var useragent = navigator.userAgent.toLowerCase();
var ie = ((useragent.indexOf('msie') != -1) );

if (!ie)
{
//add support for element.contains to mozilla browsers
HTMLElement.prototype.contains = function(element) 
{
    if (element == document) return false;
    
    if (element == this) return true;
    else return this.contains(element.parentNode);
}

}
function submitthis(btn,e)
{
try
{
	if (e.which==13)
	{
		e.returnValue=false;

		btn.click();

	}
	else
	{
		if (e.keyCode==13)
		{
			e.returnValue=false;
	
			btn.click();

		}
	}
}
catch (err)
{
e.returnValue=false;
}
}
function submitthisbyid(id,e)
{
var t = document.getElementById(id);
if (t)
{
if (e.which==13)
	{
		e.returnValue=false;

		t.click();

	}
	else
	{
		if (e.keyCode==13)
		{
			e.returnValue=false;
	
			t.click();

		}
	}
}

}

function isinbound(eventtype)
{
switch (eventtype)
{
case "mouseover":return true;break;
case "mouseout":return false;break;
case "click":return false;break;
}
}

function eventsource(e)
{

if (ie)
{
return e.fromElement;
}
else
{
if (e.type=="click")
		{
		return e.currentTarget;
		}
	else
	{ if (isinbound(e.type))
	{
		return e.relatedTarget;
	}
	else
	{
		
		return e.target;
		}
	}
}

}
function eventtarget(e)
{
if (ie)
{
return e.toElement;
}
else
{
	if (isinbound(e.type))
	{
		return e.target;
	}
	else
	{
		if (e.type=="click")
		{
		return e.currentTarget;
		}
		else
		{
		return e.relatedTarget;
		}
	}
}
}

function nobubble (e)
{
if (ie)
{
e.cancelBubble=true;
}
else
{
//e.stopPropogation=true;
}
}
function initMenu(id)
{

	
}
function newtoggle (id,e)
{
	var t = document.getElementById(id);
	if (t)
	{
		if (t.style.display=="none")
		{
			t.style.display="block";
		}
		else
		{
			t.style.display="none";
		}
	}
}
function clearinput(n)
{
	if (n.value==n.defaultValue)
	{
		n.value="";
	}
}
function toggle(id, e)
{
var intervalstep=0;
var heightstep=2;
	var t = document.getElementById(id)
	
	if (t)
	{
	//alert (id);
	nobubble(e);
	
		if (t.style.display=="none")
		{
					
			//if (!t.parentNode.contains(eventsource(e)))
			//{
				t.style.display="block";
			//}
			
		}
		else
		{
		
			if (!t.parentNode.contains(eventtarget(e))||e.type=="click")
			{
			//alert (e.type+" displaying none");
					t.style.display="none"
				
			}
		}
	}
	return false;
}

function toggleoff(id, parentid, e)
{
	var t = document.getElementById(id)
	var element = document.getElementById(parentid)
	if (t&&element)
	{
	try
	{
	
	if (!element.contains(eventtarget(e)))
		{
		
			if (t.style.display=="block")
			{
				t.style.display="none";
			}
		}
		}
		catch(exc)
		{}
	}
	
	
	return false;
}
function flashenabled()
{
var plugin=0;
var activeX=0;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])?navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin!=0)
{
var plugdesc = plugin.description+"";
plugin=parseInt(plugdesc.substring(plugdesc.indexOf(".")-1)) >=8;
//alert (plugdesc.substring(plugdesc.indexOf(".")-1));
}
else
{
	if (ie&&!plugin)
	{
		var flashenabled=flashenabledie();
		if (flashenabled)
		{
		//	alert ("flash is enabled");
			plugin=true;
		}
		else
		{
			plugin=false;
		}
	}
}
if (plugin==false)
{
return false;
}
else
{

return true;
}
}


	

