/*
 * custom wJones functions
 */

/*
* function to replace an image with embedded video and record the video play action in google analytics 
* vDivID = string ID of the div tag where img HTML will be replaced with embedded video object
* vYouTubeID = string ID of the video on YouTube
* vW, vH = width and height of the embedded object
* vGA_URL = string URL to be recorded as page URL in google analyticsi.e. "/video/testVideo/testPage"
*/
function playVideo (vDivID, vYouTubeID, vW, vH, vGA_URL){
document.getElementById(vDivID).innerHTML = '<object width="' + vW +'" height="' + vH + '"><param name="movie" value="http://www.youtube.com/v/' + vYouTubeID + '&hl=en_US&fs=1&autoplay=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + vYouTubeID + '&hl=en_US&fs=1&autoplay=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' + vW + '" height="' + vH + '"></embed></object>';
GA_Custom (vGA_URL);
};

