	//base configuration for panel width, maximum panel movement, menu tab ids, main content ids and footer ids
	var pnlWidth = 208; //the width of a panel
	var curMenu = 1; //default to the second panel (count from 0)
	
/* - Added animating flag*/
	var animating = false;


	var travelCheck = 0;
	var horoscopeCheck = 0;
	var healthCheck = 0;
	var eventCheck = 0;
	var climateCheck = 0;
	var skiCheck = 0;

/* CODE ADDITIONS*/
/* by Greg Dunn - 03/17/08 */
/* - Added the following code to start event listeners and handle click events*/

  if(typeof eventflag === 'undefined' || !eventflag) eventflag = 'Y';
  if(typeof horoscopeflag === 'undefined' || !horoscopeflag) horoscopeflag = 'Y';
  var lfTravel = 0;
  var lfHoroscope = -208;
  var lfHealth = -416;
  var lfEvent = -624;
  var lfClimate = -832;
  var lfSki = -1040;
  
  function initPanel() { 
	  //console.log('initPanel');
	  if(eventflag == 'Y' && horoscopeflag == 'N') {
		  lfHealth = -208;
		  lfEvent = -416;
		  lfClimate = -624;
		  lfSki = -832;
	  } else if(eventflag == 'N' && horoscopeflag == 'Y') {
		  lfHoroscope = -208;
  	 	  lfHealth = -416;
		  lfClimate = -624;
		  lfSki = -832;
	  } else if(eventflag == 'N' && horoscopeflag == 'N') {
	  	  lfHealth = -208;
		  lfClimate = -416;
		  lfSki = -624;
	  }
    setEventListeners('start'); 
  } 
	
  function setEventListeners(action) {
		//console.log('setEventListeners');
    if (action =='start') {
		   YAHOO.util.Event.addListener("lftArrowLink", "click", lftArrowHandler);
			 YAHOO.util.Event.addListener("travelLink", "click",travelHandler);
			 if(horoscopeflag == 'Y') {
			 	YAHOO.util.Event.addListener("horoscopeLink", "click", horoscopeHandler);
			 }
			 YAHOO.util.Event.addListener("healthLink", "click", healthHandler);
			 if(eventflag == 'Y') {
			 	YAHOO.util.Event.addListener("eventsLink", "click", eventHandler);
			 }
			 YAHOO.util.Event.addListener("climateLink", "click", climateHandler); 
 			 YAHOO.util.Event.addListener("skiLink", "click", skiHandler);
			YAHOO.util.Event.addListener("rgtArrowLink", "click", rgtArrowHandler);		 
		 } else {
		   YAHOO.util.Event.removeListener("lftArrowLink", "click", lftArrowHandler);
			 YAHOO.util.Event.removeListener("travelLink", "click",travelHandler);
			 if(horoscopeflag == 'Y') {
			 	YAHOO.util.Event.removeListener("horoscopeLink", "click", horoscopeHandler);
			 }
			 YAHOO.util.Event.removeListener("healthLink", "click", healthHandler);
			 if(eventflag == 'Y') {
			 	YAHOO.util.Event.removeListener("eventsLink", "click", eventHandler);
			 }
			 YAHOO.util.Event.removeListener("climateLink", "click", climateHandler);
 			 YAHOO.util.Event.removeListener("skiLink", "click", skiHandler);
			 YAHOO.util.Event.removeListener("rgtArrowLink", "click", rgtArrowHandler);
		 }
	}
	 
	 function lftArrowHandler(e) { 
		setEventListeners('stop');
		slideLFModBy(208);
		setEventListeners('start');
	 } 
   
	 function rgtArrowHandler(e) {
		setEventListeners('stop');
		slideLFModBy(-208);
		setEventListeners('start');
	 }

	 function travelHandler(e) {
		setEventListeners('stop');
		slideLFModTo(lfTravel);
		setEventListeners('start');
	 }

	 function horoscopeHandler(e) {
		setEventListeners('stop');
		slideLFModTo(lfHoroscope) ;
		setEventListeners('start');
	 }

	 function healthHandler(e) {
		setEventListeners('stop');
		slideLFModTo(lfHealth);
		setEventListeners('start');
	 }

	 function eventHandler(e) {
		setEventListeners('stop');
		slideLFModTo(lfEvent);
		setEventListeners('start');
	 }

	 function climateHandler(e) {
		setEventListeners('stop');
		slideLFModTo(lfClimate) ;
		setEventListeners('start');
	 }	 

	 function skiHandler(e) {
		setEventListeners('stop');
		slideLFModTo(lfSki) ;
		setEventListeners('start');
	 }
