/****************************************************************************************************************
A.J.H 07/10/08

The jqMoveElement is used with with the JW Player. When JS is off the browser will display a link to download the PDF transcript of the video 
inside the video element. When JS is on the JW Player will replace the HTML inside the element with the flash code. If we call the jqMoveElement,
prior to the code that creates the SWFObject, the link will be moved ouside the video element.  The script automatically contains the moved link into a div 
element named "videofooterright" or "videofooterleft" depending on the ID of the video element.

The jqMoveElement must be called prior to the JS code that produces the SWFObject.
The video container element must have an ID of either "videoholderright" or "videoholderleft"
The PDF link must be place in an element with an ID of "nojs".
The PDF link must have a class of "pdf"
*****************************************************************************************************************/
function jqMoveTranscript(){
	if($("#nojs a.pdf").length >0){    //check to see that there is a PDF element
		var targetEl =$("#nojs a.pdf").parent("p").html();
		var footerId = getFooterId($("#nojs").parent().attr("id"));
		$("#nojs a.pdf").parent("<p>").remove();
		$("#nojs").parent().after('<div id="'+ footerId +'"><p>'+targetEl+'</p></div>');
	}
}


//find the correct ID for the new container element
function getFooterId(videoHolderID){
	switch (videoHolderID){
		case "videoholderright":
			return "videofooterright";
			break;
		case "videoholderleft":	
			return "videofooterleft";
			break;
		case "videoholderwidget":	
			return "videofooterwidget";
			break;
	}
}