function isEmpty(formElement, message) {
	formElement.value = trim(formElement.value);
	
	_isEmpty = false;
	if (formElement.value == '') {
		_isEmpty = true;
		alert(message);
		formElement.focus();
	}
	
	return _isEmpty;
}


function trim(str)
{
	return str.replace(/^\s+|\s+$/g,'');
}


function setSelectedItem(ctrl,value)
{
		for (i=0;i<ctrl.length;i++)
		{
			if (ctrl.options[i].value == value)
			{
				ctrl.options.selectedIndex = i;
			}
		}
}

var pageName = document.title;

var urlAddress = window.location.href;

function addtofavorites() 
{ 

	if (window.external) 
	{ 
	
		if (window.sidebar) { // Mozilla Firefox Bookmark		
			window.sidebar.addPanel(pageName, urlAddress,"");
		} 
		else if( window.external ) 
		{ // IE Favorite		
			window.external.AddFavorite( urlAddress, pageName); 
		}	
		else if(window.opera && window.print) 
		{ // Opera Hotlist		
			return true; 
		}		
	} 
	else 
	{ 
		alert("Sorry! Your browser doesn't support this function."); 
	} 
}