﻿// embed the Windows Media Player, set properties
function openLinkInNewWindow( AdContainerName ) {

   var NewWindowAd = document.getElementById( AdContainerName );
   if (NewWindowAd)
   {
       NewWindowAd.innerHTML = NewWindowAd.innerHTML.replace( /(href=\\?\")(.*?)(\\?)\"/gi, "$1$2$3\" onclick=\"javascript:void(window.open('$2','new','toolbar=yes,location=yes,status=yes,directories=no,menubar=yes,scrolling=auto,scrollbars=yes,resizable=yes')); return false;$3\"" );
       NewWindowAd.innerHTML = NewWindowAd.innerHTML.replace( /(clickTAG=)(.*?)(\\?)\"/gi, "$1javascript:void(window.open('$2','new','toolbar=yes,location=yes,status=yes,directories=no,menubar=yes,scrolling=auto,scrollbars=yes,resizable=yes'))$3\"" );
   }
}

function getSongTitle()
{
    if (!inProcess)
    {
        inProcess=true;
	    PageMethods.GetSongTitle(SongUrl, getSongTitle_callback, getSongTitle_callbackFailed);
	}
	setTimeout( "getSongTitle()", SongTitleTimeout );
}

function getSongTitle_callback(result)
{
    inProcess=false;
	document.getElementById(SongTitleTextElement).innerHTML = result;
}

function getSongTitle_callbackFailed(result)
{
    inProcess=false;
	// fail silently
}
