var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	closeWin();
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}

	posLeft = (screen.availWidth - strWidth)/2;
	posTop = (screen.availHeight - strHeight)/2;

	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left="+posLeft+",top="+posTop;
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function loadVideo(name) {
	var url = '/video-seminar-previews/';
	var type = 'console';
	var strWidth = '450';
	var strHeight = '380';

	switch(name) {
		case 'mmm':
			strWidth = '640';
			strHeight = '502';
			url += 'making-the-most-of-marriage';
		break;
		case 'mcm':
			strWidth = '640';
			strHeight = '502';
			url += 'making-children-mind-without-losing-yours';
		break;
		case 'vpp':
			strWidth = '480';
			strHeight = '287';
			url += 'value-packed-parenting';
		break;
		case 'rtr':
			strWidth = '640';
			strHeight = '502';
			url += 'running-the-rapids';
		break;
		case 'sptw':
			strWidth = '640';
			strHeight = '502';
			url += 'single-parenting-that-works';
		break;
		case 'bphbf':
			url += 'bringing-peace-and-harmony-to-the-blended-family';
		break;
		case 'ppw':
			url += 'the-power-of-a-praying-woman';
		break;
		case 'lbg':
			url += 'loved-by-god';
		break;
		case 'wagoh':
			url += 'a-woman-after-gods-own-heart';
		break;
		case 'hankbf':
			strWidth = '647';
			strHeight = '395';
			url += 'have-a-new-kid-by-friday';
		break;
	}

	popUpWin(url, type, strWidth, strHeight);
}