function NewWindow(mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function gohere($xx){
    location.href=$xx;
  }

function pophere($xx,$rel){
    location.rel=$rel;
    location.href=$xx;
  }

function trim(str, chars) {
		return ltrim(rtrim(str, chars), chars);
	}
	 
function ltrim(str, chars) {
	if (str=='') return '';
		chars = chars || "\\s";
		return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
	}
	 
function rtrim(str, chars) {
		if (str=='') return '';
	    chars = chars || "\\s";
		return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
	}  

// http://www.somacon.com/p143.php

//return the value of the radio button that is checked
//return an empty string if none are checked, or
//there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

//set the radio button with the given value as being checked
//do nothing if there are no radio buttons
//if the given value does not exist, all the radio buttons
//are reset to unchecked
function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

function hidePlayer() {
	  document.getElementById("podcastPlayer").style.display="none";	
	}  


function showPlayer($filename) {
	
	document.getElementById("podcastPlayer").innerHTML=
	'<center><div style="border-style:none;border-width:1px;border-color:maroon;width:300px;padding:10px;">'+
	'<center> '+
	'<h2>Podcast Player</h2><hr>'+
	' <object id="MediaPlayer" height=46 '+ 
	' classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" '+  
	' standby="Loading Windows Media Player components..." '+  
	' type="application/x-oleobject" '+  
	' codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> '+ 
	' <param name="filename" value="'+$filename+'">'+
	' <param name="animationatStart" value="true"> '+ 
	' <param name="transparentatStart" value="true"> '+ 
	' <param name="showControls" value="true"> '+ 
	' <param name="width" value="150"> '+ 
	' <param name="DisplaySize" VALUE="4"> '+
	' <param name="autoStart" value="true"> '+ 
	' <param name="AutoSize" value="0"> '+ 
	' <param name="Volume" value="-300"> '+ 
	' <embed type="application/x-mplayer2" '+  
	' pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" '+ 
	' src="'+$filename+'" '+
	' name="MediaPlayer" '+ 
	' width="300" height=48 autostart=1 showcontrols=1 displaysize=4 AutoSize=-1 volume=-300></embed> '+ 
	' </object> '+ 
	' <p>Click on the play button to start the Podcast</p>'+
	' <a href="javascript:hidePlayer()">Hide</a></center></div></center>';


	document.getElementById("podcastPlayer").style.display="block";
	}  

	  
	