/* END CODE ADDITIONS*/
 
	 
	 function setLnkColor() {
		for(i=0; i<navElements.length; i++) {
			document.getElementById(navElements[i]).className = "lfModNav";
		}
		document.getElementById(navElements[curMenu]).className = "lfModNavOn";
	}

	function chkHeights() {
		for(i=0; i<aFtrs.length; i++) {
			if(document.getElementById(aFtrs[i]) == null) {
				document.getElementById(aMains[i]).style.height="359px";
			}
		}
	}

	function chkAro() {
		var curXPos = document.getElementById("lfModContainer").style.left;
		var checkPanel = getPanel(curXPos);
		if(curXPos == "0px") {
			document.getElementById("lfModLtAro").style.backgroundPosition = "0px -25px";
			document.getElementById("lfModLtAro").style.cursor = "default";
		}		
		else {
			document.getElementById("lfModLtAro").style.backgroundPosition = "0px -0px";
			document.getElementById("lfModLtAro").style.cursor = "pointer";			
		}
		if (curXPos == strMaxXPos) {
			document.getElementById("lfModRtAro").style.backgroundPosition = "-24px -25px";
			document.getElementById("lfModRtAro").style.cursor = "default";
		}
		else {
			document.getElementById("lfModRtAro").style.backgroundPosition = "-24px 0px";
			document.getElementById("lfModRtAro").style.cursor = "pointer";			
		}

		showPanel(checkPanel);
	}

	function getPanel(position) {
		var panel = '';
		position = position.replace(/px/,"");
		if(eventflag == 'Y' && horoscopeflag == 'Y') {
			travelCheck = 0;
			horoscopeCheck = -208;
			healthCheck = -416;
			eventCheck = -624;
			climateCheck = -832;
			skiCheck = -1040;
		} else if(eventflag == 'Y' && horoscopeflag == 'N') {
			healthCheck = -208;
			eventCheck = -416;
			climateCheck = -624;
			skiCheck = -832;
		} else if(eventflag == 'N' && horoscopeflag == 'Y') {
			horoscopeCheck = -208;
			healthCheck = -416;
			climateCheck = -624;
			skiCheck = -832;
		} else if(eventflag == 'N' && horoscopeflag == 'N') {
			healthCheck = -208;
			climateCheck = -416;
			skiCheck = -624;
		}

		if(position == 0) {
			panel = 'travel';
		} else if(horoscopeCheck != 0 && horoscopeCheck == position) {
			panel = 'horoscope';
		} else if(healthCheck != 0 && healthCheck == position) {
			panel = 'health';
		} else if(eventCheck != 0 && eventCheck == position) {
			panel = 'events';
		} else if(climateCheck != 0 && climateCheck == position) {
			panel = 'climate';
		} else if(skiCheck != 0 && skiCheck == position) {
			panel = 'ski';
		}
		return panel;

	}

	function slideLFModTo(toX) {
		var cntXPos = document.getElementById("lfModContainer").style.left;
		//console.log('cntXPos  ' + cntXPos);
		
		if(cntXPos=="") {
			cntXPos = "-208px"; //the default pixel offset for health;
		}
			 
/* CODE ADDITIONS*/
/* by Greg Dunn - 03/17/08 */
/* - Added the following code to check if Animation is currently active*/
		if ((cntXPos == '0px') || (cntXPos == '-208px') || (cntXPos == '-416px') ||(cntXPos == '-624px') ||(cntXPos == '-832px') ||(cntXPos == '-1040px')) {
		  //console.log('ok');
			cntXPos = cntXPos.replace(/px/,"");
			byX = toX - cntXPos;
			//console.log('byX  ' + byX);

       
			slideLFModBy(byX);
			return true;
		} else {
      //console.log('in middle of operation');
			return false;
		}
	}
