var cancelImage = false, loadingImage = '/js/loading.gif', ol_text = '';
function overlibImage(imagePath)
{
  bgImage=new Image();
  bgImage.src=imagePath;
  
  if(!bgImage.complete)
  {
    overlib(BACKGROUND,loadingImage,FGCOLOR,'',WIDTH,16,HEIGHT,16,VAUTO,HAUTO,OFFSETX,30);
    cancelImage=false;
    bgImage.onload=function()
    {   
      if(!cancelImage)
      {
        var substringpos=bgImage.src.length-imagePath.length;
        if(bgImage.src.substring(substringpos)==imagePath)
        {
          overlib(BACKGROUND,imagePath,FGCOLOR,'',WIDTH,bgImage.width,HEIGHT,bgImage.height,VAUTO,HAUTO,OFFSETX,30);
        }
      }
    }
  }
  else
  {
    overlib(BACKGROUND,imagePath,FGCOLOR,'',WIDTH,bgImage.width,HEIGHT,bgImage.height,VAUTO,HAUTO,OFFSETX,30);
  }
}

function overlibMouseout()
{
  cancelImage=true;
  return nd();
}

// create a shorthand function so we don't need to put all this in the opener's onclick
function openYouTube(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',
		allowSizeReduction: false,
		objectWidth: 425, 
		objectHeight: 344, 
		width: 425,
		maincontentText: 'You need to upgrade your Flash player' 
		});
	}
	
	return returnValue;
}  