// JavaScript Document
// function for make random
// random dando parametro de menor y mayor ---------------------
	//var lo=0; //  0 = false
	//var hi=1; // 1= true
	//var diceRoll= Math.floor(Math.random()*(hi - lo+1) +lo);
	//document.writeln("<p> Dados: " + diceRoll + "</p>"); 
	//document.writeln("<p> Tipo: " + ((diceRoll)?"Corazon":"Espada")+ "</p>");
	
var frase = new Array("Little and often makes much.","The days you work are the best days.","Today is a lucky day for those who remain cheerful and optimistic.","If you continually give, you will continually have.","You were born with the skill to communicate with people easily.","The hard times will begin to fade, joy will take their place. ","The first step to better times is to imagine them.","Ideas are like children; there are none so wonderful as your own.","When you speak honestly and openly, others truly listen to you.","Trust your intuition. The universe is guiding your life.","It doesn't matter. Who is without a flaw? ","It is much wiser to take advice than to give it.","Many a false step is made by standing still.","A thrilling time is in your immediate future.","You should be able to make money and hold on to it.","The skills you have gathered will one day come in handy.","Every excess becomes a vice.","Be direct, usually one can accomplish more that way.","Keep in close touch with what your competition is doing.","Your skill will accomplish what the force of many cannot","Your talents will be recognized and suitably rewarded." );	

function randomInteger(size) {
	return Math.floor((size+1)*Math.random());
}

		
function sortFrase() {
		var lo=0; //  0 = false
		var hi=20; // 1= true
		var imgNumber= Math.floor(Math.random()*(hi - lo+1) +lo);
		var txtFrase= frase[imgNumber];
		//document.write("<p>" + txtFrase + "</p>");
		return txtFrase;
}

function sortImg() {
		var lo=0; //  0 = false
		var hi=30; // 1= true
		var imgNumber= Math.floor(Math.random()*(hi - lo+1) +lo);
		var file="photo"+imgNumber+".png";

		return file;
}

function showIMG1() {
		// Shows an Image
		var lo=1; //  0 = false
		var hi=30; // 1= true
		var imgNumber= Math.floor(Math.random()*(hi - lo+1) +lo);
		var file="photo"+imgNumber+".png";
		var fortuneTag = document.getElementById("fortunPic1");
		fortuneTag.innerHTML  = ("<img src='images/slogan_buttons/photo"+imgNumber+".png'/>")
		var phraseTag = document.getElementById("phrase");
		phraseTag.innerHTML = ("<p class='style_fortunebutton'>"+sortFrase()+"</p>");
		showIMG2();
		showIMG3();
		showIMG4();
}
function showIMG2() {
		// Shows an Image
		var lo=1; //  0 = false
		var hi=30; // 1= true
		var imgNumber= Math.floor(Math.random()*(hi - lo+1) +lo);
		var file="photo"+imgNumber+".png";
		var fortuneTag = document.getElementById("fortunPic2");
		fortuneTag.innerHTML  = ("<img src='images/slogan_buttons/photo"+imgNumber+".png'/>")
}

function showIMG3() {
		// Shows an Image
		var lo=1; //  0 = false
		var hi=30; // 1= true
		var imgNumber= Math.floor(Math.random()*(hi - lo+1) +lo);
		var file="photo"+imgNumber+".png";
		var fortuneTag = document.getElementById("fortunPic3");
		fortuneTag.innerHTML  = ("<img src='images/slogan_buttons/photo"+imgNumber+".png'/>")
}

function showIMG4() {
		// Shows an Image
		var lo=1; //  0 = false
		var hi=30; // 1= true
		var imgNumber= Math.floor(Math.random()*(hi - lo+1) +lo);
		var file="photo"+imgNumber+".png";
		var fortuneTag = document.getElementById("fortunPic4");
		fortuneTag.innerHTML  = ("<img src='images/slogan_buttons/photo"+imgNumber+".png'/>")
}
function swapPic( file ) {
		var imageTag = document.getElementById("fortune");
		imageTag.src = file;
}
