function slideConstructor(name, divVar, heightVar) {
	this.name = name;
	this.divName = divVar;
	this.height = heightVar;
	this.top = -heightVar;
	this.slideIn = slideIn;
	this.slideOut = slideOut;
	this.slideNow = slideNow;
	this.unslideNow = unslideNow;
}
	
function slideIn() {
	if(this.outslide!=null) {
		clearInterval(this.outslide);
		this.outslide = null;
	}
	if(this.inslide==null) {
		switch(this.name) {
			case "about":
				about.inslide = setInterval("about.slideNow()",30);
				break;
			case "members":
				members.inslide = setInterval("members.slideNow()",30);
				break;
			case "resources":
				resources.inslide = setInterval("resources.slideNow()",30);
				break;
			case "events":
				events.inslide = setInterval("events.slideNow()",30);
				break;
		}
	}
}
function slideNow() {
	if(this.top >=-10) {
		this.top = 0;
		document.getElementById(this.divName).style.top = "0px";
		clearInterval(this.inslide);
		this.inslide = null;
	}
	else {
		this.top += 10;
		document.getElementById(this.divName).style.top = this.top + "px";
	}
}
function slideOut() {
	if(this.inslide!=null) {
		clearInterval(this.inslide);
		this.inslide = null;
	}
	if(this.outslide==null) {
		switch(this.name) {
			case "about":
				about.outslide = setInterval("about.unslideNow()",30);
				break;
			case "members":
				members.outslide = setInterval("members.unslideNow()",30);
				break;
			case "resources":
				resources.outslide = setInterval("resources.unslideNow()",30);
				break;
			case "events":
				events.outslide = setInterval("events.unslideNow()",30);
				break;
		}
	}
}
function unslideNow() {
	if(this.top <= -this.height) {
		this.top = -this.height;
		document.getElementById(this.divName).style.top = this.top + "px";
		clearInterval(this.outslide);
		this.outslide = null;
	}
	else {
		this.top -= 10;
		document.getElementById(this.divName).style.top = this.top + "px";
	}
}
		
about = new slideConstructor("about","aboutDrop",50);
members = new slideConstructor("members","membersDrop", 95);
resources = new slideConstructor("resources","resourcesDrop", 85);
events = new slideConstructor("events","eventsDrop", 85);	

function countdown() {
	var go;
	if(go==null) {
		second = 10;
		go = setInterval("countNow()",1000);
	}
}
function countNow() {
	if(second>0) {
		--second;
		document.getElementById("countdown").value = second;
	}
	else {
		window.location.href="upcomingevents.html";
	}
}
	
	
