	function bodyOnLoad(sType)
	{
		//do nothing at present
	}
	
	function login()
	{
		window.open('/video/profile/login.php', 'login', 'toolbar=no,menubar=no,scrollbars=no,width=350,height=330,resizable=0');
	}
	
	function logout()
	{
		window.open('/video/profile/logout.php', 'logout', 'toolbar=no,menubar=no,scrollbars=no,width=350,height=280,resizable=0');
	}
	
	/**
	* loads a URL into a popup's calling window
	*/
	function loadCallee(sUrl)
	{
		window.opener.location = sUrl;
	}
	
	function toggleAtivDropdown(event)
	{
		//close up all other dropdowns first
		 document.getElementsByClassName('ativ_dropdown_content').each( function(item, index){if (item.id !='content_'+event.id){item.style.display='none';}});	
		
		//toggle this one
		toggleVisible('content_'+event.id);
	}
	
	/**
	* toggles treemenu entries
	*/
	
	function toggleTreeMenu(sClass)
	{
		document.getElementsByClassName(sClass).each( function(item, index){
			toggleVisible(item);
		});
		//change expander graphic
		var item = $('expander_'+sClass);
	 	if (item.src.search('plus.gif')>0)
	 	{
		 	item.src = item.src.replace('plus.gif','minus.gif');
	 	}
	 	else if (item.src.search('minus.gif')>0)
	 	{
			item.src = item.src.replace('minus.gif','plus.gif');
	 	}	 	
	}
	/**
	* toggles visibility
	*/
	function toggleVisible(elStr)
	{
		var el = $(elStr);
		if (el.style.display=='none')
		{
			el.style.display='';
		}
		else
		{
			el.style.display='none';
		}
	}
	
	/**
	* browsing A to Z
	* img format is 
	* //http://library.classical.com/nav/a_z/d_off.gif
	* //http://library.classical.com/nav/a_z/d_on.gif
	*/
	function HilightAtoZ(el)
	{
		el.src = el.src.replace('_off.gif','_on.gif');
	}
	
	function LolightAtoZ(el)
	{
		el.src = el.src.replace('_on.gif','_off.gif');
	}
	
	/**
	* open a popup
	* sURL: URL to open up
	* sWidth: width of popup in pixels
	*/
	function openPopup(sUrl, sWidth)
	{
		(typeof sWidth == 'undefined')?sWidth='350':0;
		window.open(sUrl, null, 'toolbar=no,menubar=no,scrollbars=no,width='+sWidth+',height=300,resizable=1')
	}
	
	/**
	* Shows group create controls when creating a playlist
	*/
	function showCreateGroupControls()
	{
		toggleGroupControls('createGroupContainer', true);
		toggleGroupControls('editGroupContainer', false);
	}
	
	/**
	* Shows group edit controls when creating a playlist, and also gets current values
	*/
	function showEditGroupControls()
	{
		toggleGroupControls('editGroupContainer', true);
		toggleGroupControls('createGroupContainer', false);

		var group_id = $F('collection_group_id');
		if (group_id >0)
		{
		 	new Ajax.Updater(
			'ajax_response',
			'http://'+location.host+'/video/ajax/get_group_title.php', 
			{
				method: 'get', 
				parameters: 'group_id='+group_id,
				evalScripts: true,
				onFailure: reportError
			});
			
			new Ajax.Updater(
			'ajax_response',
			'http://'+location.host+'/video/ajax/get_group_emails.php', 
			{
				method: 'get', 
				parameters: 'group_id='+group_id,
				evalScripts: true,
				onFailure: reportError
			});
		}
	}

	function reportError()
	{
		alert('Sorry, an error has occured obtaining group information. Please try again.');
	}
	
	/**
	* toggle visibility of playlist group controls
	*/
	function toggleGroupControls(sEl,bForceOpen)
	{
		var v = $F('visibility');
		var el = $(sEl);

		if (v=='group' && (el.style.display=='none' && bForceOpen!=false))
		{
			Effect.BlindDown(sEl);
		}
		else
		{
			Effect.BlindUp(sEl);
		}
	}
		
	function togglePlayerTab(strTab,strTabgroup)
	{
		tab = $('playertab_'+strTab);
		//hide all found pane contents for group except this one
		document.getElementsByClassName('tab_content',$(strTabgroup)).each(
			function(tabContent)
			{
				if (tab.id == tabContent.id)
				{
					tabContent.style.display='';
				}
				else
				{
					tabContent.style.display='none';
				}
				
			}
		);
		//set all found tab images for group to 'off' except this one, set that to 'on'
		img = $('playertab_img_'+strTab);
		document.getElementsByClassName('playertab_img',$(strTabgroup)).each(
			function(tabImg)
			{
				if (img.id == tabImg.id)
				{
					tabImg.src = tabImg.src.replace('_off.gif','_on.gif');
				}
				else
				{
					tabImg.src = tabImg.src.replace('_on.gif','_off.gif');
				}
			}
		);

	}
	
	