function getUrlParamaters(searchingFor){
	// initialize variables
	var theResult = ""
	strlen = document.location.search.length
	// if query string exists find starting point of what we're searching for
	if (strlen > 0) {
		theQueryString  = document.location.search
		queryNameIndex = theQueryString.indexOf(searchingFor)
		if (queryNameIndex != -1){
			queryEndIndex = theQueryString.indexOf("&", queryNameIndex)
			if (queryEndIndex==-1) {
				queryEndIndex = theQueryString.length
			}
			// pull out value following what we're searching on
			theResult = theQueryString.substring((queryNameIndex+searchingFor.length), queryEndIndex)
		}
		// clean up and return value
		theResult = theResult.replace(/\+/g, ' ') // replace "+"s with spaces
		theResult = unescape(theResult)
	}
	return theResult
}



function tracker() {
	sourceID = getUrlParamaters('sid=') // value for source tracking

	expireDate = new Date
	expireDate.setYear(expireDate.getYear()+1)
	if (document.cookie != "") {sourceID = document.cookie.split("=")[1]}
	if (sourceID != "") {
		document.cookie = "sid="+sourceID+";expires="+expireDate.toGMTString()+";path=/"
	}
}

tracker()