<!--
//DOM switch 
if(document.layers){
	pre = 'document.';
	post = '';
	shortpost = '';
}

if(document.getElementById){
	pre = 'document.getElementById("';
	post = '").style';
	shortpost = '")';
}

if(document.all){
	pre = 'document.all.';
	post = '.style';
	shortpost = '';
}

//dropdown menus
var activeMenu = 0;
var onMenu = null;
var timeOn = null;

function showMenu(menuID){
	menuDIV = menuID+'_menu';
	if (timeOn != null) {
		clearTimeout(timeOn);
		hideMenu(onMenu);
 	}
	eval(pre + menuDIV + post).display = 'block';
	onMenu = menuDIV;
}

function hideMenu(menuDIV){
	if (activeMenu == 0) {
	eval(pre + menuDIV + post).display = 'none';
	}
}

function btnTimer() {
	timeOn = setTimeout("btnOut()",1000);
}

function btnOut() {
	if (onMenu != null) {
	hideMenu(onMenu);
	}
}

function menuOver() {
	clearTimeout(timeOn);
	activeMenu = 1;
}

function menuOut() {
	activeMenu = 0;
	timeOn = setTimeout("hideMenu(onMenu)", 400);
}

//barkers
var onBarker = 'navic';
var BtimeOn = null;
var onBlurb = null;

function showBarker(barkerID){
	if (BtimeOn != null) {
		clearTimeout(BtimeOn);
 	}
	barkerDIV = barkerID+'_barker';
	onBarkerDIV = onBarker+'_barker';
	blurbDIV = barkerID+'_blurb';
	onBlurbDIV = onBarker+'_blurb';
	eval(pre + 'home_cbg' + post).backgroundImage = 'url(/img/barkers/'+barkerID+'_barker_bg.jpg)';
	eval(pre + onBarkerDIV + post).display = 'none';
	eval(pre + barkerDIV + post).display = 'block';
	if (onBlurb != null) {
		eval(pre + onBlurbDIV + post).display = 'none';
	}
	eval(pre + blurbDIV + post).display = 'block';
	onBarker = barkerID;
	onBlurb = barkerID;
}

function resetBarker(){
	if (BtimeOn != null) {
		clearTimeout(BtimeOn);
 	}
	onBarkerDIV = onBarker+'_barker';
	onBlurbDIV = onBarker+'_blurb';
	eval(pre + onBarkerDIV + post).display = 'none';
	eval(pre + onBlurbDIV + post).display = 'none';
	eval(pre + 'navic_barker' + post).display = 'block';
	eval(pre + 'home_cbg' + post).backgroundImage = 'url(/img/barkers/navic_barker_bg.jpg)';
	onBarker = 'navic';
	onBlurb = null;
}

function barkerTimer() {
	BtimeOn = setTimeout("resetBarker()",5000);
}

var map = null;
var collectionID="E53012D2509377EF!101";
		 
function DrawMap()
{
 map = new VEMap('NavicMap');
 map.LoadMap(new VELatLong(42.374996, -71.273525), 15, VEMapStyle.Hybrid, false, VEMapMode.Mode3D, true);
 AddMyLayer(VEDataType.VECollection);
}
					  
function AddMyLayer(type)
{
 var l = new VEShapeLayer();

 var veLayerSpec = new VEShapeSourceSpecification(type, collectionID, l);
 map.ImportShapeLayerData(veLayerSpec, onFeedLoad, false);

}

function onFeedLoad(feed)
{
 // alert('RSS or Collection loaded. There are '+feed.length+' items in this list.');
}
             
function checkContact() {
	var required = new Array("first_name","last_name", "company", "e-mail", "role");
	var checkEmails = new Array("e-mail");
	
	form = document.forms.questionnaire;
	for (i=0;i<required.length;i++) {
		fieldID = required[i];
		if (document.getElementById(fieldID).value == false) {
			var incomplete = true;
			}
		}
	for (i=0;i<checkEmails.length;i++) {
		fieldID = checkEmails[i];
		checkEmail = document.getElementById(fieldID).value;
		if (checkEmail != false) {
			if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.'))) {
				var invalid_email = true;
				}
			}
		}		
	if (incomplete == true) {
		alert('You must complete all fields marked with an asterisk.');
		return false;
		}
	else if (invalid_email == true) {
		alert('You must enter e-mail addresses in a valid e-mail format, such as yourname@domain.com.');
		return false;
		}	
	else {
		form.submit();
	}
}

function enableField(field) {
	_field = document.getElementById(field);
	_field.disabled = false;
	_field.focus();
	}
	
function disableField(field) {
	_field = document.getElementById(field);
	_field.disabled = true;
	}
	
// -->