function sb_Stream(sbform) {
 	var me = sbform.elements;
	var warning = "";
  	//me['pgsubmitentry'].disabled=false;
	var videoNum = sbform.tag.length;
	for (var idx = 0; idx < videoNum; idx++) {
		if (sbform.tag[idx].value != "" && sbform.provider[idx].value == 'none') {
			sbform.provider[idx].style.backgroundColor = 'red';
			warning = warning + "Please select a provider for Video #"+eval(idx+1)+"\n";
		}
		else
			sbform.provider[idx].style.backgroundColor = '';
	}
	if (warning != "") {
		alert(warning);
		sb_outputExpand();
	}
	else {
		var t_tags = "";
		var t_descriptions = "";
		var t_providers = "";
		for (var idx = 0; idx < videoNum; idx++) {
			if (sbform.tag[idx].value != "") {
				t_tags = t_tags + sbform.tag[idx].value + "|*|";
				// get rid of "|" in description!
				d = new String(sbform.description[idx].value);
				d.replace("|","/");
				t_descriptions = t_descriptions + d + "|*|";
				t_providers = t_providers + sbform.provider[idx].value + "|*|";
			}
		}
		sbform.t_tags.value = t_tags;
		sbform.t_descriptions.value = t_descriptions;
		sbform.t_providers.value = t_providers;
		sbform.sbtask.value = "editStream";
		sb_submitSandbox();
	}
}

function sb_fullSize(tag) {
	document.getElementById('sbtask').value="fullsize";
	document.getElementById('fullsize_tag').value=tag;
	sb_outputExpand();
	sb_submitSandbox();
}

var direction='block';
function sb_Expand() {
	document.getElementById('sb_direction').src="components/com_comprofiler/plugin/user/plug_ajaxsandbox/images/"+direction+"-arrow.gif";
	document.getElementById('sb_divForm').style.display=direction;
	if(direction=='block') direction = 'none';
	else direction='block'
}

var output_direction='none';
function sb_outputExpand() {
	document.getElementById('sandbox_output').style.display=output_direction;
	if(output_direction=='block') output_direction = 'none';
	else output_direction='block'
}
