//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked
$(document).ready(function(){ 
  $("#firstpane p.menu_head").click(function()
  {
	var down = 'url('+base_url + 'files/images/rsspb/menuitem_opened.png)';
	var left = 'url('+base_url + 'files/images/rsspb/menuitem_closed.png)';
	  
    $(this).css({backgroundImage: down}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
    $(this).siblings().css({backgroundImage: left});
  });
});

function generatePlugURL()
{
  var domainIndex = document.getElementById('domain').selectedIndex;
  var domainValue = document.getElementById('domain')[domainIndex].innerHTML;
	
  var title = document.getElementById('title').value;
  
  title = removeSpaces(title);
  
  var url = document.getElementById('generated_url');
  
  url.innerHTML = 'http://www.'+domainValue+'/hosted/plug/'+title+'.html';
}

function removeSpaces(string) 
{
  return string.split(' ').join('-');
}
