function toggleBlindHighlight(hideId, highlightId)  
{
	$(hideId).style.display = 'none';
	$(highlightId).style.display = 'block';		
	new Effect.Highlight(highlightId, {startcolor: '#CEE2DC', endingcolor: '#FFFFFF'});
	return false;
}
function checkScreen()
{
	
}
function validateMail()
{
	var rs = true;
	if(isEmpty($('name')))
	{
		$('nameError').style.display = 'block';
		rs=false;
	}
	else
	{
		$('nameError').style.display = 'none';		
	}
	if(isEmpty($('email')) || !isEmail($('email')) )
	{
		$('emailError').style.display = 'block';
		rs=false;
	}
	else
	{
		$('emailError').style.display = 'none';		
	}
	if(isEmpty($('message')))
	{
		$('messageError').style.display = 'block';
		rs=false;
	}
	else
	{
		$('messageError').style.display = 'none';		
	}
	return rs;
}
function isEmpty(v)
{
	return  ((v.value == null) || (v.value.length == 0));	
}
function isEmail(v)
{
	var str = v.value;
	if (!(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(str)))
	   return false;
	if (str.match(/[\(\)\<\>\,\;\:\\\/\"\[\]]/)) 
	   return false;
	
	return true;
}
function checkUsername(sourceId, url, targetId, len)
{
	val = sourceId.value;
	
	if(sourceId.value.length > len) {
		url = url + "/" + val;
		$(targetId).style.display = 'block';
		$(targetId).innerHTML= loadingImage;	
		new Ajax.Updater(targetId, url, {
					evalScripts: true
		});
	}
}
String.prototype.isNumeric = function() {
  return parseFloat(this) + '' == parseFloat(this);
};
function validateInput(input, len, target)
{
	var tin = input.value;
	if(input.value.length >= len){
		if(tin.isNumeric())
		{
			$(target).focus();
		}else{
			alert('Please enter a number.');   
		}
	}
}
