// RANDOM COLOR

function allColorPick(){

	colorpick('div1');
	colorpick('div2');
	colorpick('div3');
	colorpick('div4');
	colorpick('div5');
	colorpick('div6');
}

function colorpick(myFoo)

{

 var choices=["#CFAA00","#826A00","#2F799C","#80D7FF","#008AA7","#00CAF2","#A65300","#F25100","#1BCC4D","#76FC00"];

 document.getElementById(myFoo).style.backgroundColor=choices[ Math.floor(Math.random()*choices.length) ];
 
}

// question mark thing!!

/*function questionAppear(){
	setTimeout("appear()",2000);
}

function appear(){
	document.getElementById('questionmark').style.visibility = "visible";
}*/


//FLAMINGOES

leftNum1 = (screen.width/2-125)-Math.ceil(Math.random()*250+40);
topNum1 = (screen.height/2-125)-Math.ceil(Math.random()*250+40);
leftNum2 = (screen.width/2-125)-Math.ceil(Math.random()*250+40);
topNum2 = (screen.height/2-125)+Math.ceil(Math.random()*250+40);
leftNum3 = (screen.width/2-125)+Math.ceil(Math.random()*250+40);
topNum3 = (screen.height/2-125)-Math.ceil(Math.random()*250+40);
leftNum4 = (screen.width/2-125)+Math.ceil(Math.random()*250+40);
topNum4 = (screen.height/2-125)+Math.ceil(Math.random()*250+40);

function open1(){

var fPage = ["f1.html","f2.html","f3.html","f4.html","f5.html","f6.html","f7.html","f8.html","f9.html","f10.html","f11.html","f12.html","f13.html","f14.html","f15.html","f16.html"];
var fPagePicker = fPage[ Math.floor(Math.random()*fPage.length) ];
var fPage2 = ["f1.html","f2.html","f3.html","f4.html","f5.html","f6.html","f7.html","f8.html","f9.html","f10.html","f11.html","f12.html","f13.html","f14.html","f15.html","f16.html"];
var fPagePicker2 = fPage2[ Math.floor(Math.random()*fPage2.length) ];
var fPage3 = ["f1.html","f2.html","f3.html","f4.html","f5.html","f6.html","f7.html","f8.html","f9.html","f10.html","f11.html","f12.html","f13.html","f14.html","f15.html","f16.html"];
var fPagePicker3 = fPage3[ Math.floor(Math.random()*fPage3.length) ];
var fPage4 = ["f1.html","f2.html","f3.html","f4.html","f5.html","f6.html","f7.html","f8.html","f9.html","f10.html","f11.html","f12.html","f13.html","f14.html","f15.html","f16.html"];
var fPagePicker4 = fPage4[ Math.floor(Math.random()*fPage4.length) ];

window.open('' + fPagePicker + '','f1','width=250, height=250, left=' + leftNum1 + ', top=' + topNum1 + ', resizeable=no, scrollbars=no, location=no, status=no');
window.open('' + fPagePicker2 + '','f2','width=250, height=250, left=' + leftNum2 + ', top=' + topNum2 + ', resizeable=no, scrollbars=no, location=no, status=no');
window.open('' + fPagePicker3 + '','f3','width=250, height=250, left=' + leftNum3 + ', top=' + topNum3 + ', resizeable=no, scrollbars=no, location=no, status=no');
window.open('' + fPagePicker4 + '','f4','width=250, height=250, left=' + leftNum4 + ', top=' + topNum4 + ', resizeable=no, scrollbars=no, location=no, status=no');
}

function moveTopLeft(){
	self.moveTo(generatorLeft(),generatorTop());
	open1();
}

function moveTopRight(){
	self.moveTo(generatorRight(),generatorBottom());
	open1();
}

function moveBottomLeft(){
	self.moveTo(generatorLeft(),generatorTop());
	open1();
}

function moveBottomRight(){
	self.moveTo(generatorRight(),generatorBottom());
	open1();
}
 
 function generatorLeft(){
	
	ulimateRnd = (screen.width/2-125) - Math.ceil(Math.random()*250+60);
	return (ulimateRnd);
}

 function generatorRight(){
	
	ulimateRnd = (screen.width/2-125) + Math.ceil(Math.random()*250+60);
	return (ulimateRnd);
}

 function generatorTop(){
	
	ulimateRnd = (screen.height/2-125) - Math.ceil(Math.random()*250+60);
	return (ulimateRnd);
}

 function generatorBottom(){
	
	ulimateRnd = (screen.height/2-125) - Math.ceil(Math.random()*250+60);
	return (ulimateRnd);
}

