﻿
function CreateUserActionList(id, userid, nick)
{
	document.getElementById(id).innerHTML = RenderUserActionList(id, userid, nick);
	document.getElementById(id).style.visibility='visible';
}

function ShowUserActionList(id)
{
	document.getElementById(id).style.visibility='visible';
}

function HideUserActionList(id)
{
	document.getElementById(id).style.visibility='hidden';
}

function RenderUserActionList(id, userid, nick)
{
	var content = "";
	
	content += RenderActionListHeader(id, nick);
	
	if(getcrypt() != "")
	{
		content += RenderActionListItem("zur Homepage", "/community/images/icon_home.gif", "/community/usersite/templates/usersite.asp?userid=" + userid + "&crypt=" + getcrypt());
		content += RenderActionListItem("Clubmessage schreiben", "/community/images/icon_message.gif", "/community/usersite/templates/usersite_message.asp?userid=" + userid + "&crypt=" + getcrypt());
		content += RenderActionListItem("Freundschaft anfragen", "/community/images/icon_friend.gif", "/community/usersite/templates/usersite_friendshiprequest.asp?userid=" + userid + "&crypt=" + getcrypt());
		content += RenderActionListItem("Weiterempfehlen", "/community/images/icon_recommend.gif", "/community/usersite/templates/usersite_recommendation.asp?moduleid=5&userid=" + userid + "&crypt=" + getcrypt());
		content += RenderActionListItem("zur Merkliste hinzufügen", "/community/images/icon_favourite.gif", "/community/usersite/templates/usersite_favorites.asp?userid=" + userid + "&crypt=" + getcrypt());
		content += RenderActionListItem("Gästebucheintrag schreiben", "/community/images/icon_guestbook.gif", "/community/usersite/templates/usersite_guestbook.asp?modul=1&userid=" + userid + "&crypt=" + getcrypt());
	}
	else
	{
		content += RenderActionListItem("zur Homepage", "/community/images/icon_home.gif", "/community/usersite/templates/usersite.asp?userid=" + userid + "&crypt=" + getcrypt());
		content += RenderActionListItem("Weiterempfehlen", "/community/images/icon_recommend.gif", "/community/usersite/templates/usersite_recommendation.asp?moduleid=5&userid=" + userid + "&crypt=" + getcrypt());
		content += "<div style=\"float:left; padding:5px;\"><b>Um weitere Aktionen auszufügen müssen Sie sich <a href=\"javascript:InitalizeLogin();\" style='font-size:11px;color:#000000;font-family:Verdana,Arial,Sans-Serif;'><b>einloggen</b></a>.</b></div><div style=\"clear:both;\"></div>"
	}
	
	content += RenderActionListFooter();
	
	return content;
}

function RenderActionListItem(text, image, url)
{
	return "<div style=\"float:left; padding:5px; \"><img src='" + image + "' border='0'></div><div style=\"float:left; padding-top:7px;\"><a href='" + url + "' target='_blank' style='font-size:11px;font-weight:normal;color:#000000;font-family:Verdana,Arial,Sans-Serif;'>" + text + "</a></div><div style=\"clear:both;\"></div>";
}

function RenderActionListHeader(id, text)
{
	return "<div style=\"border: solid 1px; border-color: #000000; font-family:Verdana,Arial,Sans-Serif; background-color:#ffffff; color:#000000; text-align:left; width:200px; font-size:11px;\" onmouseover=\"ShowUserActionList('" + id + "')\" onmouseout=\"HideUserActionList('" + id + "')\"><div style=\"padding:5px;color:#000000;font-family:Verdana,Arial,Sans-Serif;\"><b>" + text + "</b></div>";
}

function RenderActionListFooter()
{
	return "</div>";
}