<!--
var w = 200, h = 400, cw = w/2, ch = h/2, GABcw = w/2, GABch = h/2;

if (window.screen) {
	w = 715;
	h = 650;
	Audiocw = Math.floor((screen.availWidth-w)/2);
	Audioch = Math.floor((screen.availHeight-h)/2);
}

function openAudio(mp3,titleText) { //v2.0
  window.open('audio/index.html?soundFile=mp3/'+mp3+'.mp3&titleText='+titleText,'LongmanAudio','scrollbars=no,width=520,height=220,top='+Audioch+',left='+Audiocw);
}

function URLDecode(encoded)
{
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef"; 
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2) 
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + encoded.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	}
   return plaintext;
};

function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  return("");
}

//-->
