logIn = 0
expireDate = new Date
expireDate.setMonth(expireDate.getYear()+2)
email = ""
realname = ""
telephone = ""
subject = ""
newsletter = "no"
enquiry=""
dayName = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
monthName = new Array ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
/* Set date for next USA visit */
var trip = new Date;
var tripMonth = trip.getMonth();

if(trip.getDate() > 10){
	tripMonth+=1;
	if (tripMonth > 11) {
		tripMonth = 0;
		trip.setYear(trip.getYear()+1);
		}
	trip.setMonth(tripMonth)
	}
	
trip.setDate(10);
adjust = 8-trip.getDay();
if (adjust >= 7 ){adjust -= 7}
trip.setDate(10+adjust)


if (document.cookie != "") {
	if(cook = cookieVal("rpv1")) {
		cook = unenc(cook)
		realname = cook.split("^")[0]
		email = cook.split("^")[1]
		newsletter = cook.split("^")[2]
		telephone = cook.split("^")[3]
	}
	enquiry = cookieVal("enquiry")
	subject = cookieVal("subject")
}

function cookieVal(cookieName) {
	thisCookie = document.cookie.split("; ")
	for (i=0; i<thisCookie.length; i++) {
       	if (cookieName == thisCookie[i].split("=")[0]) {
        	return thisCookie[i].split("=")[1]
        }
    }
return 0
}

function unenc(enc_str) {
	plain = ""
	if(enc_str != "") {
		for(i = 0; i < enc_str.length; i += 2) {
			meta = parseInt(enc_str.substr(i,[2])) + 23
			num_in = unescape('%' + meta.toString(16))
			plain += num_in
		}
	plain = unescape(plain)
 	}
return(plain)
}

function enc(plain) {
	enc_str = "";
	if(plain == "") {
		alert("No string")
	}
	else {
		pl_str = escape(plain);
		for(i = 0; i < pl_str.length; i++) {
			enc_str += pl_str.charCodeAt(i) - 23;
		}
	}
return(enc_str)
}
function setSubject(subject) {
	document.cookie="subject="+subject+";;path=/"
	return true
}
var activeSection = "x";

function toggleSection(section) {
	var obj=document.getElementById(section);
	if(obj.style.display != "block"){
		obj.style.display = "block" }
	else {
		obj.style.display = "none" }
}

function openSection(section) {
	var obj=document.getElementById(section);
	obj.style.display = "block";
}

re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