//CURBSIDE GETAWAY

var cbCenterW = (screen.width/2-350);
var cbCenterH = (screen.height/2-250);

function open2(){

window.open('curbside_getaway.html','cb','width=700, height=500, left=' + cbCenterW + ', top=' + cbCenterH + ', resizeable=no, scrollbars=no, location=no, status=no');
}

function showIt(myFoo) {
	
 var cbChoices=["images/monster1.jpg","images/monster2.jpg","images/monster3.jpg","images/monster4.jpg","images/monster5.jpg"];
 document.getElementById(myFoo).style.backgroundImage = "url(" + cbChoices[ Math.floor(Math.random()*cbChoices.length) ] + ")";
 

if (document.getElementById)
{document.getElementById(myFoo).style.visibility = "visible";}
else
{if (document.layers)
{document.layers[myFoo].visibility = "show";}
else
{document.all(myFoo).style.visibility = "visible";}
}
}

function hideIt(myFoo) {
if (document.getElementById)
{document.getElementById(myFoo).style.visibility = "hidden";}
else
{if (document.layers)
{document.layers[myFoo].visibility = "hide";}
else
{document.all(myFoo).style.visibility = "hidden";}
}
}

var p = 1;

function colorBW() {
	
	if (p == 1) {
		toColor();
		p = 2;
	}
	else if (p == 2) {
		toBW();
		p = 1;
	}

function toColor(){
	document.mainphoto.src = 'images/cb2.jpg';
}

function toBW(){
	document.mainphoto.src = "images/cb1.jpg";
}

}

// PLANTS

var PCenterW = (screen.width/2-270);
//var PCenterH = (screen.height/2-300)

function open3(){
window.open('plants.html','plants','width=541, height=233, left=' + PCenterW + ', top=50, resizeable=no, scrollbars=no, location=no, status=no');
}

var startstop;
var stopPlant1;
var stopPlant2;
var stopPlant3;
var activeTransitions = {};


      function allPlantPick(plantId)
      {
          activeTransitions[plantId] = setTimeout(
                    function()
                    {
                        plantPick(plantId);
                        allPlantPick(plantId);
                    },
                    plantTimer()
                );
      }
      for(var i = 1; i < 4; ++i)
      {
          allPlantPick('plant' + i);
      }
	
function plantTimer() {

	var plantNum = (Math.random()*500) + 1000;
	return(plantNum);
	
}
		
function plantPick(myFoo){

 var plantChoices=["images/p1.jpg","images/p2.jpg","images/p3.jpg","images/p4.jpg","images/p5.jpg","images/p6.jpg","images/p7.jpg","images/p8.jpg","images/p9.jpg","images/p10.jpg","images/p11.jpg","images/p12.jpg","images/p13.jpg","images/p14.jpg","images/p15.jpg","images/p16.jpg","images/p17.jpg","images/p18.jpg","images/p19.jpg","images/p20.jpg","images/p21.jpg","images/p22.jpg","images/p23.jpg","images/p24.jpg","images/p25.jpg","images/p26.jpg","images/p27.jpg","images/p28.jpg","images/p29.jpg","images/p30.jpg","images/pblack.gif","images/pblack.gif","images/pblack.gif","images/pblack.gif","images/pblack.gif"];
 
 document.getElementById(myFoo).style.backgroundImage = "url(" + plantChoices[ Math.floor(Math.random()*plantChoices.length) ] + ")";
}

var q = 1;
var r = 1;
var s = 1;

function pStopGo1() {
	
	if (q == 1) {
		stopPlant1();
		q = 2;
	}
	else if (q == 2) {
		goPlant1();
		q = 1;
	}

function stopPlant1(){
	clearTimeout(activeTransitions['plant1']);
}

function goPlant1(){
	allPlantPick('plant1');
}

}

function pStopGo2() {
	
	if (r == 1) {
		stopPlant2();
		r = 2;
	}
	else if (r == 2) {
		goPlant2();
		r = 1;
	}

function stopPlant2(){
	clearTimeout(activeTransitions['plant2']);
}

function goPlant2(){
	allPlantPick('plant2');
}

}

function pStopGo3() {
	
	if (s == 1) {
		stopPlant3();
		s = 2;
	}
	else if (s == 2) {
		goPlant3();
		s = 1;
	}

function stopPlant3(){
	clearTimeout(activeTransitions['plant3']);
}

function goPlant3(){
	allPlantPick('plant3');
}

}

