var propertyNumber = 0, tim, fade = 0, fadeOut = 0, ieFade = 0, pause = 0, fader, browser, scrollsteps, downscrolltimer, scrolledamount = 0;





browser = navigator.appName;



var obj                 = window.document.getElementById("fadeImg");



//PhotoCaptions

















function opacity( num, client)

 {

 switch ( num )

  {

  case 0:

         ief = 1;

         ff  = 100;

  break;



  case 1:

         ief = 0.9;

         ff  = 90;

  break;



  case 2:

         ief = 0.8;

         ff  = 80;

  break;



  case 3:

         ief = 0.7;

         ff  = 70;

  break;



  case 4:

         ief = 0.6;

         ff  = 60;

  break;



  case 5:

         ief = 0.5;

         ff  = 50;

  break;



  case 6:

         ief = 0.4;

         ff  = 40;

  break;



  case 7:

         ief = 0.3;

         ff  = 30;

  break;



  case 8:

         ief = 0.2;

         ff  = 20;

  break;



  case 9:

         ief = 0.1;

         ff  = 10;

  break;



  case 10:

         ief = 0;

         ff  = 0;

  break;

  }



  if ( client == 1 )

   {

    return ief;

   }

   else

   {

    return ff;

   }



 }



 function opacity1( num, client)

  {

  switch ( num )

   {

   case 0:

          ief = 0;

          ff  = 0;

   break;



   case 1:

          ief = 0.1;

          ff  = 10;

   break;



   case 2:

          ief = 0.2;

          ff  = 20;

   break;



   case 3:

          ief = 0.3;

          ff  = 30;

   break;



   case 4:

          ief = 0.4;

          ff  = 40;

   break;



   case 5:

          ief = 0.5;

          ff  = 50;

   break;



   case 6:

          ief = 0.6;

          ff  = 60;

   break;



   case 7:

          ief = 0.7;

          ff  = 70;

   break;



   case 8:

          ief = 0.8;

          ff  = 80;

   break;



   case 9:

          ief = 0.9;

          ff  = 90;

   break;



   case 10:

          ief = 100;

          ff  = 99;

   break;

   }



   if ( client == 1 )

    {

     return ief;

    }

    else

    {

     return ff;

    }



 }



function scroll_down()

 {

 //scrollsteps = scrollsteps - 1;

 

 scrolledamount = scrolledamount + 1;

 

 

 if(scrolledamount > 40  )

  {

  window.clearTimeout(downscrolltimer);

  fade = 0;

  fade_out();

  }

  else

  {

  obj.style.marginTop = "-" + scrolledamount	 + "px";

  downscrolltimer = window.setTimeout( "scroll_down()", 100);

  }

 

 }



function start_fade_in()

 {

       obj            = window.document.getElementById("fadeImg");

captionBox1    = window.document.getElementById("captionBox"); 





  if( browser !== "Microsoft Internet Explorer")

   {

    fadeValue = opacity1( fade , '1');



    obj.style.opacity              = fadeValue;

    captionBox1.style.opacity              = fadeValue;





   }



  if( browser == "Microsoft Internet Explorer")

   {

    fadeValue = opacity1( fade , '2');

    obj.filters.item("DXImageTransform.Microsoft.Alpha").opacity            = fadeValue;

    captionBox1.filters.item("DXImageTransform.Microsoft.Alpha").opacity       = fadeValue;

    }





  if(fade < 10)

   {

   fade = fade + 1;

   fader = window.setTimeout( "start_fade_in()", 100);

   }

     else

      {

        //terminate interval

	    window.clearTimeout( fader );

	     if( browser == "Microsoft Internet Explorer")

              {

              fadeValue = "100";

              obj.filters.item("DXImageTransform.Microsoft.Alpha").opacity            = fadeValue;

              }

              

              if(obj.height > 200)

               {

               scrollsteps = obj.height - 200 / 2;

               scrolledamount = 0;

               scroll_down();

               }

               else

               {

               fade = 0;

               fade_out();

               }

	

      }

 }



