// script for array variable definition
	function MakeArray(n) {
		this.length = n
	    for (var i = 1; i<=n; i++) {
	    	this[i] = new Image()
		}
	    return this
	}
	
// preload condo images
	pic = new MakeArray(9);
	pic[1].src = "images/pic1.jpg";
	pic[2].src = "images/pic2.jpg";
	pic[3].src = "images/pic3.jpg";
	pic[4].src = "images/pic4.jpg";
	pic[5].src = "images/pic5.jpg";
	pic[6].src = "images/pic6.jpg";
	pic[7].src = "images/pic7.jpg";
	pic[8].src = "images/pic8.jpg";
	pic[9].src = "images/pic9.jpg";
	

// preload descriptions
	text = new MakeArray(9);
	text[1].src = "images/text1.gif";
	text[2].src = "images/text2.gif";
	text[3].src = "images/text3.gif";
	text[4].src = "images/text4.gif";
	text[5].src = "images/text5.gif";
	text[6].src = "images/text6.gif";
	text[7].src = "images/text7.gif";
	text[8].src = "images/text8.gif";
	text[9].src = "images/text9.gif";

// preload buttons
	button_on = new MakeArray(9);
	button_on[1].src = "images/button1_on.gif";
	button_on[2].src = "images/button2_on.gif";
	button_on[3].src = "images/button3_on.gif";
	button_on[4].src = "images/button4_on.gif";
	button_on[5].src = "images/button5_on.gif";
	button_on[6].src = "images/button6_on.gif";
	button_on[7].src = "images/button7_on.gif";
	button_on[8].src = "images/button8_on.gif";
	button_on[9].src = "images/button9_on.gif";

	button_off = new MakeArray(9);
	button_off[1].src = "images/button1_off.gif";
	button_off[2].src = "images/button2_off.gif";
	button_off[3].src = "images/button3_off.gif";
	button_off[4].src = "images/button4_off.gif";
	button_off[5].src = "images/button5_off.gif";
	button_off[6].src = "images/button6_off.gif";
	button_off[7].src = "images/button7_off.gif";
	button_off[8].src = "images/button8_off.gif";
	button_off[9].src = "images/button9_off.gif";

// define which button is currently off/selected (# must match off button in html img src)
	nowOn = 1;

// script for switching images
	function Switch(newon) 
   {
		imgsrc=button_on[newon].src;
		name="button"+newon;
		document[name].src=imgsrc;

		imgsrc=button_off[nowOn].src;
		name="button"+nowOn;
		document[name].src=imgsrc;

		imgsrc=pic[newon].src;
		name="pic";
		document[name].src=imgsrc;

		imgsrc=text[newon].src;
		name="text";
		document[name].src=imgsrc;


		nowOn=newon;
   }

   function windowOpen()
   {
      var w=640;
      var h=480;


      if (window.screen) 
      {
         w = parseInt(window.screen.availWidth * 0.80);
         h = parseInt(window.screen.availHeight * 0.80);
         (w < 640) ? w = 640 : w = w;
         (h < 480) ? h = 480 : h = h;

         var left = Math.floor( (window.screen.availWidth - w) / 2);
         var top = Math.floor( (window.screen.availHeight - h) / 2);
      }
      
      
      var filename="/images/piclrg1.jpg";

      switch(nowOn)
      {
      case 1:
         filename="/images/piclrg1.jpg";
         break;
      case 2:
         filename="/images/piclrg2.jpg";
         break;
      case 3:
         filename="/images/piclrg3.jpg";
         break;
      case 4:
         filename="/images/piclrg4.jpg";
         break;
      case 5:
         filename="/images/piclrg5.jpg";
         break;
      case 6:
         filename="/images/piclrg6.jpg";
         break;
      case 7:
         filename="/images/piclrg7.jpg";
         break;
      case 8:
         filename="/images/piclrg8.jpg";
         break;
      case 9:
         filename="/images/piclrg9.jpg";
         break;
      }
      window.open(filename, 'LargePhoto', 'toolbar,scrollbars,resizable,copyhistory,width='+w+',height='+h+',left='+left+',top='+top);
      return;

   }
