function goDoIt()
{
	
	foo = document.getElementById("num").value
	bar = document.getElementById("results")
	
	while(bar.childNodes.length >0)
	{
		bar.removeChild(bar.firstChild)
	}
	
	
	
	if(foo != (Math.round(0+foo)))
	{
		return false
	}
	
	
	setTimeout("primalScream()" , 50)
	
}

function primalScream()
{
	//2s are special, other primes are odd
	while(foo/2 == Math.round(foo/2))
	{
		foo = foo/2
		bar.appendChild(document.createTextNode(2))
		bar.appendChild(document.createElement("br"))
	}
	
	feh = 3
	
	while(foo>1)
	{
		
		
		if(foo/feh == Math.round(foo/feh))
		{
			foo = foo/feh
			bar.appendChild(document.createTextNode(feh))
			bar.appendChild(document.createElement("br"))
		}
		else
		{
			feh+=2
		}
		
		
	}
	
	
}


