// setup namespaced objects
	if(typeof UNCONUNDRUM == 'undefined') UNCONUNDRUM = {};
	if(typeof UNCONUNDRUM.TVNC == 'undefined') UNCONUNDRUM.TVNC = {};
// internal shorthand
	var UNCOTVNC = UNCONUNDRUM.TVNC;


// general function to set classnames
UNCOTVNC.setClass = function(whatdiv,whatclass)
{
	if(document.getElementById(whatdiv))
	{document.getElementById(whatdiv).className=whatclass;}
};

// general function to set styles
UNCOTVNC.setStyle = function(whatdiv,whatstyle,whatvalue)
{
	if(document.getElementById(whatdiv))
	{document.getElementById(whatdiv).style[whatstyle]=whatvalue;}
};

// general function to insert HTML
UNCOTVNC.setInnerHTML = function(whatdiv,whatcontents)
{
	docdiv=document.getElementById(whatdiv);
	if (docdiv != null)
	{
		while (docdiv.firstChild)
		{
			if (docdiv.deleteChild)
				{docdiv.deleteChild(docdiv.firstChild);}
			else
				{docdiv.removeChild(docdiv.firstChild);}
		}
		docdiv.innerHTML = whatcontents;
	}
};

// reveal more videos
UNCOTVNC.morevids = function()
{
	UNCOTVNC.pv.ulopen=UNCOTVNC.pv.ulopen+1;
	if(UNCOTVNC.pv.ulopen==UNCOTVNC.pv.ultotal) {UNCOTVNC.setInnerHTML('morebut','');} // remove button if limit reached
	UNCOTVNC.setStyle('thumbrow'+UNCOTVNC.pv.ulopen,'display','block'); // reveal row
}

UNCOTVNC.playvid = function(vidid)
{
	var vidcode='<object id="myExperience'+vidid+'" class="BrightcoveExperience"><param name="bgcolor" value="#000000" /><param name="width" value="780" /><param name="height" value="568" /><param name="playerID" value="1094920082001" /><param name="playerKey" value="AQ~~,AAAAo9jbPWE~,8B_6Ee4bg3nLLpnl11juWjMnERt-pjYg" /><param name="isVid" value="true" /><param name="isUI" value="true" /><param name="dynamicStreaming" value="true" /><param name="@videoPlayer" value="'+vidid+'" /><param name="wmode" value="transparent" /></object>';
	UNCOTVNC.setInnerHTML('uncovidobject',vidcode);
	brightcove.createExperiences();
}

// global variables, safely namespaced
UNCOTVNC.pv =
{
	ultotal:0,
	ulopen:0

};
