leftPos=1, topPos=1, popW=1, popH=1, popDimensions = ""; var winner;

function centerIt(popW,popH,urlToCenter,centeredWinName,otherProperties,noClothes){
	var w = 800, h = 600;
	if (document.all || document.layers || document.getElementById) {  w = screen.availWidth; h = screen.availHeight; }
	leftPos = (w-popW)/2, topPos = (h-popH)/2; popDimensions = 'width='+popW+',height='+popH+',left='+leftPos+',top='+topPos+',statusbar=0';
	if (otherProperties != null){ popDimensions+=otherProperties; }
	if (urlToCenter != null){
//		if (winner!=null && noClothes==null){ winner.close(); }
		winner=window.open(urlToCenter,centeredWinName,popDimensions);
	}
}

function popAudio2(clip,title,_clipwidth,_clipheight) {
	clip=clip.replace(/\.mp3/gi,'');
	if (title==null){title="Annie Fox/Hey Terra"; }
	width=300, height=160;
	if (_clipwidth!=null){ width=width+_clipwidth; }
	if (_clipheight!=null){ height=height+_clipheight; }
	centerIt(width,height,'../audio/play_mp3.html?clip='+clip+'&title='+escape(title),'Audio');
}


function popVideo(clip,title,_clipwidth,_clipheight) {
	clip=clip.replace(/\.mov/gi,'');
	if (title==null){title="Annie Fox/Hey Terra"; }
	width=400, height=360;
	if (_clipwidth!=null){ width=width+_clipwidth; }
	if (_clipheight!=null){ height=height+_clipheight; }
	centerIt(width,height,'../video/play_mov.html?clip='+clip+'&title='+escape(title),'Video');
}

function popPodcast(clip,title,_clipwidth,_clipheight) {
	clip=clip.replace(/\.m4a/gi,'');
	if (title==null){title="Annie Fox Podcast"; }
	width=320, height=470;
	if (_clipwidth!=null){ width=width+_clipwidth; }
	if (_clipheight!=null){ height=height+_clipheight; }
	centerIt(width,height,'video/play_podcast.html?clip='+clip+'&title='+escape(title),'Video');
}
