if(document.cookie.indexOf('sub') == -1){

	var today = new Date();
	var expireSubCookie = new Date(today.getTime() + 60 * 24 * 60 * 60 * 1000);
	var hostArr = new Array();
	hostArr = window.location.hostname.split(".");
	var pathString = hostArr[hostArr.length-2] + "." + hostArr[hostArr.length-1];

	var subCookieValue = 'sub=' + hostArr[0] + '; expires=' + expireSubCookie.toGMTString() + '; path=/; domain=' + pathString;
	document.cookie = subCookieValue;
}