function addNewsLink ()
{
   	text 	= document.getElementById("new_link_name").value + ' --- ' + document.getElementById("new_link_url").value;
	count 	= document.getElementById("news_links").length;
	newop	= new Option(text);
    document.getElementById("news_links").options[count] = newop;

    document.getElementById("new_link_name").value = '';
    document.getElementById("new_link_url").value = '';

    document.getElementById("news_links").selectedIndex = -1;
	document.getElementById("new_link_name").focus;

    saveNewsLinks();
}

function deleteNewsLink()
{
	index = document.getElementById("news_links").selectedIndex;
	if (index != -1)
	{
		document.getElementById("news_links").options[index] = null;
	}
    saveNewsLinks();
}

function saveNewsLinks()
{
	links = '';
    count = document.getElementById("news_links").length;
	for (x = 0; x < count; x++)
	{
		text = document.getElementById("news_links").options[x].text;
		links = links + text + 'trennzeichen';
	}
    document.getElementById("news_links_save").value = links;
}

function ConfirmAction(text,url)
{
        var x = confirm(text);
         if (x == true)
         {
                 window.location.href = document.getElementById('httpbase').href + url;
         }
}


function jumpTo(URL_List)
{
	var URL = URL_List.options[URL_List.selectedIndex].value;
	window.location.href = document.getElementById('httpbase').href + URL;
}

function jumpToGallery(URL_List)
{
	var URL = URL_List.options[URL_List.selectedIndex].value;
	window.location.href = document.getElementById('httpbase').href + 'gallery/' + URL + '/';
}

function jumpToLink(URL_List)
{
	var URL = URL_List.options[URL_List.selectedIndex].value;
	window.location.href = document.getElementById('httpbase').href + 'links/' + URL + '/';
}

function jumpToRelease(URL_List)
{
	var URL = URL_List.options[URL_List.selectedIndex].value;
	window.location.href = document.getElementById('httpbase').href + 'releases/details/' + URL + '/';
}


function jumpToLabel(URL_List)
{
	var URL = URL_List.options[URL_List.selectedIndex].value;
	window.location.href = document.getElementById('httpbase').href + 'releases/' + URL + '/';
}

function jumpToLabelD(URL_List)
{
	var URL = URL_List.options[URL_List.selectedIndex].value;
	window.location.href = document.getElementById('httpbase').href + 'about/discographie/' + URL + '/';
}

function jumpToChart(URL_List)
{
	var URL = URL_List.options[URL_List.selectedIndex].value;
	window.location.href = document.getElementById('httpbase').href + 'music/charts/' + URL + '/';
}

function ToggleUserGroups (id)
{
		if(browser == 'ie')
        {
        	display = 'inline';
        } else {
        	display = 'table-row';
        }

		if (document.getElementById("GroupSelectTr_" + id).style.display == 'none')
        {
				document.getElementById("GroupTr_" + id).style.display = display;
                document.getElementById("GroupSelectTr_" + id).style.display = display;

        }
        else
        {
				document.getElementById("GroupTr_" + id).style.display = "none";
                document.getElementById("GroupSelectTr_" + id).style.display = "none";
        }
}



function getElementByClassName(a_sClassName)
{
    oElements = window.document.getElementsByTagName('*');
    aRet      = new Array();

    for (i=0; i<oElements.length; i++) {
        if (oElements[i].className == a_sClassName) {
            aRet[aRet.length] = oElements[i];
        }
    }

    return aRet;
}

function ChangeClass(id,classname)
{
	document.getElementById(id).className = classname;
}

function expandSubMenu(id)
{
		if (document.getElementById("submenu_" + id).className == 'NonDisplay')
        {
        	document.getElementById("submenu_" + id).className = 'NonDisplay1';
		    while (document.getElementById("submenu_" + id).className != 'BlockDisplay')
            {
				document.getElementById("submenu_" + id).className = 'BlockDisplay';
            }
        }
        else
        {
        	document.getElementById("submenu_" + id).className = 'BlockDisplay1';
        	while (document.getElementById("submenu_" + id).className != 'NonDisplay')
            {
				document.getElementById("submenu_" + id).className = 'NonDisplay';
            }
        }
}

function NewImage(mypage,myname,mytitle,w,h,scroll)
{
	var win = null;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',';
	win = window.open('',myname,settings);
    win.document.write('<html><head><title>'+mytitle+'</title></head><body style="margin:5px"><a href="javascript:this.window.close();"><center><img src="'+document.getElementById('httpbase').href+mypage+'" border="0"></center></a><br><br><center><b>Auf das Bild klicken, um das Fenster zu schließen!</b></center></body></html>');
	if(win.window.focus){win.window.focus();}
}


function Mp3PlayerPopUp(mytitle, myname,w,h,scroll)
{
	myname = 'win2';
	LeftPosition = 0;
	TopPosition = 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',';
	win2 = window.open('http://www.resident-e.net/_files/cms_upload/flashplayer/music_player_v2.php',myname,settings);

}

function changeDisplayById(id)
{
		if (document.getElementById(id).className == 'NonDisplay')
        {
		    while (document.getElementById(id).className != 'BlockDisplay')
            {
				document.getElementById(id).className = 'BlockDisplay';
            }
        }
        else
        {
        	while (document.getElementById(id).className != 'NonDisplay')
            {
				document.getElementById(id).className = 'NonDisplay';
            }
        }
}