
//--------------------
//nick nettleton  | www.fluid7.co.uk

	function setcookie(name,value,days){ //call function just the way it looks
		expiry=1000*60*60*24*days //convert to milliseconds
		var expDate=new Date()
		if(expiry){
			expDate.setTime(expDate.getTime()+expiry)
			document.cookie=name+"="+escape(value)+"; expires="+expDate.toGMTString()
			}
		else{
			document.cookie=name+"="+escape(value);
			}
		}

	function getcookie(name){ //call function as variable=getcookie('name')
		thecookie=document.cookie.split(";")
		for(i=0;i<thecookie.length;i++){
			thebits=thecookie[i].split("=")
			if(thebits[0].substring(0,1)==" "){
				thebits[0]=thebits[0].substring(1,thebits[0].length)
				}
			if(thebits[0]==name){
				return unescape(thebits[1])
				}
			}
		}


	function getallcookies(){ //outputs result in form cookie_<name>="blah"
		thecookie=document.cookie.split(";")
		for(i=0;i<thecookie.length;i++){
			thebits=thecookie[i].split("=")
			if(thebits[0].substring(0,1)==" "){
				thebits[0]=thebits[0].substring(1,thebits[0].length)
				}
			eval("cookie_"+thebits[0]+"=unescape(thebits[1])")
			}
		}

//------------------------



