//global variables
var vidId;
var vidLink; 

function processLink(lnk){
	vidLink=lnk;
}//end function

function loadVideoPlayer(nHeight,nWidth,nVid) {
	<!-- Start of Brightcove Player -->
	// By use of this code snippet, I agree to the Brightcove Publisher T and C 
	// found at http://corp.brightcove.com/legal/terms_publisher.cfm. 
	var config = new Array();
	/* 
	* feel free to edit these configurations
	* to modify the player experience
	*/
	config["videoId"] = nVid; //the default video loaded into the player
	config["videoRef"] = null; //the default video loaded into the player by ref id specified in console
	config["lineupId"] = null; //the default lineup loaded into the player
	config["playerTag"] = null; //player tag used for identifying this page in brightcove reporting
	config["autoStart"] = true; //tells the player to start playing video on load
	config["preloadBackColor"] = "#666666"; //background color while loading the player
	config["wmode"] = "transparent"; //Set flash player to transparent 

	/* 
	* set the player's size using the parameters below
	* to make this player dynamically resizable, set the width and height as a percentage
	*/
	config["width"] = nWidth;
	config["height"] = nHeight;
 
	/* do not edit these config items */
	//config["playerId"] = 1586373659;
	config["playerId"] = 3790113001;
	createExperience(config, 8);
	
}
 
 //Script for controlling Brightcove player volume using Javascript control API. 
//Primarily developped for use with "Click to Listen" button

//This function runs after the player is loaded before the first title is played by default.
function onTemplateLoaded(message) {
	callFlash("setVolume", 0); //Changing this value will set the default volume on load.
	volumeButtonVisible(true); //Will set click to listen button to visible
	callFlash("setLink",vidLink); // set "get link" button in brightcove player to YH url
}

//This function sets the volume of the brightcove player to the passed value.
function setVolume(level) {
		callFlash("setVolume", level); //Changing this value will change the volume on the player.
		volumeButtonVisible(false); //Will set click to listen button to visible
}

//This function sets the visibility state of the "Click to listen button"
function volumeButtonVisible(state){
		if(state == true){
			document.getElementById('volume').style.display='block';
		}
		else {
			document.getElementById('volume').style.display='none';
		}
}


//csstroke.js






function processTextStroke(selector){
  var v=getElementsBySelector(selector);
  for(i=0;i < v.length;i++){
    processElement(v[i]);
  }
}

function processElement(v){
  var content=v.innerHTML;
  for (j=1;j<=8;j++){
    var d=document.createElement("span");
    d.className = "stroke"+j;
    d.innerHTML = content;
    v.appendChild(d);
  }
  v.removeChild(v.firstChild);
  var dd=document.createElement("span");
  dd.className = "rawtext";
  dd.innerHTML = content;
  v.appendChild(dd);
}
  
function NiftyCheck(){
  if(!document.getElementById || !document.createElement)
    return(false);
  var b=navigator.userAgent.toLowerCase();
  if(b.indexOf("msie 5")>0 && b.indexOf("opera")==-1)
    return(false);
  return(true);
}

function getElementsBySelector(selector){
  var i;
  var s=[];
  var selid="";
  var selclass="";
  var tag=selector;
  var objlist=[];
  if(selector.indexOf(" ")>0){  //descendant selector like "tag#id tag"
    s=selector.split(" ");
    var fs=s[0].split("#");
    if(fs.length==1) return(objlist);
    return(document.getElementById(fs[1]).getElementsByTagName(s[1]));
  }
  if(selector.indexOf("#")>0){ //id selector like "tag#id"
    s=selector.split("#");
    tag=s[0];
    selid=s[1];
  }
  if(selid!=""){
    objlist.push(document.getElementById(selid));
    return(objlist);
  }
  if(selector.indexOf(".")>0){  //class selector like "tag.class"
    s=selector.split(".");
    tag=s[0];
    selclass=s[1];
  }
  var v=document.getElementsByTagName(tag);  // tag selector like "tag"
  if(selclass=="")
    return(v);
  for(i=0;i < v.length;i++){
    if(v[i].className==selclass){
      objlist.push(v[i]);
    }
  }
  return(objlist);
}




//end of csstroke.js


