function checkSection(){
	var submitSection;
	var submitForm;

	submitSection = document.getElementById("userPageID");
	submitSection.style.backgroundColor = "white";
	//submitSection.style.color = "black";
	submitForm = document.getElementById("submitForm");
	if (submitSection.value != "none"){
		submitForm.submit();
		return true;
	}
	submitSection.style.backgroundColor = "#f58a32";
	//submitSection.style.color = "white";
	window.setTimeout(function(){submitSection.style.backgroundColor = "white";}, 500);
	return false;
}

//=================================================================================================
function shareUserPage(){
	document.location = "mailto:?subject=You've got to see this&body=" + urlUserPage;
}


//=================================================================================================
function searchUserPage(){
	var searchText;

	channelName = window.channelName;
	urlPortal = window.URLportal;

	var inputName = "InputSearch";
	var searchText = document.getElementById(inputName).value;
	var searchTextInput = document.getElementById(inputName);

	if (searchText.length <= 0) {
		searchTextInput.style.backgroundColor = "#f58a32";
		window.setTimeout(function(){searchTextInput.style.backgroundColor = "white";}, 500);
	} else {
		searchText = createSearchString(inputName);
		url = urlUserPage + "/search/" + searchText;
		document.location = url;
		//alert(url);
	}

	return false;
}


//=================================================================================================
function createSearchString(searchInput){
	var searchText = document.getElementById(searchInput).value;
	//alert("search text " + searchText);
	//alert("escaped " + escape(searchText));
	//alert("utf-8 " + escape_utf8(searchText));

	var string = new String('');
	var strLen = searchText.length;
	var field = "[A-Za-z0-9~]";
	var lastchar = false;

	for (var ii = 0; ii < strLen; ii++){
		if (searchText.charCodeAt(ii) > 192){
			string += searchText.charAt(ii);
			lastchar = true;
		}
		else{
			var tmpStr = new String(searchText.charAt(ii));
			if (tmpStr.match(field)){
				string += tmpStr;
				lastchar = true;
			}
			else{
				if ((ii < strLen-1) && lastchar){
					string += "_";
					lastchar = false;
				}
			}
		}
	}
//	alert("result: " + string);
	return string;

}

//=================================================================================================
function toggleObj(id)
{
    var el = document.getElementById(id);
    el.style.display = el.style.display == "block" ? "none" : "block";
}