function addFavorites(msg_NO_FAVORITE_ADD)
{		
	var itemTitle = elemById("itemTitle");
	var itemType = elemById("itemType");
	
	if (!userID)
	{
		var ok = confirm(msg_MUST_LOGIN);
		if(ok ==true)
		{
			var af = elemById("form_add_favorite");
			af.action = strLinkLogin + "&ref=" + escape(String(document.location.toString().split("?")[1]));
			af.submit();
			//window.location = strLinkLogin;
		}
		return false;
	}
	
	if (!itemTitle) 
	{
		alert(msg_NO_FAVORITE_ADD);	
		return false;
	}
		
	var url = new String(window.location);
	
	var fr = window.document.createElement("div");
	fr.id ="add_favorite";
	
	/*fr.onclick = function ()
	{
		removeNode(this);
	};*/
	
	/*elemById("right_contentblock").appendChild(fr);
	
	var img = window.document.createElement("img");
	img.src = "../gfx/indicator.white.gif";
	img.border = "0";
	elemById("add_favorite").appendChild(img);	

	var child1 = window.document.createElement("div");
	child1.innerHTML = msg_FAVORITE_ON_EXEC;
	elemById("add_favorite").appendChild(child1);	*/
	
	//and start ajax now.....
	var strTitle = new String();
	strTitle = itemTitle.value;
	//alert(unescape(strTitle))
	//strTitle = strTitle.replace(/ /gi,"||");
	
	var strUrl = new String();
	strUrl = url;
	strUrl = strUrl.replace(/\&/gi,"||");
	
	var params="user_id="+userID+"&item_type="+escape(itemType.value)+"&item_title="+escape(strTitle)+"&url="+strUrl;
	var url = "procedures/saveform_favorite.asp";
	//return 0;
	postvalues(url, params, addfavorite_callback)
	return true;
	
}

function addfavorite_callback(text){
	alert(text)
	var add_favorite = elemById("add_favorite");
	
	if(add_favorite)
	{
		removeNode(add_favorite);
		return true;
	}
	var	dv_button_favorite = elemById("dv_button_favorite")
	if(dv_button_favorite)
	{
		removeNode(dv_button_favorite)
	}

}
function remove_block_msg(text)
{
	alert(text)

	var add_favorite = elemById("add_favorite");
	if(add_favorite)
	{
		removeNode(add_favorite);
		//return true;
	}
	else
	{
		return false;
	}
}
