// get by keyvalue 

function getVal(key)
{
	var myNames = new Array();
	var myVals  = new Array();
	
	myNames[0] 	= 'rearExterior';
	myVals[0]  	= 'Rear Exterior';
	
	myNames[1]	= 'frontExterior';
	myVals[1] 	= 'Front Exterior';
	
	myNames[2] 	= 'bedroom';
	myVals[2]  	= 'Bedroom';
	
	myNames[3]	= 'bathroom';
	myVals[3] 	= 'Bathroom';
	
	myNames[4] = 'livingRoom';
	myVals[4] = 'Living Room';
	
	myNames[5] = 'familyRoom';
	myVals[5] = 'Family Room';
	
	myNames[6] = 'garage';
	myVals[6] = 'Garage';
	
	myNames[7] = 'office';
	myVals[7] = 'Office';
	
	myNames[8] = 'laundryRoom';
	myVals[8] = 'Laundry Room';
	
	myNames[9] = 'kitchen';
	myVals[9] = 'Kitchen';
	
	for(i=0;i<myNames.length; i++)
	{
		if(key == myNames[i])
			return myVals[i];
	}
	

	return '';


}
// when linking to article want to preserve params
function linkToArticle(articleLink)
{
loc = document.location.href;
page = getPage(loc) + '?';
query = stripParameter(getQueryString(loc),'articleName');

document.location.href = page + query + '&articleName=' + articleLink;

}

// gets the query String
function getQueryString(winURL)
{

questionmark = winURL.indexOf('?');

if(questionmark > -1)
	return winURL.substring(questionmark +1);

return winURL;
}

// gets the URL (without queryString)
function getPage(winURL)
{

questionmark = winURL.indexOf('?');
if(questionmark > -1)
	return winURL.substring(0, questionmark);
return winURL;

}
/// gets a parameter value from a full url
function getParamValue(fullURL, parameterName)
{
/// first split the url into an array
var temp = new Array();
temp = fullURL.split('&');
val  = '';

for(i=0;i<temp.length;i++){
	eqlSgn = temp[i].indexOf('=');
	if (eqlSgn > -1)
		{
			paramName = temp[i].substring(0,eqlSgn);
			paramVal  = temp[i].substring(eqlSgn +1);
			if(paramName == parameterName)
				val = paramVal
		}		 
	}
return val;
}

//Strips a parameter from the URL
function stripParameter(fullURL,parameterName)
{
var temp = new Array();
temp = getQueryString(fullURL).split('&');
val  = '';

for(i=0;i<temp.length;i++){
	 eqlSgn = temp[i].indexOf('=');
	 if(eqlSgn > -1)
	 	{
	 		paramName = temp[i].substring(0,eqlSgn);
			paramVal  = temp[i].substring(eqlSgn +1);
			
			if(paramName != parameterName)
				val += temp[i] + '&';
	 	} 
	}
return val;


}