var num_chars = 75;	//number of characters printed per cycle

// -- Do not edit beneath this line --
/*First, print in the longitude and latitude*/
var rand = Math.random();
var lat = Math.round(360 * rand);
var rand = Math.random();	//roll the dice twice
var lon = Math.round(360 * rand);
var html = "<span id='long'>Long: " + lon + "</span><span id='lat'>Lat: " + lat + "</span>";
document.getElementById('special').innerHTML = html;


/*Second, perform the typing effect*/
if(document.getElementById('index')){
	var target_html = document.getElementById('content').innerHTML;
	document.getElementById('content').innerHTML = '';
	startTyping(target_html, 50, 'content');
}

//Typing helper function
function type(){
	var dest=document.getElementById(destination);
	dest.innerHTML=text.substr(0, currentChar);
	currentChar += num_chars;
	//make sure all of the text gets printed
	if (currentChar > text.length){
		currentChar = text.length;
    } 
	
	//if the text isn't finished printing, keep going
	if (document.getElementById('content').innerHTML != text){
        setTimeout("type()", delay);
 	}
}

//Typing helper function
function startTyping(textParam, delayParam, destinationParam){
	text=textParam;
	delay=delayParam;
	currentChar=1;
	destination=destinationParam;
	type();
}