var qs = window.location.search.substring(1);
var ql = qs.split('&');
var siteID = "";
for (var i=0; i<ql.length; i++) 
{
	var pos = ql[i].indexOf('=');
	if (pos > 0) 
	{
		var key = ql[i].substring(0,pos);
		siteID=(key.toLowerCase() == 'siteid')?ql[i].substring(pos+1):'';
		//alert("the cookie is " + ql[i].substring(pos+1) + " and the key is " + key + " and the siteID is " + siteID);
	}
}
if (siteID.length > 0)
{
	var c_d = new Date();
	c_d.setTime( c_d.getTime() );
	c_e = 365 * 24 * 3600;
	var c_ed = new Date( c_d.getTime() + (c_e) );
	//document.cookie = 'siteID=' + siteID + ';expires='+ c_ed.toGMTString() + ';path=/';
	//force the main domain to be used
	document.cookie = 'siteID=' + siteID + ';expires='+ c_ed.toGMTString() + ';domain=lightingbygregory.com;path=/';
}