function parseReferringURL (requestedVariable) {
	// declare global variables
	var rV = requestedVariable;
	var strTitle = "Free Music Downloads - ";  // define the starting string of the document title
	var strFullWord = "";
	var strFullWord1;
	var strFullWord2;
	var strFirstLetter;
	var strFirstLetterU;
	var strKeywordTemp;
	
	if (document.referrer != "") {  
		// if a referring URL was located
		var paramArray = new Array();  // define array to contain all paramters in referring string
		var qs = document.referrer.substr(document.referrer.indexOf("?")+1);  // define the starting point for the referring string
		qs = qs.split("&");  // split the string using '&' as the delimiter
		for (var i=0; i < qs.length; i++) { // split up the referring string and populate the array
			tmp = qs[i].split("=");
			 paramArray[tmp[0]] = tmp[1];
		}
		
		if (paramArray["q"]) {
			var strKeywords = paramArray["q"];  // assign the keywords value to the q variable
		} else if (paramArray["terms"]) {
			var strKeywords = paramArray["terms"];  // assign the keywords value to the terms variable
		} else if (paramArray["k"]) {
			var strKeywords = paramArray["k"];  // assign the keywords value to the terms variable
		} else if (paramArray["p"]) {
			var strKeywords = paramArray["p"];  // assign the keywords value to the terms variable
		} else {
			var strKeywords = "none";
		}
		
		if (strKeywords == "none") {
			strFullWord1 = "Music Downloads";
			strFullWord2 = strFullWord1 + ", ";
		} else {
			var strKeywordArray = new Array();  // define array to contain individual keywords
			strKeywords = strKeywords.replace(/%20/g,"+");
			strKeywordArray = strKeywords.split("+");  // split the keywords using '+' as the delimiter

			
			for (var loop = 0; loop < strKeywordArray.length; loop++)	{  // loop through the keywords array
				strFirstLetter = strKeywordArray[loop].substr(0,1);  // define the first letter of each keyword
				strFirstLetterU = strFirstLetter.toUpperCase();  // make the first letter of each keyword uppercase
				strFullWord = strFullWord + strFirstLetterU + strKeywordArray[loop].substring(1,strKeywordArray[loop].length) + " ";  // append the first letter of the keyword to the rest of the word
			}
			strFullWord1 = strFullWord.substring(0,strFullWord.length-1);
			strFullWord2 = strFullWord1 + ", ";
		}
	} else { 
		// if no referring URL was located
		strFullWord1 = "Music Downloads"; // set variable 1
		strFullWord2 = strFullWord1 + ", "; // set variable 2 = variable 1 with a comma and space appended to the end
	}
	strFullWord3 = strFullWord1.toUpperCase();
	strFullWord4 = strFullWord2.toUpperCase();
	strFullWord5 = strFullWord1.toLowerCase();
	document.title = strTitle + strFullWord1;  // change the page title
	if (rV == 1) {
		return strFullWord1;
	} else if (rV == 2) {
		return strFullWord2;
	} else if (rV == 3) {
		return strFullWord3;
	} else if (rV == 4) {
		return strFullWord4;
	} else if (rV == 5) {
		return strFullWord5;
	}

 
}
