function stripHTML (str) {
	var re= /<\S[^><]*>/g
	return str.replace(re, "");
}

function enableHints() {
	$('.hint').attr('value', function() {
		if (this.value == "") {
			$(this).css({ 'color' : '#808080' });
		}
		else {
			$(this).css({ 'color' : '#000000' });			
		}
		return (this.value == '' ? this.title : this.value);
	});
 
	$('.hint').blur(function() {
		$(this).attr('value', function() {
			return (this.value == '' ? this.title : this.value);
		});
		if (this.value == this.title) {
			$(this).css({ 'color' : '#808080' });
		}
		else {
			$(this).css({ 'color' : '#000000' });			
		}
	});
 
	$('.hint').focus(function() {
		$(this).attr('value', function() {
			return (this.value == this.title ? '' : this.value);
		});
		$(this).css({ 'color' : '#000000' });			
	});
}

function clearHints() {
	$('.hint').attr('value', function() {
		return (this.value == this.title ? "" : this.value);								  
	});
}

function hightlight(element) {
	element.style.backgroundColor='#ffffff';
}

function lowlight(element) {
	element.style.backgroundColor='transparent'
}

function Trim(s)
{
	return rTrim(lTrim(s));
}

function lTrim(s)
{
	var l=0;
	while(l < s.length && s[l] == ' ')
	{	l++; }
	return s.substring(l, s.length);
}

function rTrim(s)
{
	var r=s.length -1;
	while(r > 0 && s[r] == ' ')
	{	r-=1;	}
	return s.substring(0, r+1);
}

