﻿// Create Array
var arrayIndex = 0;
var arraySize = 100; //this must only be incremented if there are more than 100 profiles
Profiles = new Array(arraySize);
for (i = 0; i < Profiles.length; ++ i){
Profiles [i] = new Array(1);
}




// Do not touch anything bleow this line
//*************************************************************************************************************************
// Method to build Short listing
function BuildShtByCol(col){
var outPut="";

// Loop thought array and only bring back column
for (var x = 0; x < arraySize; x++)
   {
    if (Profiles[x][0] == col){
        outPut +=BuildItem(x);
    }
  }
    return outPut;
} 

function BuildItem(Index){

var outPut="";
outPut +="<table border='0' widht='120'>";

outPut +="<tr>";
outPut +="<td align='left' class='RegText'>"
outPut += "<b>" + Profiles[Index][1] +"</b>";
outPut +="</td>";
outPut +="</tr>";

outPut +="<tr>";
outPut +="<td align='left' class='RegText'>";
outPut += Profiles[Index][2];
outPut +="</td>"
outPut +="</tr>"

//outPut +="<tr>";
//outPut +="<td align='left' class='RegText'>";
//outPut += "<a href='mailTo:" + Profiles[Index][5] + "' class='brown_d u' id='' title='Email "+ Profiles[Index][1] +"'>"+Profiles[Index][5]+"</a>";
//outPut +="</td>";
//outPut +="</tr>";

outPut +="<tr>"
outPut +="<td align='left' class='RegText'>"
outPut += "<a href='Profile.html?PID=" +Index+ "' title='Click here to learn more about "+ Profiles[Index][1]+".' id='a'>view profile</a>";
outPut +="</td>";
outPut +="</tr>";
outPut +="</table>";
outPut +="<br/>";
outPut +="<div id='line'><img src='images/spacer.gif'></div>";


return outPut;
}

function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  alert('Query Variable ' + variable + ' not found');
}


