/** This file supports hiding special videos in the FRF section **/

function activateVid(iVID) {
	//alert(iVID);
	
	/* Select The Tab */
	var currTab;
	var newAttr;
	
	if (document.getElementById("tabRow").hasChildNodes()) {
		currTab = document.getElementById("tabRow").firstChild;
	}

	if (detectBrowser() == 0) {
		//IE
		var bIE = 1;
		while (bIE == 1)
		{
			if (currTab.getAttribute("id") == iVID)
			{
				currTab.style.setAttribute('cssText','color:#FFFFFF; background-color:#000000;');
			} else {
				currTab.style.setAttribute('cssText','color:#000000; background-color:#FFFFFF;');
			}
			if (currTab = currTab.nextSibling) { bIE = 1; } else { bIE = 0; } // check
		} //end loop thru tabs
		document.getElementById("vidContain").style.setAttribute("cssText","background-color:#000000; width:500px;");
	} else {
		//non-IE
		while (currTab = currTab.nextSibling)
		{
			if (currTab.getAttribute("id") == iVID)
			{
				currTab.setAttribute('style','color:#FFFFFF; background-color:#000000;');
			} else {
				currTab.setAttribute('style','color:#000000; background-color:#FFFFFF;');
			}
			currTab = currTab.nextSibling
		} //end loop thru tabs
		document.getElementById("vidContain").setAttribute("style","background-color:#000000; width:500px;");
	} //end detect browser check
	
	/* Clear out the div */
	while (document.getElementById("vidContain").hasChildNodes())
	{
	  document.getElementById("vidContain").removeChild(document.getElementById("vidContain").firstChild);
	}


	var theEmbed = document.createElement("embed");
	theEmbed.setAttribute("src", "http://vimeo.com/moogaloop.swf?clip_id=" + iVID + "&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=&amp;fullscreen=1");
	theEmbed.setAttribute("type", "application/x-shockwave-flash");
	theEmbed.setAttribute("allowfullscreen", "true");
	theEmbed.setAttribute("allowscriptaccess", "always");
	theEmbed.setAttribute("width", "500");
	theEmbed.setAttribute("height", "375");
		
	document.getElementById("vidContain").appendChild(theEmbed);
		
} //end activateVid

function detectBrowser()
{
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);
	var bCheck = 1;
	if ((browser=="Microsoft Internet Explorer"))
	{
		bCheck = 0;
	}
	
	return bCheck;
} //end detectBrowser

function depricatedCode () {
	if (detectBrowser() == 0) {
		var theObject = document.createElement("object");
		theObject.setAttribute("width", "400");
		theObject.setAttribute("height", "300");
		
		var theParam1 = document.createElement("param");
		theParam1.setAttribute("name", "allowfullscreen");
		theParam1.setAttribute("value", "true");
		
		var theParam2 = document.createElement("param");
		theParam2.setAttribute("name", "allowscriptaccess");
		theParam2.setAttribute("value", "always");
		
		var theParam3 = document.createElement("param");
		theParam2.setAttribute("name", "movie");
		theParam2.setAttribute("value", "http://vimeo.com/moogaloop.swf?clip_id=" + iVID + "&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1");
		
		var theEmbed = document.createElement("embed");
		theEmbed.setAttribute("src", "http://vimeo.com/moogaloop.swf?clip_id=" + iVID + "&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1");
		theEmbed.setAttribute("type", "application/x-shockwave-flash");
		theEmbed.setAttribute("allowfullscreen", "true");
		theEmbed.setAttribute("allowscriptaccess", "always");
		theEmbed.setAttribute("width", "400");
		theEmbed.setAttribute("height", "300");
		
		theObject.appendChild(theParam1);
		theObject.appendChild(theParam2);
		theObject.appendChild(theParam3);
		theObject.appendChild(theEmbed);	/*** FIREFOX PROCESSES THE FOLLOWING LINE FINE BUT IE CHOKES ***/
		
		document.getElementById("vidContain").appendChild(theObject);
	} else {
		// IF INTERNET EXPLORER
		
		
	} //end browser check	
} //end depricatedCode
