// read the specified variable from the query string
function QueryString(variable) 
{

	// basic error handling
	try {
	
		// read the query string
		var query = window.location.search.substring(1);

		// assuming there was something to read ...
		if (query) {

			// split into name value pairs
			var vars = query.split("&");

			if (vars.length > 0 ) {
				for (var i=0;i<vars.length;i++) 
				{
	
					// split out label and content
					var pair = vars[i].split("=");

					// do we have a match with the requested name?
					if (pair[0] == variable) 
					{
						// return content
						return pair[1];
					}
				}
			} else {
				return "";
			}
		} else {
			return "";
		}
	} catch (ex) {
		return "";
	}
} 
