
	var Q_NUMERO,IK_NUMERO,QSIZ;
	IK_NUMERO = -1;
	QSIZ = 0;
	
	var kuvaPolku = "images/kuvaBoksi/";
	var slideimages=new Array(kuvaPolku + "0.jpg",kuvaPolku + "1.jpg",kuvaPolku + "2.jpg",kuvaPolku + "3.jpg",kuvaPolku + "4.jpg",kuvaPolku + "5.jpg",kuvaPolku + "6.jpg")
	var imgobj,imgobj0;
	var imageholder=new Array()
	imgobj0 = new Image();
	imgobj0.src= kuvaPolku + "0.jpg";

	var quotesArray = new Array();

	function lisaaQ(quoteSisalto){
		quotesArray[QSIZ] = quoteSisalto;
		QSIZ++;
	}
	 
	
	lisaaQ("I am not young enough to know everything.<br><i>-Oscar Wilde (1854-1900)</i>");
	lisaaQ("If you haven't made any mistakes, you have never done anything worth doing.<br><i>-Mr Baker</i>"); 
	lisaaQ("No matter where you go, there you are.<br><i>-Buckaroo Banzai, from the Adventures of</i>");
	lisaaQ("Don't be dismayed at good-byes. A farewell is necessary before you can meet again. And meeting again, after moments or lifetimes, is certain for those who are friends.");
	lisaaQ("Laugh, and the world laughs with you. Weep, and you weep alone. For the sad old earth must borrow its mirth, But has trouble enough of its own. <br>-<i>Ella Wheeler Wilcox (1855-1919)</i>");
	lisaaQ("Ainoa merkitt&auml;v&auml; asia el&auml;m&auml;ss&auml;mme, johon voimme vaikuttaa, on se teemmek&ouml; siin&auml; hyv&auml;&auml; vai pahaa.<i>-Stargate</i>"); 
	lisaaQ("Viisaat sanat putoavat usein hedelm&auml;tt&ouml;m&auml;&auml;n maahan, mutta yst&auml;v&auml;llist&auml; sanaa ei koskaan heitet&auml; pois. - <i>Arthur Helps</i>");
	lisaaQ("I Am A Liberal. There, I Said It! <i>-George Clooney</i>");
	lisaaQ("&Auml;l&auml; ylit&auml; siltoja ennen niille saapumistasi, sill&auml; kukaan ei viel&auml; t&auml;h&auml;n menness&auml; ole siin&auml; onistunut."); 
	lisaaQ("If you wish to travel far and fast, travel light. Take off all your envies, jealousies, unforgiveness, selfishness and fears. -<i> Cesare Pavese</i>");
	lisaaQ("Democracy does not guarantee equality of conditions - it only guarantees equality of opportunity. <i>-Irving Kristol</i>");
	lisaaQ("Ei voi tuntea kuin sen, jonka on itse kesytt&auml;nyt. - <i> Pikku Prinssi</i>");
	lisaaQ("If a man is not a socialist by the time he is 20, he has no heart.<br>If he is not a conservative by the time he is 40, he has no brain.<br>-<i>Winston Churchill</i>");
	lisaaQ("There is no sincerer love than the love of food.<br><i>-George Bernard Shaw (1856-1950)</i>");
	lisaaQ("El&auml;minen on kallista, mutta siihen sis&auml;ltyy matka auringon ymp&auml;ri kerran vuodessa.");
	lisaaQ("If you want to get something done, ask a busy person.");
	lisaaQ("The glass is neither half full nor half empty rather\; it is twice as big as it needs to be.");
	lisaaQ("Wealth of information creates a poverty of attention. <i>-Herbert Alexander Simon</i>");
	lisaaQ("The power of accurate observation is frequently called cynicism by those who don't have it. <i>-George Bernard Shaw (1856-1950)</i>");
	lisaaQ("The cynic knows the price of everything and the value of nothing. <i>-Oscar Wilde</i>");
	lisaaQ("Yst&auml;v&auml;t ovat kuin t&auml;hti&auml;. Vaikka et aina n&auml;e heit&auml;, tied&auml;t heid&auml;n tuikkivan kirkkaasti tuolla jossakin.");
	lisaaQ("One measure of friendship consists not in the number of things friends can discuss, but in the number of things they need no longer mention. - <i>Clifton Fadiman</i>");
	lisaaQ("Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. <i>-Antoine de Saint Exupery</i>");				
	lisaaQ("Everybody pities the weak\; jealousy you have to earn.<br>-Arnold Schwarzenegger (1947-)");	
	lisaaQ("People say that what we're all seeking is the meaning of life. I think that what we're really seeking is the experience of being alive. - <i>Rudyard Kipling </i>");	
	lisaaQ("Jokainen ihminen on pieni maailma.");

	
	function lataaMonimutkainenSivu(){
		window.location.href="index.html?mode=more";
	}

	function lataaSimppelempiSivu(){
		window.location.href="index.html";
	}
 
	function arvoLeveysKoord(nayttoL){
	//w730 /2
		var siirrakuvaL=(Math.floor(Math.random()*465));	
		var plusMinus = (Math.floor(Math.random()*2));	
		if(plusMinus>0){
			siirrakuvaL = (nayttoL/2 ) + siirrakuvaL -50;
		}else{
			siirrakuvaL = (nayttoL/2 ) - siirrakuvaL -30;
		}
		return(siirrakuvaL);
	}

	function arvoKorkeusKoord(nayttoK){
		//h420 /2
		var siirrakuvaT=(Math.floor(Math.random()*310));	
		var plusMinus = (Math.floor(Math.random()*2));	
		if(plusMinus>0){
			siirrakuvaT = (nayttoK/2 ) + siirrakuvaT-80;
		}else{
			siirrakuvaT = (nayttoK/2 ) - siirrakuvaT;
		}
		return(siirrakuvaT);
	}

	function arvoTavarat(tavaranNimi,eiT){
		var retVal = false;
		if(!eiT){
			eiT = -1000;
		}
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
	  	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		var laskuri=0;
		if (document.layers){
			var picture1=eval("document." + tavaranNimi);
	   	}
		if (document.all){
		  var picture1=eval("document.all." + tavaranNimi + ".style");  
		}
		if(document.layers || document.all){
			if(myWidth>730 && myHeight > 420){
					var siirrakuvaL = arvoLeveysKoord(myWidth);
					var siirrakuvaT = arvoKorkeusKoord(myHeight);
					if(siirrakuvaL > ((myWidth/2) -410) && siirrakuvaL < ((myWidth/2) +365)){
						laskuri=0;
						while( (siirrakuvaT > ((myHeight/2) -275) && siirrakuvaT < ((myHeight/2) +205))){
							siirrakuvaT=arvoKorkeusKoord(myHeight);
							laskuri++;
							if(laskuri>40){
								break;
							}							
						}
					}
				   picture1.left=siirrakuvaL;
				   picture1.top=siirrakuvaT;	
				   changeElementVisibility(tavaranNimi,'visible');			
				}
			   return(siirrakuvaT);
		} // if doc all
		return false;
	}

	function arvoTaustakuva(){
		if (document.body) {
		   var randNumb = (Math.floor(Math.random()*11));	
		   if(randNumb>1){
				document.body.style.backgroundImage = 'url(images/sivutausta1.gif)';
		   }
		   else{
			   	document.body.style.backgroundImage = 'url(images/sivuTausta3.jpg)';
		   }
		 }
	}

	function monimutkaistaSivu(){
		arvoTaustakuva();
		changeElementVisibility('boksi2','visible');
		changeElementVisibility('boksi3','visible');
		changeElementVisibility('boksi4','visible');
		changeElementVisibility('boksi5','visible');
		changeElementVisibility('boksi6','visible');
		changeElementVisibility('boksi7','visible');												
		changeElementVisibility('boksi1LinkMore','hidden');
		changeElementVisibility('boksi1LinkLess','visible');
		changeElementVisibility('boksiIsoTausta','visible');				
		//changeElementVisibility('banner1','hidden');
		var korkeus=arvoTavarat("randomTavara" + Math.floor(Math.random()*2),false);

	}

	function simppeloiSivu(){
		changeElementVisibility('boksi2','hidden');
		changeElementVisibility('boksi3','hidden');
		changeElementVisibility('boksi4','hidden');
		changeElementVisibility('boksi5','hidden');		
		changeElementVisibility('boksi6','hidden');				
		changeElementVisibility('boksi7','hidden');						
		changeElementVisibility('boksi1LinkMore','visible');
		changeElementVisibility('boksi1LinkLess','hidden');
		changeElementVisibility('boksiIsoTausta','hidden');			
		changeElementVisibility('randomTavara1','hidden');		
		//changeElementVisibility('banner1','visible');
	}

	function BSGenerator(qNumero){
		var sisaltoa;
		if(!qNumero){
			var sattumaNumero=Math.floor(Math.random()*QSIZ);
		}else{
			var sattumaNumero = qNumero;
		}
		sisaltoa = quotesArray[sattumaNumero];
		return sisaltoa;
	}
	
	function tyrkkaaLoremIpsumeita(){

		var ipsumitBoksiin = BSGenerator(Q_NUMERO);
		var showQuote = "";
		modifyElementContent('boksi4Sisalto','<a href="javascript:void(0)" onClick="vaihdaQuote();" class="vaaleanHarmaaFonttiLinkki">' + ipsumitBoksiin + '</a>');
	}
	
	function vaihdaQuote(){
		if(Q_NUMERO || Q_NUMERO==0){
				if(Q_NUMERO < QSIZ-1){
					Q_NUMERO++;
				}
		}
		else{
			Q_NUMERO = 0;
		}
		tyrkkaaLoremIpsumeita();
	}
	
	
	function esilataa(){
		for (i=0;i<slideimages.length;i++){ //preload images
			imageholder[i]=new Image()
			imageholder[i].src=slideimages[i]
		}
	}
	
	function vaihdaIsoKuva(tiettykuva){
		var painoR= Math.floor(Math.random()*100);
		imgobj=document.getElementById("slideshow") //access img obj
		if(IK_NUMERO<0 && !tiettykuva){
			imgobj.src = imgobj0.src;
			esilataa();
		}		
		if(tiettykuva){
			imageholder[0]=new Image()
			if(painoR<30){
				imageholder[0].src=slideimages[1];
			}
			else if(painoR>=30 && painoR<60){
				imageholder[0].src=slideimages[4];
			}
			else{
				imageholder[0].src=slideimages[tiettykuva];
			}
			imgobj.src=imageholder[0].src;
		}else{
			if(IK_NUMERO == 0){
				imgobj.src = imgobj0.src;
			}
			if(IK_NUMERO > 0){
				imgobj.src=imageholder[IK_NUMERO].src;
			}
			if(IK_NUMERO == -1){
				IK_NUMERO = 0;
			}
			if(IK_NUMERO < 6){
				IK_NUMERO++;
			}
			else{
				IK_NUMERO = 0;
			}
		}
	}
	
	function lataaIndexPageKuva(){
		var searchUrlValueIndex = window.location + '';
		if(searchUrlValueIndex.indexOf("file:")!=-1){
			imagesPath = "../eikka.info/images/";
		}
		else{
			imagesPath = "images/";
		}
		footerIndexImage = new Image();
		footerIndexImage.src = imagesPath + "index_cow__by_dutchie17.gif";
		footerIndexImageSlot=document.getElementById("indexPageFooterImgSlot") //access img obj
		footerIndexImageSlot.src = footerIndexImage.src;
	}

	function lataaSivu(){
		if(request2("mode")=="more"){
			monimutkaistaSivu();
			tyrkkaaLoremIpsumeita();
			vaihdaIsoKuva(Math.floor(Math.random()*7));
			changeTdBackground('boksi7td','boksi7BgImage',3,-1);			
			frames['earthView'].location.href = "earthView.html";
			lataaIndexPageKuva();
		}
		else{
			lataaIndexPageKuva();
		}
	}
