// add a new function
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function')
	{
		window.onload = func;
	}
	else
	{
		window.onload = function()
		{
			oldonload();
			func();
		}
	}
}

// plug html markup into document
function insertAfter(newElement, targetElement)
{
	var parent = targetElement.parentNode;
	if(parent.lastChild == targetElement)
	{
		parent.appendChild(newElement);
	}
	else
	{
		parent.insertBefore(newElement,targetElement.nextSibling);
	}
}

// make a new class, useful for css
function addClass(element,value) 
{
	if (!element.className) 
	{
		element.className = value;
	}
	else 
	{
		newClassName = element.className;
		newClassName+= " ";
		newClassName+= value;
		element.className = newClassName;
	}
}