function toggleLogin(dropType, coverOverlay) {
	var isBlankArea = 0;
	
		
	$('storeLocatorArea').setStyle('opacity',1);
	$('memberLoginArea').setStyle('opacity',1);
	
	if (dropType == 'memberLogin'){
		otherArea = $('storeLocatorArea');
		$(otherArea).setStyles({'opacity':1});
		otherAreaTop = $('storeLocatorArea').getStyle('top');
	} else {
		otherArea = $('memberLoginArea');
		$(otherArea).setStyles({'opacity':1});
		otherAreaTop = $('memberLoginArea').getStyle('top');
	} 
	
	var areaClicked = dropType;
	var areaElement = $(dropType + 'Area');
	var areaTop = areaElement.getStyle('top');
	
	
	if (areaTop == "-162px" && otherAreaTop == "-162px") {
		
		var coverTest = $('coverDiv');
		if (coverTest){
			$(coverTest).getParent().removeChild(coverTest);
		}
		
		$(areaElement).morph({'top':'0px'});
		//set the z-index to 999
		$(areaElement).setStyles({'z-index':'998'});
		//$(areaClicked).morph({'top':'145px'});
		$('topRightBoxClick').morph({'top':'145px'});
		$('topRightBoxClick').setStyle('z-index',999);
		
		divWidth = ($(window).getWidth() - 20);
		divHeight = ($(window).getHeight() - 20);
		var coverDiv = new Element('DIV', {
			'styles':{
				'z-index':'996',
				'position':'absolute',
				'top':'0px',
				'left':'0px',
				'width':divWidth,
				'height':divHeight
			},
			'id':'coverDiv'
		});
	
		coverDiv.addEvent('click',function() {
			var storeTop = $('storeLocatorArea').getStyle('top');
			var memberTop = $('memberLoginArea').getStyle('top');
		
			if (storeTop == '-162px'){
				toggleLogin('memberLogin');
				//$(this).getParent().removeChild(this);
			} else {
				toggleLogin('storeLocator');
				//$(this).getParent().removeChild(this);
			}
	
			
		});
	
		$(document.body).appendChild(coverDiv);
	
		
	} else if (areaTop == "-162px" && otherAreaTop == "0px") {
		var coverTest = $('coverDiv');
		if ((coverTest) && (coverOverlay == 1)){
			$(coverTest).getParent().removeChild(coverTest);
		}
		
		$(areaElement).setStyles({
			'opacity':0,
			'top': '0px',
			'z-index':'997'
		 });
								   
		$(areaElement).set('morph',{
			onComplete: function() {
				$(areaElement).morph({'opacity':1}); 
				$(otherArea).morph({'opacity':0});
				$(otherArea).setStyle('top','-162px');
			}
		});  
							
		$(areaElement).morph({
			'top': '0px;'
		});  

	
	} else {
		var coverTest = $('coverDiv');
		if (coverTest){
			$(coverTest).getParent().removeChild(coverTest);
		}
		$(areaElement).morph({'top':'-162px'});
		//$(areaClicked).morph({'top':'0'});
		 $('topRightBoxClick').morph({'top':'0px'});
	}

}
      
