// <script>
/******************************************************************************
Name:       getSearchAsArray
Parameters: None.
Return:     new Array() 
            An array of parameters read from the url.
Desc:       Parses the URL looking for parameters that define how the page 
            should display.
******************************************************************************/
function getSearchAsArray() 
{
   // Browser-sniffing variables.
   var minNav3 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 3);
   var minIE4  = (navigator.appName.indexOf("Microsoft") >= 0 && parseInt(navigator.appVersion) >= 4);
   
   // Baseline DOM required for this function
   var minDOM = minNav3 || minIE4 ; 
   
   // Initialize array to be returned.
   var results = new Array();
   
   if (minDOM) 
   {
      // Unescape and strip away leading question mark.
      var input = unescape(location.search.substring(1));
      
      if (input) 
      {
         // Divide long string into array of name/value pairs.
         var srchArray = input.split("&");
         
         var tempArray = new Array();
         
         for (i = 0; i < srchArray.length; i++) 
         {
            // Divide each name/value pair temporarily into a two-entry array.
            tempArray = srchArray[i].split("=");
           
            // Use temp array values as index identifier and value.
            results[tempArray[0]] = tempArray[1];
         }
      }
   }
   
   // return the result array
   return results;
}

/******************************************************************************
Global Variable Name:   srchData
Description:            This is the global result from calling the above 
                        function.
******************************************************************************/
var srchData = getSearchAsArray();

/******************************************************************************
Name:       WriteImage
Parameters: None.
Return:     None.
Desc:       Generate the image for the page
******************************************************************************/
function WriteImage()
{
	if(srchData['content'] == null) {
		document.write("&nbsp;");
	} else {
		document.write("<img src='" + srchData['content'] + ".jpg' border='0' alt=''>");
	}
}

/******************************************************************************
Name:       WriteCaption
Parameters: None.
Return:     None.
Desc:       Generate the caption for the image
******************************************************************************/
function WriteCaption()
{
   // generate the index
   if(srchData['content'] == null) {
		document.write("&nbsp;");
	} 
   
   else if(srchData['content'] == "15staircrew") {
		document.write("Riders: Elliot, Aaron, Hamilton, Chris&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Derik Olsen");
	} 
   
   else if(srchData['content'] == "ankenyChute") {
		document.write("Photo By: Chris Ankeny");
	}  
   
   else if(srchData['content'] == "annie") {
		document.write("Rider: Annie Fast&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Chris Ankeny");
	}  
   
   else if(srchData['content'] == "bridgerSign") {
		document.write("Bridger Bowl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Chris Ankeny");
	}  
   
   else if(srchData['content'] == "campsunrise") {
		document.write("Snow Camp at Sunrise&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Chris Ankeny");
	}  
   
   else if(srchData['content'] == "caveDwellers") {
		document.write("Photo By: Chris Ankeny");
	}  
   
   else if(srchData['content'] == "chantelle") {
		document.write("Rider: Chantal Zeiger&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Jeff Hawe");
	}  
   
   else if(srchData['content'] == "crosswalkollie1") {
		document.write("Rider: Chris Murphy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Derik Olsen");
	}  
   
   else if(srchData['content'] == "dreamy") {
		document.write("Photo By: Chris Ankeny");
	}  
   
   else if(srchData['content'] == "dropinbro") {
		document.write("Rider: Chris Murphy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Derik Olsen");
	}  
   
   else if(srchData['content'] == "ElliotRoofDrop1") {
		document.write("Elliot Lindsey&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Derik Olsen");
	}  
   
   else if(srchData['content'] == "escalator") {
		document.write("Riders: Elliot and Aaron&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Derik Olsen");
	}  
   
   else if(srchData['content'] == "fanuzziDork") {
		document.write("Rider: Aaron Fanuzzi&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Derik Olsen");
	}  
   
   else if(srchData['content'] == "roofGap") {
		document.write("Rider: Elliot Lindsey&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Derik Olsen");
	}  
   
   else if(srchData['content'] == "switchOllie") {
		document.write("Rider: Elliot Lindsey&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Derik Olsen");
	}  
   
   else if(srchData['content'] == "wormy_fs") {
		document.write("Rider: Jeremy Adamich&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Photo By: Brad Westphal");
	} 
}
