function readAffiliate()
{
var expires = 90;
var today = new Date();
var expiry = new Date(today.getTime() + (expires * 86400000));
var affiliate = window.location.search.substring(1,3);		//function to check the affiliate  								//url
	if (affiliate == "id")
	{
	 var affiliateId = window.location.search.substring(4);	//extract the id value of the 
								//affiliate url
	}
	if (affiliateId)
	{
	var name = 'id';
	var value = affiliateId;
	var path = '/';
	document.cookie = name + "=" + escape(value) +
	( (expires) ? "; expires=" + expiry.toGMTString() : " ") +
	( (path) ? "; path=" + path : " ");
	}
}
window.readAffiliate();