/* Standard Functions	*/

function PADIeLearning( )
{
	accessWin = window.open("https://www.padi.com/padi/elearning/default.aspx?irra=35239","","scrollbars=yes,top="+(screen.height/8)+",left="+(screen.width/8)+",width=1000,height=700,resizable=yes");
	window.accessWin.focus( );
}

function PADIeLearningSignIn( )
{
	accessWin = window.open('http://www.padi.com/padi/elearning_signin/','','scrollbars=yes,top='+(screen.height/8)+',left='+(screen.width/8)+',width=1000,height=700,resizable=yes');
window.accessWin.focus();
}

function addToFavorites( )
{
	if (window.external)
	{
		window.external.AddFavorite(urlAddress,pageName);
	}
	Else
	{ 
		alert("Sorry! Your browser doesn't support this function.");
	}
}


function replaceText( parentName, idName, sText )
{
//	This function is the equivalent to setting the object.innerText property, but is browser independent  ;-)
//	Called By: replaceText( "resultCell", "results", msg )
//	The following entry must appear in your markup
//		<div id = "resultCell" >
//			<div id = "results" ></div>
//		</div>

	var parent = document.getElementById( parentName );
	var oldChild = document.getElementById( idName );
	parent.removeChild( oldChild );
	var newChild = document.createElement( "div" );
	newChild.id = idName;
	var newText = document.createTextNode( sText );
	newChild.appendChild( newText );
	parent.appendChild( newChild );
}

function chgListSelection( formName, keyField, rowId )
{
	var oldRowId

	oldRowId = eval( "document." + formName + "." + keyField + ".value" );
	if ( oldRowId == rowId ) rowId = "";
	if ( oldRowId != "" )
		{ eval( "document." + formName + ".id" + oldRowId + ".checked = '' " ) }
	eval( "document." + formName + "." + keyField + ".value = '" + rowId + "'" );
}
