// (c) 2007 HMD Change Technology LLC
var domain = 
//  "http://localhost/walzguitar/";
   "http://www.walzguitar.com/";
function $( id ) {return document.getElementById( id );}
function getValue( stub, tag ) {
    if( stub.indexOf( tag ) > -1 ) {
        return stub.substring( 
            stub.indexOf( "<" + tag + ">" ) + tag.length + 2, 
            stub.indexOf( "</" + tag + ">" )
            );
    } else {return "";}
}
onload = setTimeout( 'autoText( );', 2000 );
function autoText( ) {
	if( $( 'c' ) ) {// for note content autolinking of urls
		var c = $( 'c' ).innerHTML;
		c = c.replace( 
			/\((http:\/\/[a-z0-9\/\._\-\?= %&~\(\)]+)\)/gi, 
			'(<a href="$1" target="_blank">$1</a>)' );
		$( 'c' ).innerHTML = c;
	}
	if( $( 'rannote' ) ) {// for random notes, shortens longs words
		var rna = $( 'rannote' ).innerHTML.split( / / );
		var h = '';
		for( var i = 0; i < rna.length; i++ ) {
			if( rna[ i ].length > 30 ) {
				rna[ i ] = rna[ i ].substring( 0, 27 ) + '...';
			}
			h += rna[ i ] + ' ';
		}
		$( 'rannote' ).innerHTML = h;
	}
}