// JavaScript Document


function pickIssue (iObj,hObj) {
	hObj.value = iObj.options[iObj.selectedIndex].value;
}

function convertissues () {

//Establish variables, get issue on search results page and convert to lowercase

var displayissue="";
//var resultissue=$&(meta.issue).toLowerCase;
//moved to html page so variable will work


if (resultissue!="") {

//If issue doesn't need special conversion, just give it initial caps. This should work for issues that are one word.
var index;
var tmpStr;
var tmpChar;
var preString;
var postString;
var strLen;
var r="";

tmpStr = resultissue;
strLen = tmpStr.length;

//Remove plus signs and quotes from some issue names. Not necessary with with a cms that was created in this century.

for (inl=0; inl < strLen; inl++) {
    if (tmpStr.charAt(inl) != '+' && tmpStr.charAt(inl) != '\"' && tmpStr.charAt(inl) != '\'')
      {
      r += tmpStr.charAt(inl);
      }
    }
	
	resultissue=r;
	tmpStr=resultissue;
	strLen = tmpStr.length;

if (strLen > 0)  {
for (index = 0; index < strLen; index++)  {
if (index == 0)  {
tmpChar = tmpStr.substring(0,1).toUpperCase();
postString = tmpStr.substring(1,strLen);
tmpStr = tmpChar + postString;
}
else {
tmpChar = tmpStr.substring(index, index+1);
if (tmpChar == " " && index < (strLen-1))  {
tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
preString = tmpStr.substring(0, index+1);
postString = tmpStr.substring(index+2,strLen);
tmpStr = preString + tmpChar + postString;
         }
      }
   }
}
	
	
	displayissue=tmpStr;

if (resultissue.indexOf("southpotomac")!=-1) {displayissue="The South Potomac Pilot";}
																																		
if (resultissue.indexOf("journal")!=-1) {displayissue="The Journal";}

if (resultissue.indexOf("quantico")!=-1) {displayissue="Quantico Sentry";}						

if (resultissue.indexOf("henderson")!=-1) {displayissue="Henderson Hall News";}
						
if (resultissue.indexOf("aviator")!=-1) {displayissue="The Aviator";}

}

document.write(displayissue);
}