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