﻿// <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='1' alt=''>");
	}
}

/******************************************************************************
Name:       WriteCaption
Parameters: None.
Return:     None.
Desc:       Generate the caption for the image
******************************************************************************/
function WriteCaption()
{
   if(srchData['content'] == null) {                
		document.write("&nbsp;");
	} 
   
   else if(srchData['content'] == "eagle_rock") {
		document.write("32' Eagle Rock ramp overview. Lance Mountain and Nik Rosenthal skating. 1983.");
	}  
   
   else if(srchData['content'] == "hosoi_booney") {
		document.write("Christian Hosoi, Booney ramp jam, 1983. All star cast on the ramp deck.");
	}  
   
   else if(srchData['content'] == "james_kwei_edger") {
		document.write("James Kwei micro edger. Mark's ramp 1978.");
	}  
   
   else if(srchData['content'] == "jay_invert") {
		document.write("Me upside down and sideways in 85(?)");
	}  
   
   else if(srchData['content'] == "jay_lunch_launch") {
		document.write("Lunch break lanuch ramp, 1986.");
	}  
   
   else if(srchData['content'] == "jim_fs_invert") {
		document.write("Brother Jim, Frontside invert, OG Eagle Rock ramp, 1983.");
	}  
   
   else if(srchData['content'] == "jim_grimmace") {
		document.write("Brother Jim, Mark's ramp, 1978. Nice Facial!");
	}  
   
   else if(srchData['content'] == "jim_layback") {
		document.write("Brother Jim, layback rollout circa 1982.");
	}  
   
   else if(srchData['content'] == "lance_allyoop") {
		document.write("Lance Mountain - big alleyoop. Eagle Rock ramp, 1985.");
	}  
   
   else if(srchData['content'] == "lance_crail") {
		document.write("Lance Mountain - lein to tail. Eagle Rock ramp, 1984.");
	}  
   
   else if(srchData['content'] == "lance_fingers") {
		document.write("Lance dorking around - 1984.");
	}  
      
   else if(srchData['content'] == "steadham_eagle_rock") {
		document.write("Steve Stedham. Eagle Rock ramp jam, 1984.");
	}  
   
   else if(srchData['content'] == "tony_hawk_fs_rock") {
		document.write("A tiny Tony Hawk, Frontside rocking the hip as a Dogtown amateur. Upland, 1983.");
	} 
	
	else if(srchData['content'] == "paulschmidt") {
		document.write("Paul Schmidt ripping in 84. Longstanding owner of PS Stix, veteran skateboard deck manufacturer. You probably ride something he has made.");
	} 
	
	else if(srchData['content'] == "jimmoorenewshoesoldpads86") {
		document.write("My brother Jim with new shoes and old pads in '86.");
	}
}
