﻿function ClearValue(oElem) {
	var oItem = document.getElementById(oElem);

	if (((trim(oItem.value) == 'Name') || (trim(oItem.value) == 'E-mail')) || (trim(oItem.value) == ''))
		oItem.value = '';
}

function OnBlurValue(oElem) {
	var oItem = document.getElementById(oElem);

	var oValue = "";

	if (oElem == 'ctl00_plcRight_ucNewsletter_txtName') oValue = " Name"; if (oElem == 'ctl00_plcRight_ucNewsletter_txtEmail') oValue = " E-mail";

	if (trim(oItem.value) == '')
		oItem.value = oValue;
}

function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}