function switch_caption_txt()

 {

 

 var oUl = document.getElementById("captionList");

     

      

     if( browser == "Microsoft Internet Explorer")

       {

        tmp = oUl.childNodes[0].innerHTML;

        }else{

        tmp = oUl.childNodes[1].innerHTML;

        }

     

        oUl.childNodes[0].innerHTML  = oUl.childNodes[1].innerHTML;

        oUl.childNodes[1].innerHTML  = oUl.childNodes[2].innerHTML;

        oUl.childNodes[2].innerHTML  = oUl.childNodes[3].innerHTML;

        oUl.childNodes[3].innerHTML  = oUl.childNodes[4].innerHTML; 

        oUl.childNodes[4].innerHTML  = oUl.childNodes[5].innerHTML;

        oUl.childNodes[5].innerHTML  = oUl.childNodes[6].innerHTML;

        oUl.childNodes[6].innerHTML  = oUl.childNodes[7].innerHTML;

        oUl.childNodes[7].innerHTML  = oUl.childNodes[8].innerHTML;

        oUl.childNodes[8].innerHTML  = oUl.childNodes[9].innerHTML;

        oUl.childNodes[9].innerHTML  = oUl.childNodes[10].innerHTML;

        oUl.childNodes[10].innerHTML = oUl.childNodes[11].innerHTML;

        oUl.childNodes[11].innerHTML = oUl.childNodes[12].innerHTML;

        oUl.childNodes[12].innerHTML = oUl.childNodes[13].innerHTML;

        oUl.childNodes[13].innerHTML = oUl.childNodes[14].innerHTML;

        oUl.childNodes[14].innerHTML = oUl.childNodes[15].innerHTML;

        oUl.childNodes[15].innerHTML = oUl.childNodes[16].innerHTML;

        oUl.childNodes[16].innerHTML = oUl.childNodes[17].innerHTML;

        oUl.childNodes[17].innerHTML = oUl.childNodes[18].innerHTML;

        oUl.childNodes[18].innerHTML = oUl.childNodes[19].innerHTML;

        oUl.childNodes[19].innerHTML = oUl.childNodes[20].innerHTML;

        oUl.childNodes[20].innerHTML = oUl.childNodes[21].innerHTML;

        oUl.childNodes[21].innerHTML = oUl.childNodes[22].innerHTML;

        oUl.childNodes[22].innerHTML = oUl.childNodes[23].innerHTML;

        oUl.childNodes[23].innerHTML = oUl.childNodes[24].innerHTML;

        oUl.childNodes[24].innerHTML = oUl.childNodes[25].innerHTML;

        oUl.childNodes[25].innerHTML = oUl.childNodes[26].innerHTML;

        oUl.childNodes[26].innerHTML = oUl.childNodes[27].innerHTML;

	oUl.childNodes[27].innerHTML = oUl.childNodes[28].innerHTML;

	oUl.childNodes[28].innerHTML = oUl.childNodes[29].innerHTML;

	oUl.childNodes[29].innerHTML = oUl.childNodes[30].innerHTML;

	oUl.childNodes[30].innerHTML = oUl.childNodes[31].innerHTML;

	oUl.childNodes[31].innerHTML = oUl.childNodes[32].innerHTML;

	oUl.childNodes[32].innerHTML = oUl.childNodes[33].innerHTML;

	oUl.childNodes[33].innerHTML = oUl.childNodes[34].innerHTML;

        oUl.childNodes[34].innerHTML = tmp;

        tmp;

        //oUl.childNodes[20].innerHTML = tmp;

        

        

    

      if(propertyNumber == 0)

     	      {

     	    	    set_ul();

     	    	  	    	    

	      }

 

   



 

  start_fade_in();

 }



function start_fade_out()

 {



 obj            = window.document.getElementById("fadeImg");



 captionBox1    = window.document.getElementById("captionBox"); 

 

 next = propertyNumber + 1;

 var preload = new Image();

preload.src = a[next];



  if( browser !== "Microsoft Internet Explorer")

   {

    fadeValue = opacity( fade , '1');



    obj.style.opacity                      = fadeValue;

    captionBox1.style.opacity              = fadeValue;





   }



  if( browser == "Microsoft Internet Explorer")

   {

    fadeValue = opacity( fade , '2');

    captionBox1.filters.item("DXImageTransform.Microsoft.Alpha").opacity       = fadeValue;

    obj.filters.item("DXImageTransform.Microsoft.Alpha").opacity               = fadeValue;

    



    }







  if(fade < 11)

   {

   fade = fade + 1;

   fader = window.setTimeout( "start_fade_out()", 100);

   }

     else

      {

        //terminate interval

	    window.clearTimeout( fader );

	    fade = 0;

	    

	    obj.src                  = a[propertyNumber];

            obj.style.marginTop = "0px";

            switch_caption_txt();

        

      }

 }







