var newwindow = null;

function audio(url,c,w,h,scr){
windowCleanup ();
// default values for arguments that are not passed
if (!c) c = 0;
if (!w) w =320
if (!h) h = 5;
if(url.indexOf(".mov")>0) h=256;
if (!scr) scr = 0;
if (!url) url = 0;

url = url.replace('.mp3', '.flv');
url = 'player.php?url=' + escape(url) + '&audio=1';

//alert(url);
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;

settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scr+',resizable';

//	if(!isIE){
	newwindow = window.open(url,'container',settings);
	newwindow.focus();
//	}else{
//	location.href=url;
//	}
	

}		

function video(url,c,w,h,scr){
windowCleanup ();

url = url.replace('.mov', '.flv');
url = 'player.php?url=' + escape(url);

// default values for arguments that are not passed
if (!c) c = 0;
if (!w) w =320
if (!h) h = 5;
//if(url.indexOf(".mov")>0) h=256;
if (!scr) scr = 0;
if (!url) url = 0;
//alert(url);

LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scr+',resizable';

//	if(!isIE){
	//alert(url);
	newwindow = window.open(url,'container',settings);
	newwindow.focus();
//	}else{
//		url='video_player.php?media='+url;
		//alert(url);
//		newwindow = window.open(url,'container',settings);
//		newwindow.focus();
//	}
	

}	

function windowCleanup() {

	if (newwindow ) {
		
		if (newwindow .open) {
			
			newwindow .close();
			newwindow = null;
		}
	}
	return;
}