//POND

var pondCenterW = (screen.width/2-351);
var pondCenterH = (screen.height/2-150);

function open4(){
	window.open('pond.html','pond','width=750, height=500, left=' + pondCenterW + ', top=' + pondCenterH + ', resizeable=no, scrollbars=no, location=no, status=no');
	
}


function pondPick1(myFoo) {
	
 var pondChoices1=["images/pondpiece1a.jpg","images/pondpiece1b.jpg","images/pondpiece1c.jpg",];
 document.getElementById(myFoo).style.backgroundImage = "url(" + pondChoices1[ Math.floor(Math.random()*pondChoices1.length) ] + ")";
 
}

function pondPick2(myFoo) {
	
 var pondChoices2=["images/pondpiece2a.jpg","images/pondpiece2b.jpg","images/pondpiece2c.jpg",];
 document.getElementById(myFoo).style.backgroundImage = "url(" + pondChoices2[ Math.floor(Math.random()*pondChoices2.length) ] + ")";
 
}

function pondPick3(myFoo) {
	
 var pondChoices3=["images/pondpiece3a.jpg","images/pondpiece3b.jpg","images/pondpiece3c.jpg",];
 document.getElementById(myFoo).style.backgroundImage = "url(" + pondChoices3[ Math.floor(Math.random()*pondChoices3.length) ] + ")";
 
}

function rollOffPond1(){
window.setTimeout("backToPondPick1()", 3000);
}

function rollOffPond2(){
window.setTimeout("backToPondPick2()", 3000);
}

function rollOffPond3(){
window.setTimeout("backToPondPick3()", 3000);
}

function backToPondPick1() {
	 document.getElementById('pond_viewer1').style.backgroundImage = "url(images/pixelanimation1.gif)";
}

function backToPondPick2() {
	 document.getElementById('pond_viewer2').style.backgroundImage = "url(images/pixelanimation2.gif)";
}

function backToPondPick3() {
	 document.getElementById('pond_viewer3').style.backgroundImage = "url(images/pixelanimation3.gif)";
}


function pondShow() {
	
 var psChoices=["images/pond_main_1.jpg","images/pond_main_2.jpg","images/pond_main_3.jpg",];
 document.pondmain.src = psChoices[ Math.floor(Math.random()*psChoices.length) ];
 setTimeout("pondShow()", 6000);
}
	
/*var t = 1;
var u = 1;
var v = 1;


function pondCheck(){
	
	if (document.pondmain.src == 'images/pond_main_1.jpg') {
	  alert("this is 1");
		pondFlip1();

	}
	else if (document.pondmain.src == 'images/pond_main_2.jpg') {
		alert("this is 2");
		pondFlip2();
	}
	else{
		alert("this is 3");
		pondFlip3();
	}


function pondFlip1(){
	if (t == 1){
		document.pondmain.src = 'images/pond_reverse_1.jpg';
		t = 2;
	}
	else if (t == 2){
		document.pondmain.src = 'images/pond_main_1.jpg';
		t = 1;
	}
}

function pondFlip2(){
	if (u == 1){
		document.pondmain.src = 'images/pond_reverse_2.jpg';
		u = 2;
	}
	else if (u == 2){
		document.pondmain.src = 'images/pond_main_2.jpg';
		u = 1;
	}
}

function pondFlip3(){
	if (v == 1){
		document.pondmain.src = 'images/pond_reverse_3.jpg';
		v = 2;
	}
	else if (v == 2){
		document.pondmain.src = 'images/pond_main_3.jpg';
		v = 1;
	}
}

}*/


// SHELVES

var leftCenter = (screen.width/2-400);
var rightCenter = (screen.width/2)
var top = (screen.height/2-300)

function open5(){
window.open('shelflife.html','shelflife','width=400, height=500, left=' + leftCenter + ', top=' + top + ', resizeable=no, scrollbars=no, location=no, status=no');
window.open('shelves.html','shelves','width=400, height=500, left=' + rightCenter + ', top=' + top + ', resizeable=no, scrollbars=no, location=no, status=no');
}


// INFO


var infoW = (screen.width/2+100);
var infoH = (screen.height/2-120);

function open6(){

window.open('info.html','info','width=240, height=240, left=' + infoW + ', top=' + infoH + ', resizeable=no, scrollbars=no, location=no, status=no');
}	




	

		