var a = null;
var b = null;
var c = null;
var d = null;
var e = null;
var locSlider = null;
var locContain = null;
var comSlider = null;
var comContain = null;
var franSlider = null;
var franContain = null;
var empSlider = null;
var empContain = null;
var expSlider = null;
var expContain = null;

//ANIMATION FUNCTIONS
///////////////////////////////////////////////////////

// Locations Menu
function slideLocDown() {
	if (a != null) {
		a.stop();
		a = null;
	}

	a = new Accelimation(locSlider.style, "top", -30, 500, .8, "px");
	a.onend = onLocEnd;
	a.onframe = slideLoc;
	a.start();
}

function slideLocUp() {
	if (a != null) {
		a.stop();
		a = null;
	}

	a = new Accelimation(locSlider.style, "top", -165, 400, .8, "px");
	a.onend = onLocEnd;
	a.onframe = slideLoc;
	a.start();
}

function onLocEnd() {
	a.stop();
	a = null;
}

function slideLoc(y) {
	locSlider.style.top = y + "px"; 
	locContain.style.height = (y + 190) + "px";
}

// Communications Menu
function slideComDown() {
	if (b != null) {
		b.stop();
		b = null;
	}

	b = new Accelimation(comSlider.style, "top", -40, 500, .8, "px");
	b.onend = onComEnd;
	b.onframe = slideCom;
	b.start();
}

function slideComUp() {
	if (b != null) {
		b.stop();
		b = null;
	}

	b = new Accelimation(comSlider.style, "top", -165, 400, .8, "px");
	b.onend = onComEnd;
	b.onframe = slideCom;
	b.start();
}

function onComEnd() {
	b.stop();
	b = null;
}

function slideCom(y) {
	comSlider.style.top = y + "px"; 
	comContain.style.height = (y + 190) + "px";
}

// Franchise Menu
function slideFranDown() {
	if (c != null) {
		c.stop();
		c = null;
	}

	c = new Accelimation(franSlider.style, "top", -15, 500, .8, "px");
	c.onend = onFranEnd;
	c.onframe = slideFran;
	c.start();
}

function slideFranUp() {
	if (c != null) {
		c.stop();
		c = null;
	}

	c = new Accelimation(franSlider.style, "top", -165, 400, .8, "px");
	c.onend = onFranEnd;
	c.onframe = slideFran;
	c.start();
}

function onFranEnd() {
	c.stop();
	c = null;
}

function slideFran(y) {
	franSlider.style.top = y + "px"; 
	franContain.style.height = (y + 190) + "px";
}

// Employment Menu
function slideEmpDown() {
	if (d != null) {
		d.stop();
		d = null;
	}

	d = new Accelimation(empSlider.style, "top", -40, 500, .8, "px");
	d.onend = onEmpEnd;
	d.onframe = slideEmp;
	d.start();
}

function slideEmpUp() {
	if (d != null) {
		d.stop();
		d = null;
	}

	d = new Accelimation(empSlider.style, "top", -165, 400, .8, "px");
	d.onend = onEmpEnd;
	d.onframe = slideEmp;
	d.start();
}

function onEmpEnd() {
	d.stop();
	d = null;
}

function slideEmp(y) {
	empSlider.style.top = y + "px"; 
	empContain.style.height = (y + 190) + "px";
}

// Exeperience Menu
function slideExpDown() {
	if (e != null) {
		e.stop();
		e = null;
	}

	e = new Accelimation(expSlider.style, "top", 0, 500, .8, "px");
	e.onend = onExpEnd;
	e.onframe = slideExp;
	e.start();
}

function slideExpUp() {
	if (e != null) {
		e.stop();
		e = null;
	}

	e = new Accelimation(expSlider.style, "top", -165, 400, .8, "px");
	e.onend = onExpEnd;
	e.onframe = slideExp;
	e.start();
}

function onExpEnd() {
	e.stop();
	e = null;
}

function slideExp(y) {
	expSlider.style.top = y + "px"; 
	expContain.style.height = (y + 190) + "px";
}

function init() {
	if(document.getElementById("mExp")) {
		expSlider = document.getElementById("mExp");
		expContain = document.getElementById("mExpContainer");
	}
	if(document.getElementById("mLoc")) {
		locSlider = document.getElementById("mLoc");
		locContain = document.getElementById("mLocContainer");
	}
	if(document.getElementById("mCom")) {
		comSlider = document.getElementById("mCom");
		comContain = document.getElementById("mComContainer");
	}
	if(document.getElementById("mFran")) {
		franSlider = document.getElementById("mFran");
		franContain = document.getElementById("mFranContainer");
	}
	if(document.getElementById("mEmp")) {
		empSlider = document.getElementById("mEmp");
		empContain = document.getElementById("mEmpContainer");
	}
}

function popFranchiseImage(gallery,image)
{
	win = window.open("imageViewer.php?g=" + gallery + "&i=" + image,"ImageViewer","width=750,height=500,scrollbars=auto");
}

