var currentFace;
var currentQuote;

function showrandom(id) {
	var i = randomNumber(id) + 1;
	var myFace = '';
	var myQuote = '';
	
	if (i < 10) {
		myFace = 'face0' + i.toString();
		myQuote = 'quote0' + i.toString();
	} else {
		myFace = 'face' + i.toString();
		myQuote = 'quote' + i.toString();
	}
	currentFace = myFace;
	currentQuote = myQuote;
	myelmntf = document.getElementById(myFace);
	myelmntf.style.backgroundPosition = '0 0';
	myelmntq = document.getElementById(myQuote);
	myelmntq.style.display = '';
}
function showFQ(idf, idq) {
	if (idf != currentFace) {
		myelmntf = document.getElementById(currentFace);
		myelmntf.style.backgroundPosition = '-62px 0';
		myelmntq = document.getElementById(currentQuote);
		myelmntq.style.display = 'none';
		myelmntf = document.getElementById(idf);
		myelmntf.style.backgroundPosition = '0 0';
		myelmntq = document.getElementById(idq);
		myelmntq.style.display = '';
		currentFace = idf;
		currentQuote = idq;
	} 
}
function randomNumber(limit){
  return Math.floor(Math.random()*limit);
}
function messageWindow(title, msg)
{
  var width="300", height="525";
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  var msgWindow = window.open("","msgWindow", styleStr);
  var head = '<head><title>'+title+'</title></head>';
  var body = '<center>'+msg+'<br><p><form><input type="button" value="   Done   " onClick="self.close()"></form>';
  msgWindow.document.write(head + body);
}