function clearTB(element)
{
	if (element.type== "text") //If the element is a textbox
	{
		if(element.value == element.defaultValue) //If the textbox contains its default value
		{
			element.value = ""; //Clear the textbox
		}
	}
	else if (element.type == "textarea") //If the element is a textarea
	{
		if(element.innerHTML == element.defaultValue) //If the textarea contains its default value
		{
			element.innerHTML = ""; //Clear the textarea
		}
	}
}

function highlight(item,highlight)
{
	var highlightClassName = "highlight"; //Define the CSS class name for the highlight style
	
	if(highlight == true) //If highlight is set to true
	{
		item.className = highlightClassName; //Highlight the item
	}
	else //If highlight is false or isnt set
	{
		item.className = ""; //Clear the highlight style
	}
}

function popup(elementID)
{
	if (document.getElementById(elementID).style.display == "block") //If the element is showing
	{
		document.getElementById(elementID).style.display = "none"; //Hide the element
	}
	else //If the element isnt showing
	{
		document.getElementById(elementID).style.display = "block"; //Show the element
		
		//Set horizontal and vertical position
		document.getElementById(elementID).style.top = document.body.scrollTop; //Set the top position of the element
		document.getElementById(elementID).style.marginLeft = -document.getElementById(elementID).offsetWidth/2; //Set the left margin of the element
	}				
}

//Confirm then submit
function checkSubmit(msgtxt)
{
	show_confirm = confirm(msgtxt);
	if(show_confirm == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}