﻿	var saValue = new Array();
	var sLocation = new String(document.location);
	var iStart = sLocation.indexOf("?");
	var sTerms = "!aid!pid!sid";
    var dt = new Date();
    var expires = "";

	// get string after "?"
	sLocation = sLocation.substr(iStart+1);
	saValue = sLocation.split("&");
	
    dt.setDate( dt.getDate() + 90 );
    expires = ";expires=" + dt.toGMTString();

	for(i=0; i<saValue.length; i++)
	{
		saValue[i] = saValue[i].split("=");
		if (sTerms.indexOf(saValue[i][0].toLowerCase())>0)
		{
			document.cookie = saValue[i][0].toLowerCase() + "=" + saValue[i][1] + "; path=/;" + expires;
		}
	}	