function fade_out()

 {











   if(pause < 9 )

    {

      pause = pause + 1;

     tim = window.setTimeout( "fade_out()", 1000);



    }



      if( pause > 8 )

	   {

	   pause = 0;

	    propertyNumber = propertyNumber + 1;

	   window.clearTimeout( tim );



	   if(propertyNumber == 35)

	    {

	    propertyNumber = 0;

	    }

	    start_fade_out();

	    }



















 }



function set_ul()

 {

var oUl = document.getElementById("captionList");

 if( browser == "Microsoft Internet Explorer")

   {

  oUl.childNodes[0].innerHTML  = "Howdy Folks!  Welcome to Golden.";

  oUl.childNodes[1].innerHTML  = "Golden's historic downtown is a favorite spot for local residents and tourists alike.";

 oUl.childNodes[2].innerHTML  = "Golden is nestled against the foothills of the Rocky Mountains in between the North and the South Table Top Mountains.";

 oUl.childNodes[3].innerHTML  = "Several Bronze statues throughout the downtown area depict life in the 1800's in Golden.";

 oUl.childNodes[4].innerHTML  = "Area residents enjoy shopping in many unique shops and galleries.";

 oUl.childNodes[5].innerHTML  = "Another Golden gallery.";

 

 oUl.childNodes[6].innerHTML  = "Yet another great place to find a unique treasure.";

 oUl.childNodes[7].innerHTML  = "A stroll through downtown Golden is a walk through history.";

 oUl.childNodes[8].innerHTML  = "Golden residents have many opportunities to enjoy local arts and crafts.";

 oUl.childNodes[9].innerHTML  = "Residents enjoy many outdoor cafes and coffee shops.";

 oUl.childNodes[10].innerHTML  = "Golden's history is rich with gold mining and the Mining Museum is a very popular attraction for residents of all ages.";

oUl.childNodes[11].innerHTML  = "Golden has many parks for its' residents to enjoy.";

 oUl.childNodes[12].innerHTML  = "Parfet Park in downtown Golden is a beautiful place to enjoy a relaxing summer afternoon.";

oUl.childNodes[13].innerHTML  = "The Golden Community Center offers many diverse activities and is enjoyed by all.";

 oUl.childNodes[14].innerHTML  = "The Clear Creek pedestrian and bike trail is one of the most beautiful in the area.";

 

 oUl.childNodes[15].innerHTML  = "Clear Creek.";

 oUl.childNodes[16].innerHTML  = "Another view of Clear Creek.";

 oUl.childNodes[17].innerHTML  = "White Ranch Park is home to 18 miles of multi use trails.  This area is known for a variety of wild life including deer, bear, mountain lion, bobcat, elk and wild turkey.";

 oUl.childNodes[18].innerHTML  = "Table Mountain Ranch is just one of the many places in Golden to board your horse or take riding lessons.";

 oUl.childNodes[19].innerHTML  = "A view of Golden's famous Castle Rock.";

 oUl.childNodes[20].innerHTML  = "Golden is also home to the Coors Brewing Company.";

 oUl.childNodes[21].innerHTML  = "Coors as seen from Lookout Mountain.";

 oUl.childNodes[22].innerHTML  = "Golden is located in the Jefferson County School District and is one of the most widely respected school districts in the area.";

 oUl.childNodes[23].innerHTML  = "Golden is also home to the Colorado School of Mines.  This school is one of the most highly respected in the country.  CSM  is a State engineering university and it specializes in the geosciences.";

 

 oUl.childNodes[24].innerHTML  = "Golden is also home to Lookout Mountain and the Buffalo Bill Museum and Grave.";

 oUl.childNodes[25].innerHTML  = "The drive up Lookout Mountain is not for the faint of heart.";

 oUl.childNodes[26].innerHTML  = "Several hairpin turns on Lookout Mountain road make for a breath taking drive.";

 oUl.childNodes[27].innerHTML  = "The scenery from Lookout Mountain is spectacular.";

 oUl.childNodes[28].innerHTML  = "Another view from Lookout Mountain.";

 oUl.childNodes[29].innerHTML  = "Golden residents enjoy golfing at the Fossil Trail Golf Course.";

 oUl.childNodes[30].innerHTML  = "The Colorado Railroad Museum provides visitors with a history of trains in Colorado and is a favorite for people of all ages.";

 oUl.childNodes[31].innerHTML  = "Golden offers some spectacular housing options for its' residents.";

 oUl.childNodes[32].innerHTML  = "Another fabulous Golden home nestled near one of the Table Top Mountains.";

 

 oUl.childNodes[33].innerHTML  = "Golden homeowners are able to find homes in all price ranges and styles.";

oUl.childNodes[34].innerHTML  = "You are sure to find the perfect home in Golden.";

    }else{

oUl.childNodes[1].innerHTML  = "Howdy Folks!  Welcome to Golden.";

  oUl.childNodes[2].innerHTML  = "Golden's historic downtown is a favorite spot for local residents and tourists alike.";

 oUl.childNodes[3].innerHTML  = "Golden is nestled against the foothills of the Rocky Mountains in between the North and the South Table Top Mountains.";

 oUl.childNodes[4].innerHTML  = "Several Bronze statues throughout the downtown area depict life in the 1800's in Golden.";

 oUl.childNodes[5].innerHTML  = "Area residents enjoy shopping in many unique shops and galleries.";

 oUl.childNodes[6].innerHTML  = "Another Golden gallery.";

 

 oUl.childNodes[7].innerHTML  = "Yet another great place to find a unique treasure.";

 oUl.childNodes[8].innerHTML  = "A stroll through downtown Golden is a walk through history.";

 oUl.childNodes[9].innerHTML  = "Golden residents have many opportunities to enjoy local arts and crafts.";

 oUl.childNodes[10].innerHTML  = "Residents enjoy many outdoor cafes and coffee shops.";

 oUl.childNodes[11].innerHTML  = "Golden's history is rich with gold mining and the Mining Museum is a very popular attraction for residents of all ages.";

oUl.childNodes[12].innerHTML  = "Golden has many parks for its' residents to enjoy.";

 oUl.childNodes[13].innerHTML  = "Parfet Park in downtown Golden is a beautiful place to enjoy a relaxing summer afternoon.";

oUl.childNodes[14].innerHTML  = "The Golden Community Center offers many diverse activities and is enjoyed by all.";

 oUl.childNodes[15].innerHTML  = "The Clear Creek pedestrian and bike trail is one of the most beautiful in the area.";

 

 oUl.childNodes[16].innerHTML  = "Clear Creek.";

 oUl.childNodes[17].innerHTML  = "Another view of Clear Creek.";

 oUl.childNodes[18].innerHTML  = "White Ranch Park is home to 18 miles of multi use trails.  This area is known for a variety of wild life including deer, bear, mountain lion, bobcat, elk and wild turkey.";

 oUl.childNodes[19].innerHTML  = "Table Mountain Ranch is just one of the many places in Golden to board your horse or take riding lessons.";

 oUl.childNodes[20].innerHTML  = "A view of Golden's famous Castle Rock.";

 oUl.childNodes[21].innerHTML  = "Golden is also home to the Coors Brewing Company.";

 oUl.childNodes[22].innerHTML  = "Coors as seen from Lookout Mountain.";

 oUl.childNodes[23].innerHTML  = "Golden is located in the Jefferson County School District and is one of the most widely respected school districts in the area.";

 oUl.childNodes[24].innerHTML  = "Golden is also home to the Colorado School of Mines.  This school is one of the most highly respected in the country.  CSM  is a State engineering university and it specializes in the geosciences.";

 

 oUl.childNodes[25].innerHTML  = "Golden is also home to Lookout Mountain and the Buffalo Bill Museum and Grave.";

 oUl.childNodes[26].innerHTML  = "The drive up Lookout Mountain is not for the faint of heart.";

 oUl.childNodes[27].innerHTML  = "Several hairpin turns on Lookout Mountain road make for a breath taking drive.";

 oUl.childNodes[28].innerHTML  = "The scenery from Lookout Mountain is spectacular.";

 oUl.childNodes[29].innerHTML  = "Another view from Lookout Mountain.";

 oUl.childNodes[30].innerHTML  = "Golden residents enjoy golfing at the Fossil Trail Golf Course.";

 oUl.childNodes[31].innerHTML  = "The Colorado Railroad Museum provides visitors with a history of trains in Colorado and is a favorite for people of all ages.";

 oUl.childNodes[32].innerHTML  = "Golden offers some spectacular housing options for its' residents.";

 oUl.childNodes[33].innerHTML  = "Another fabulous Golden home nestled near one of the Table Top Mountains.";

 

 oUl.childNodes[34].innerHTML  = "Golden homeowners are able to find homes in all price ranges and styles.";

oUl.childNodes[35].innerHTML  = "You are sure to find the perfect home in Golden.";

    }



 }


