/***********************************************
* Destiny Patrol Sliding Menu Script
* (include on every page that has the dropdown menu).
* 
* Nb, script heavily edited by ElectricStorm 
* for use on DestinyPatrol. For the original visit: 
* http://www.dynamicdrive.com/dynamicindex1/slideinmenu.htm
***********************************************/

/***********************************************
* Sliding Menu Bar Script- © Dynamic Drive (www.dynamicdrive.com)
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
***********************************************/


function openIt(menuId) {

	if (menuId == 'benefits') {
		if (window.drawBenefits)
			clearInterval(drawBenefits)
			pullBenefits = setInterval("pullEngine('"+menuId+"')", 10)
	}
	else {
		if (window.drawSoftware)
			clearInterval(drawSoftware)
			pullSoftware = setInterval("pullEngine('"+menuId+"')", 10)
	}	
	
}


function closeIt(menuId) {

	if (menuId == 'benefits') {
		clearInterval(pullBenefits)
		drawBenefits = setInterval("pushEngine('"+menuId+"')", 10)
	}
	else {
		clearInterval(pullSoftware)
		drawSoftware = setInterval("pushEngine('"+menuId+"')", 10)
	}

}


function pullEngine(menuId) {
	
	var theMenu = document.getElementById(menuId+'container').style;

	if (menuId == 'benefits') { var maxHeight = 235; }
	else { var maxHeight = 180; }


	if (parseInt(theMenu.height) < maxHeight) {
		theMenu.height = parseInt(theMenu.height)+10+"px";
	}
	
	else if (menuId == 'benefits') {
		if (window.pullBenefits) {
			theMenu.height = maxHeight;
			clearInterval(pullBenefits);
		}
	}
	else {
		if (window.pullSoftware) {
			theMenu.height = maxHeight;
			clearInterval(pullSoftware);
		}
	}

}


function pushEngine(menuId) {
	
	var theMenu = document.getElementById(menuId+'container').style;
	var minHeight = 41;


	if (parseInt(theMenu.height) > minHeight) {
		theMenu.height = parseInt(theMenu.height)-10+"px";
	}

	else if (menuId == 'benefits') {
		if (window.drawBenefits) {
			theMenu.height = minHeight;
			clearInterval(drawBenefits);
		}
	}
	else {
		if (window.drawSoftware) {
			theMenu.height = minHeight;
			clearInterval(drawSoftware);
		}	
	}
	
}




