	
	// JavaScript for Admin-Section
	
	
	function submitAdminForm(formID)
	{
		if(formID) document.getElementById('adminForm'+formID).submit();
	}
	
	function setAdminContent(target,content)
	{
		document.getElementById('divUserAreaAdminContent'+target).innerHTML = content;
	}
	
	function setAdminMsg(target, msg, color)
	{
		if(msg){
			document.getElementById('divUserAreaAdminInfo'+target).innerHTML = "<p class='font_UserAreaAdminMsg_"+color+"'>"+msg+"</p>";
		}else{
			document.getElementById('divUserAreaAdminInfo'+target).innerHTML = "<!-- -->";
		}
	}


	function updateMp3FolderSelect(mp3FoldersHTML)
	{
		if(mp3FoldersHTML) document.getElementById('mp3FolderSelect').innerHTML = mp3FoldersHTML;
	}

	function showAlbumMp3Content(adminFunction,albumCosts)
	{
		if(albumCosts==undefined) albumCosts = 0;
		
		var selectedAlbumID = document.getElementById('mp3AlbumUpdateSelect').value;
		
		if(selectedAlbumID)
		{
			loading(0);
			setMyiFrameSecond("../shopShared/includes/admin/remote_processAdmin.php?showAlbumMp3Content="+selectedAlbumID+"&admin="+adminFunction+"&albumCosts="+albumCosts);
		}
		else
		{
			setAdminContent(adminFunction,"");
		}
		
	}

	function showFolderMp3Content(adminFunction,albumCosts)
	{
		var selectedFolder = document.getElementById('mp3FolderSelect').value;
		
		if(selectedFolder)
		{
			loading(0);
			setMyiFrameSecond("../shopShared/includes/admin/remote_processAdmin.php?showFolderMp3Content="+selectedFolder+"&admin="+adminFunction+"&albumCosts="+albumCosts);
		}
		else
		{
			setAdminContent(adminFunction,"");
		}
		
	}
	
	function showMp3Descriptions(language)
	{
		document.getElementById('divUserAreaAdminAlbumDescription_de').style.display="none";
		document.getElementById('divUserAreaAdminAlbumDescription_en').style.display="none";
		document.getElementById('divUserAreaAdminAlbumDescription_pl').style.display="none";

		document.getElementById('divUserAreaAdminAlbumDescription_'+language).style.display="block";
	}
	
	var timeoutID = 0;
	function saveMemoText(formID)
	{
		setAdminMsg(formID, 0, 0);
		if(timeoutID) clearTimeout(timeoutID);
		timeoutID = setTimeout( function(){submitAdminForm(formID);timeoutID=0;} ,1500 );
	}
	
	
	function displayToolScreen(whichTool)
	{
		//closeDetails('divUserArea',0);
		document.getElementById('toolScreen').style.display="block";
		document.getElementById('toolScreen').style.zIndex=3;
		document.getElementById('divPlayer').style.top="-375px";
		document.getElementById('toolScreenTitle').innerHTML = '<a href="../shopShared/includes/admin/remote_processAdminTools.php?tool=' + whichTool + '" target="myiFrame">' + whichTool + '</a>';	
		document.getElementById('divPSpecial1').style.display="none";
		scroll(0,0);
	}
	
	function closeToolScreen()
	{
		document.getElementById('toolScreen').style.display="none";
		document.getElementById('divPlayer').style.top="0px";	
		document.getElementById('divUserArea').style.top="0px";
		document.getElementById('divUserArea').style.left="0px";
		document.getElementById('divPSpecial1').style.display="block";
	}
	
	function toolScreenDisplayUserArea()
	{
		if(document.getElementById('divUserArea').style.display=="none") displayUserArea();
		document.getElementById('toolScreen').style.zIndex=0;
		document.getElementById('divUserArea').style.left="-350px";
		document.getElementById('divUserArea').style.top="-375px";
	}
	
	function setToolScreenContent(innerHTMLcontent)
	{
		document.getElementById('toolScreenContent').innerHTML = innerHTMLcontent;
	}
	
	var lastContact = 0;
	function showContact(whichContact)
	{
		contactObj = document.getElementById('divToolContact' + whichContact);
		
		if(contactObj)
		{
			if(contactObj.style.display=="block")
			{
				contactObj.style.display="none";
				lastContact = 0;
			}else{
				if(lastContact)
				{
					lastContactObj = document.getElementById('divToolContact' + lastContact);
					if(lastContactObj) lastContactObj.style.display="none";
					lastContact = 0;
				}
				contactObj.style.display="block";
				lastContact = whichContact;				
			}
		}
	}
	
	function hideContact(whichContact)
	{
		document.getElementById('divToolContact' + whichContact).style.display="none";
	}
	
	function deleteContact(whichContact, title)
	{
		if(title) title = "'"+title+"'";
		var conf = confirm("Do you really want to delete the contact " + title + "?");
		if (conf)
		{
			document.getElementById('divToolContact' + whichContact).style.display="none";
			setMyiFrameSecond("../shopShared/includes/admin/remote_processAdminToolsContacts.php?changeContact=true&deleteContact=" + whichContact);
		}
	}
	
	function givePermissionPending(pendingID, user, email)
	{
		var conf = confirm("Albums and tracks from Pending (Nr." + pendingID + ") will be available for " + user + " (" + email + ").");
		if (conf)
		{
			setMyiFrameSecond("../shopShared/includes/admin/remote_processAdminTools.php?tool=Mp3User&permittPendingID=" + pendingID);
		}
	}