/* END CODE ADDITIONS*/

	function slideLFModBy(byX,animSpeed) {
		//console.log('slideLFModBy');
		if(animSpeed == undefined){animSpeed=.5};
		if (animating) {
			//console.log('animation in progress');
			return false;
		} else {
			//determine number of pixels to move panel
			var cntXPos = document.getElementById("lfModContainer").style.left;
			
			if(cntXPos=="") {
				cntXPos = "-208px"; //the default pixel offset for a panel;
			}
/* CODE ADDITIONS*/
/* by Greg Dunn - 03/17/08 */
/* - Added the following code to check if Animation is currently active*/
		  if ((cntXPos == '0px') || (cntXPos == '-208px') || (cntXPos == '-416px') ||(cntXPos == '-624px') ||(cntXPos == '-832px') ||(cntXPos == '-1040px')) {
/* - Set Animating flag to true*/
				//console.log('passed');
			  animating = true;

/* Exisitng Code */
				cntXPos = cntXPos.replace(/px/,"");
				//console.log('cntXPos  ' + cntXPos + ' / ' + 'byX - ' + byX + ' / maxXpos' + maxXpos);
				if(((cntXPos == 0) && (byX >=0)) || ((cntXPos == maxXpos) && (byX <=0))) {
					//do nothing;
				}
				else {
					/* - Hide iFrame during animation*/		  
					for (x in aFtrs) {
						var elm = document.getElementById(aFtrs[x]);
					  elm.className = "today_specialty_footer iframeHide";
					}
					
					//determine number of pixels to move menu background
					var menuBgPos = document.getElementById("bgSpecNav").style.left;
					if (menuBgPos=="")  {
						menuBgPos = menuPosDefault; //the default pixel offset for a menu tab;
					}
					menuBgPos = parseInt(menuBgPos.replace(/px/,""), 10);
					if ((menuBgPos < menuBGPos[0]) ||(menuBgPos > menuBGPos[2])) {
						//console.log('min/max... ' + menBgPos);
					}
					
					menuArrAdjust = (byX*(-1))/pnlWidth;
					//console.log('menuArrAdjust  ' + menuArrAdjust  + ' / byX - ' + byX + ' / pnlWidth - ' + pnlWidth);
					
					
					curMenu += menuArrAdjust;
					
					//console.log('menuBgPos  ' + menuBgPos  + ' / menuBGPos[curMenu] - ' + menuBGPos[curMenu] + ' / curMenu - ' + curMenu);
					
					menuByX = parseFloat(menuBGPos[curMenu]) - parseFloat(menuBgPos);
					//console.log('menuBgPos  ' + menuBgPos  + ' / curMenu - ' + curMenu + ' / menuByX - ' + menuByX);
					var menuAtt = {
						points: { by: [menuByX, 0] }
					};
					//console.log('menuAtt - ' + menuAtt + ' / menuByX - ' + menuByX)
					var menuAnim = new YAHOO.util.Motion('bgSpecNav', menuAtt, animSpeed);
					menuAnim.animate()
					menuAnim.onComplete.subscribe(setLnkColor);
					thisMenuWidth = menuWidths[curMenu] + "px"
					document.getElementById("bgSpecNav").style.width = thisMenuWidth;
		
					menuCntPos = document.getElementById("lfModTabs").style.left;
					menuCntPos = Number(menuCntPos.replace(/px/,""));
		
					if(menuCntPos != menuPosX[curMenu]) {
						var menuDiff = (Math.abs(menuCntPos) + menuPosX[curMenu]);
						/*if(menuByX < 0) {
							menuDiff = Math.abs(menuDiff);
						}*/
						var menuCntAtt = {
							points: { by: [menuDiff, 0] }
						};
						var menuCntAnim = new YAHOO.util.Motion('lfModTabs', menuCntAtt, animSpeed);
						menuCntAnim.animate()
					}
		
		
					var attributes = {
						points: { by: [byX, 0] }
					};
					var anim = new YAHOO.util.Motion('lfModContainer', attributes, animSpeed);
					anim.animate()
					anim.onComplete.subscribe(chkAro);
					/* - ShowiFrame after animation*/	
					anim.onComplete.subscribe(showIFrame);
				}
			/* - Set Animating flag to false*/
			animating = false;
			
			}
		}
	}
/* CODE ADDITIONS*/
/* by Greg Dunn - 03/17/08 */
/* - Show current Iframe*/
	function showIFrame() {
				//console.log('showIFrame');
				var cntXPos = document.getElementById("lfModContainer").style.left;
				var cntPosIndex = (parseFloat(cntXPos.replace(/px/,""))*(-1))/pnlWidth;
				//console.log('cntPosIndex  ' + cntPosIndex);
				var elm = document.getElementById(aFtrs[cntPosIndex]); 
				elm.className = "today_specialty_footer";
	}
/* END CODE ADDITIONS*/
	

/* CODE ADDITIONS*/
/* by Greg Dunn - 03/17/08 */
/* - Added the following code go to initial selection rather than SlideTo it.*/

  function setLFModTo(toX) {
		if (animating) {
			//console.log('animation in progress');
			return false;
		} else {
			animating = true;
			var cntXPos = document.getElementById("lfModContainer").style.left;
			if(toX=="") {
				cntXPos = "-208px"; //the default pixel offset for a panel;
			} else {
				cntXPos = toX + 'px';
			}
			document.getElementById("lfModContainer").style.left = cntXPos;
			animating = false;
		}
	}
	 
/* END CODE ADDITIONS*/