// Javascript from Moodle modules
<?php    
/**
 * podcaster javascript
 *
 * @author  Humboldt Universitaet zu Berlin
 *            Christoph Soergel <christoph.soergel@cms.hu-berlin.de>
 * @version 1.0
 * @package podcaster
 *
 **/
if (!defined('MOODLE_INTERNAL')) {
  die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
}
?>
<!--
//
function repository_openpopup(url,name,options,fullscreen) {
  fullurl = url;
  windowobj = window.open(fullurl,name,options);
  if (fullscreen) {
     windowobj.moveTo(0,0);
     windowobj.resizeTo(screen.availWidth,screen.availHeight);
  }
  windowobj.focus();
  return false;
}
// -->
function getClasses(element) {
	if (document.getElementById(element).getAttribute("class")) return document.getElementById(element).getAttribute("class");
	else return document.getElementById(element).getAttribute("className");
}

function toggleClass(element,c1,c2) {
  var classes = getClasses(element).split(" ");
  
  for (i=0; i<classes.length; i++) {
    if (classes[i] == c1) classes[i] = c2;
    else if (classes[i] == c2) classes[i] = c1;
  }
  
	document.getElementById(element).setAttribute("class", classes.join(" "));
	document.getElementById(element).setAttribute("className", classes.join(" "));
}