var lInit = false;
var l1;

function isSwitch(status, before){
	switch(status){
		case '.short':
			if(before){
				if(lInit)
					il.hide();
				jQuery("#ContactMap").animate({ opacity: 0 }, 500, function(){
					jQuery(this).hide();
				})
			} else {
				if(!lInit){
					initContactLine();
				}
				showContactLines();
			}
			break;
		case '.extend':
			if(!before){
				if(!il){
					il = new myLines("#Lines");	
					il.init();
				}
				il.show();
				jQuery("#ContactMap").css({ opacity: 0 }).show().animate({ opacity: 1 }, 500);
			} else {
				hideContactLines();
			}
			break;
	}
	if(!before){
		updateNavigation(status)
	}
	
}

function initInnerLine(){
	if(jQuery("#content-layout .full").length == 0){
		initContactLine();
	}
}

function initContactLine(){
	lInit = true;
	l1 = new AdaptiveLine(function(){
		return { x: 0, y: 0 }
	}, function(){
		_o = $('.short .email');
		_ofs = _o.offset()
		return { x: _ofs.left-30, y: _ofs.top+Math.round(_o.height()/1.8) }
	}, '#Lines');
}

function hideContactLines(){
	l1.hide();
}

function showContactLines(){
	l1.draw();
	l1.show();
}

