this.showMenu = function(menuName)
    {
        this.alpha = 0.0;
        this.beta = 1.0;

        this.menu = document.getElementById(menuName);
	
        if(this.menu.style.display == "none" || this.menu.style.display == "")
        {
            this.fadeIn();
        }
        //		else
        //		{
        //			this.fadeOut();
        //		}
	
        if(this.menuName == this.menu) this.menuName = undefined;
        if(this.menuName != undefined) this.menuName.style.display = "none";
	
        this.menuName = this.menu;
    }

this.hideMenu = function(menuName)
{
    this.alpha = 0.0;
    this.beta = 1.0;

    this.menu = document.getElementById(menuName);

    if(this.menu.style.display == "none" || this.menu.style.display == "")
    {
        this.fadeIn();
    }
    else
    {
        this.fadeOut();
    }

    if(this.menuName == this.menu) this.menuName = undefined;
    if(this.menuName != undefined) this.menuName.style.display = "none";

    this.menuName = this.menu;
}

this.fadeIn = function()
{
    this.menu.style.opacity = this.alpha;
    this.menu.style.filter  = "alpha(opacity=" + this.alpha * 100 + ")";
    this.menu.style.display = "block";
    this.alpha += 0.1;
	
    if(this.alpha < 1.0)
    {
        setTimeout("fadeIn()", "20");
    }
}

this.fadeOut = function()
{
    this.menuName.style.opacity = this.beta;
    this.menuName.style.filter  = "alpha(opacity=" + this.beta * 100 + ")";
    this.beta -= 0.1;
	
    if(this.beta > 0.0)
    {
        setTimeout("fadeOut()", "20");
    }
    else
    {
        this.menuName.style.display = "none";
    }
}

this.addPollItem = function(parent)
{
    var pis = document.getElementById('poll_items')
    var key = pis.childNodes.length;
	
    var div = document.createElement("DIV");
	
    var name = document.createElement("input");
    name.type = "text";
    name.name = "data[PollItem]["+key+"][name]";
    name.id = "PollItem"+key+"Name";
    name.size = "30";
    name.maxlength = "255";
		
    var label = document.createElement("label");
    label.htmlFor = name.id;
    label.innerText = (key+1)+". ";
    label.textContent = (key+1)+". ";
    label.style.float = "left";
	
    div.appendChild(label);
    div.appendChild(name);
	
    if(parent != undefined)
    {
        var poll_id = document.createElement("input");
        poll_id.setAttribute("type", "hidden");
        poll_id.name = "data[PollItem]["+key+"][poll_id]";
        poll_id.value = parent;
        poll_id.id = "PollItem"+key+"PollId";
        div.appendChild(poll_id);
    }
	
    pis.appendChild(div);
}

this.removePollItem = function()
{
    var pis = document.getElementById('poll_items')
    pis.removeChild(pis.lastChild);
}

this.calendarDay = function(day)
{
    var div = document.createElement("DIV");
    div.style.width = "100px";
    div.style.height = "100px";
    div.style.border = "1px dashed #FFFFFF;";
    div.style.color = "#ABCCBA";
    div.style.position = "absolute";
    div.style.left = "50px";
    div.style.top = "50px";
		
    document.getElementById("calendar").appendChild(div);
}