function getCookie(name){
	name = name + "=";
	
	var cookies = document.cookie.split(';');
	
	for(var i=0; i<cookies.length; i++){
		var c = cookies[i];
		
		while(c.charAt(0) == ' '){
			c = c.substring(1, c.length);
		}
        
		if(c.indexOf(name) === 0){
			return c.substring(name.length, c.length);
		}
	}
	return null;
}

function setCookie(name, value, seconds){
	var expires = "";
	
	if(seconds){
		var date = new Date();
		date.setTime(date.getTime() + (seconds * 1000));
		expires = ";expires=" + date.toGMTString();
	}
	
	path = ";path=" + '/';
	document.cookie = name + "=" + value + expires + path;
}
