<!-- Hide script from old browsers
//
function element( pId )
{ return document.getElementById( pId ); }
function bodyTag()
{ return document.getElementsByTagName( 'head' )[0]; }
function loadScriptOthers( pId, pSrc )
{
if ( element( pId ) != null )
{
bodyTag().removeChild( element( pId ) );
}
var newScript = document.createElement( 'script' );
newScript.id = pId;
newScript.setAttribute( 'type', 'text/javascript' );
newScript.setAttribute( 'src', pSrc );
bodyTag().appendChild( newScript );
}
function createScriptScratchPad( pScriptTagId )
{
var newScript = element( pScriptTagId );
if ( newScript == null )
{
document.writeln( "<" + "SCRIPT id='" + pScriptTagId + "' type=\"text/javascript\"" + ">" + "<" + "/SCRIPT" + ">" );
}
}
function loadScriptHelper( pScriptTagId, pSrc )
{
var newScript = element( pScriptTagId );
newScript.setAttribute( 'src', pSrc );
}
function loadScript( pSrc )
{
var pageName = pSrc.toLowerCase();
var aspx_pos = pageName.indexOf( '.aspx' );
if ( aspx_pos > -1 )
{
pageName = pageName.substring( 0, pageName.indexOf( '.aspx' ) );
}
pageName = pageName.replace( /[^_a-z]/g, '_' );
var scriptTagId = pageName + '_ScriptTag';
createScriptScratchPad( scriptTagId );
window.setTimeout( "loadScriptHelper( '" + scriptTagId + "', '" + pSrc + "' );", 1000 );
}
function getCtrl( id )
{
return document.getElementById( id );
}
// -->
