/*======================================================================================
' Function to open YouTube video in Highslide
' Highslide must be initiated on page
======================================================================================*/
//var ytHeight = 385;
//var ytWidth = 480;
//var hsWidth = 480;
//var hsHeight = 385;

//play YouTube video in HighSlide popup
function playYouTubeInHighslide(opener) {
  var returnValue;	
	
  // Safari Mobile doesn't have Flash, so we just let the device use the built-in YouTube viewer.
  if (/(iPhone|iPod|iPad)/.test(navigator.userAgent)) returnValue = true;
  else returnValue = hs.htmlExpand(opener, { 
		               objectType: 'swf', 
		               //objectWidth: ytWidth, 
		               //objectHeight: ytHeight, 
		               //width: hsWidth, 
		               //height: hsHeight,
		               swfOptions: { 
			             params: { 
				           allowfullscreen: 'true' 
			           } },
		               //src: opener.href.replace("watch?", "").replace("=", "/")+'&hl=en_US&fs=1&autoplay=1',
		               src: opener.href.replace("youtu.be/", "www.youtube.com/v/").replace("watch?", "").replace("=", "/")+'&hl=en_US&fs=1&autoplay=1',
		               maincontentText: 'Your Flash player is not support.' 
  } );
  return returnValue;
}  
