var currentopen = 0;
var baseheight = 0;
var flwheight = 0;

function expand (targetdiv,idx) {
	if(currentopen != idx){
		$("#r"+idx).hide();
		$("#r"+idx).fadeIn(300);
		if(currentopen != 0){
			contract(document.getElementById('r' + currentopen),currentopen);
		}
		targetdiv.className = targetdiv.className + "_a";
		currentopen = idx;
	}
}

function contract (targetdiv,idx) {
	targetdiv.className = targetdiv.className.substring(0,2);
}

function vboxover (idx,over) {
	if(over){
		document.getElementById('v'+idx+'0').className = (over)? 'vboxover':'vbox';
		if(!$.browser.msie){
			$("#v"+idx).css("display", "none");
			$("#v"+idx+"b").css("display", "none");
			$("#v"+idx).fadeIn("fast");
			$("#v"+idx+"b").fadeIn("fast");
		}
	} else {
		document.getElementById('v'+idx+'0').className = (over)? 'vboxover':'vbox';
	}
}

function _pap_pop(id){
	window.open('http://www.pbs.org/wgbh/pages/frontline/video/flv/generic.html?s='+id,'videoplayer','width=750,height=640,scrollbars=no,toolbar=no,location=no,directories=no,menubar=no');
}

function promodecide(playerid,youtubeurl){
	if(navigator.platform && (typeof(youtubeurl) != 'undefined' && (navigator.platform.indexOf('iPhone') != -1 || navigator.platform.indexOf('iPod') != -1))){
		location.href = youtubeurl;	
	} else {
		window.open('http://www.pbs.org/wgbh/pages/frontline/video/flv/generic.html?s='+playerid,'videoplayer','width=750,height=640,scrollbars=no,toolbar=no,location=no,directories=no,menubar=no');
	}
}
