﻿
// cookie, so ppl dont get a pop up every single time they visit
/*
if(!document.cookie) {
	// window.alert(b_version);
	if(mac==null && msie8==null && msie7==null) {
		window.alert("Your browser may have trouble viewing content on this site.\n It is recommended that you update your browser. \nVisit your favorite browser's website for more information.");
	}	
	// set cookie
	setCookie("newbie=","yes",6);
}
*/

<!-- set -->
function setCookie(name,value,days) {
	if(days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires=" + date.toGMTString();
	} else {
		var expires = "";	
	}
	document.cookie = name + "=" + encodeURIComponent(value) + expires + "; path=/";
}

<!-- get -->
function getCookie(name) {
	var args = document.cookie.split("; ");
	var cVal = '';
	for(i=0,len=args.length; i<len; i++) {
		if(args[i].indexOf(name+"=")>-1) {
			return decodeURIComponent(args[i].split("=")[1]);
		}
	}
	return cVal;
}

<!-- delete -->
function deleteCookie(name,path,domain) {
	if (getCookie(name)) document.cookie = name + "=" + ((path) ? ";path=" + path : "") + ((domain) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


