// tmtC_winOpen
// tmtC_winOpenEnd
// MM_displayStatusMsg v1.0

var grading;
var undefined;
var newWin;

function tmt_winOpen(u,id,f,df){
	if (eval(id)==null||eval(id+".closed")) {
		eval(id+"=window.open('"+u+"','"+id+"','"+f+"')");eval(id+".focus()");
	} 
	else if(df) {
		eval(id+".focus()");
	} 
	else {
		eval(id+"=window.open('"+u+"','"+id+"','"+f+"')");eval(id+".focus()");
	}
}
//tmtC_winOpen
var grading;
//tmtC_winOpenEnd

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}


function popUp(newURL, w, h) { 
	// don't reuse the window, we might need different sizes
	if (newWin && !newWin.closed && newWin.location){
		newWin.close();
	}	

	// open a new window
	newWin=window.open(newURL,"newWin",'width='+w+',height='+h+',menubar=0,toolbar=0,status=0,location=0,scrollbars=0,resizable=1,left=100,top=100')

	// focus on the new window
	if (window.focus) {newWin.focus()}

	// return `false` so the anchor link doesn't also open
	return false;
}

function popMovie(title, format, s, w, h){
	if(format == 'mov'){
		h = h + 15;
	} else if(format == 'wmv'){
		h = h + 70;
	} else {
		alert('unknown movie format');
		return false;
	}
	var movieUrl = 'movie.php?t=' + title + '&f=' + format + '&w=' + w + '&h=' + h + '&s=' + s;
    var r = popUp(movieUrl, w, h );
    //alert(r);
    return r;
}