// checks if parameter is a string for id of element or is element 
// and returns the element or null if none
function getElement(el)
{
	if(typeof(el) == "string")
		el = document.getElementById(el);
	
	if(typeof(el) == "object")
		return el;
	else
		return null;
}


function embedFlash(target, id, width, height, src)
{
	var object = "<object ";
	object += "id=\"" + id + "\" ";
	object += "type=\"application/x-shockwave-flash\" ";
	object += "width=\"" + width + "\" ";
	object += "height=\"" + height + "\" ";
	object += "data=\"" + src + "\" ";
	object += ">";
	
	// for IE
	var params = "";
	params += "<param value=\"" + src + "\" name=\"movie\" />";
	params += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
	params += "<param name=\"quality\" value=\"high\" />";
	
	object += params;
	
	object += "</object>";
	
	document.getElementById(target).innerHTML = object;
}

// returns the absolute top position of element
function absOffsetTop(el)
{
	var top = 0;
	
	if(el)
	{
		top += el.offsetTop;
		top += absOffsetTop(el.offsetParent);
	}
	
	return top;
}
// returns the absolute left position of element
function absOffsetLeft(el)
{
	var left = 0;
	
	if(el)
	{
		left += el.offsetLeft;
		left += absOffsetLeft(el.offsetParent);
	}

	return left;
}


function getClientWidth() {
	var width;
	
	if(document.innerWidth)
		width = document.innerWidth;
	else if(document.documentElement.clientWidth)
		width = document.documentElement.clientWidth;
	else if(document.body)
		width = document.body.clientWidth;
		
	return width;
}
function getClientHeight() {
	var height;
	
	if(document.innerHeight)
		height = document.innerHeight;
	else if(document.documentElement.clientHeight)
		height = document.documentElement.clientHeight;
	else if(document.body)
		height = document.body.clientHeight;
	
	return height;
}