//Opens player in new window...for use on sermon pages


//wimpy code

var wimpyWindow;
var winOpen=0;
function wimpyPopPlayer(wimpyPopPage,theWidth,theHeight) {
	wimpyWindow = window.open(wimpyPopPage,'wimpyMP3player','width='+theWidth+',height='+theHeight);

	winOpen=1;
}
function wimpyPopPlayerWithFile(wimpyPopPage,initialFile,theWidth,theHeight) {
	wimpyWindow = window.open(wimpyPopPage+'?theFile='+initialFile,'wimpyMP3player','width='+theWidth+',height='+theHeight);

	winOpen=1;
}
function wimpyIsOpen(){
	if (winOpen==1){
		if (wimpyWindow.closed){
			return false;
		} else {
			return true;
		}
	} else {
		return false;
	}
}
function wimpyPopAndPlay(startOnLoad, theFile, theArtist, theTitle, graphicURL, hotlinkURL){
	if(wimpyIsOpen()){
		wimpyWindow.wimpy_addTrack(startOnLoad, theFile, theArtist, theTitle, graphicURL, hotlinkURL);
        if (window.focus) {wimpyWindow.focus()}
	} else {
		wimpyPopPlayerWithFile('http://jh78.org/audios/player.html',theFile,'420','150');
	}
}
