function winMap(theURL) { 
	var popW = 360;
	var popH = 350;
	var scroll = 'yes';
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable'
	Win = window.open(theURL, '', winProp)
	if (parseInt(navigator.appVersion) >= 4) { 
		Win.window.focus(); 
	}
}
function mTo(mDom, mUser){
	return("mail"+"to:"+mUser.replace(/%23/g,".")+"@"+mDom.replace(/%23/g,"."));
}

function showMap(ev,town) {
	var e = ev ? ev : window.event;
	var s = e.clientX + ',' + e.clientY;
	//set pic:
	var dotTop = 0;
	var dotLeft = 0;
	if (town=='Battle Harbour') {
		dotTop = -43; dotLeft = 154;
	}
	else if (town=='Black Tickle') {
		dotTop = -71; dotLeft = 150;
	}
	else if (town=='Blanc Sablon') {
		dotTop = -28; dotLeft = 133;
	}
	else if (town=='Capstan Island' || town=='West St. Modeste' || town=='Pinware') {
		dotTop = -33; dotLeft = 148;
	}
	else if (town=='Cartwright') {
		dotTop = -80; dotLeft = 132;
	}
	else if (town=='Charlottetown' || town=='Pinsent\'s Arm') {
		dotTop = -58; dotLeft = 149;
	}
	else if (town=='Churchill Falls') {
		dotTop = -74; dotLeft = 42;
	}
	else if (town=='Happy Valley-Goose Bay') {
		dotTop = -70; dotLeft = 92;
	}
	else if (town=='Hopedale') {
		dotTop = -116; dotLeft = 92;
	}
	else if (town=='Labrador City' || town=='Wabush') {
		dotTop = -60; dotLeft = 7;
	}
	else if (town=='L\'Anse au Clair') {
		dotTop = -30; dotLeft = 136;
	}
	else if (town=='L\'Anse au Loup' || town=='L\'Anse Amour' || town=='Forteau') {
		dotTop = -32; dotLeft = 146;
	}
	else if (town=='Makkovik') {
		dotTop = -104; dotLeft = 117;
	}
	else if (town=='Mary\'s Harbour' || town=='Lodge Bay' || town=='St. Lewis') {
		dotTop = -47; dotLeft = 148;
	}
	else if (town=='Mud Lake') {
		dotTop = -66; dotLeft = 97;
	}
	else if (town=='Nain') {
		dotTop = -137; dotLeft = 77;
	}
	else if (town=='Natuashish' || town=='Davis Inlet') {
		dotTop = -126; dotLeft = 82;
	}
	else if (town=='Norman Bay') {
		dotTop = -58; dotLeft = 150;
	}
	else if (town=='North West River' || town=='Sheshatshiu') {
		dotTop = -71; dotLeft = 99;
	}
	else if (town=='Paradise River') {
		dotTop = -70; dotLeft = 127;
	}
	else if (town=='Port Hope Simpson') {
		dotTop = -53; dotLeft = 148;
	}
	else if (town=='Postville') {
		dotTop = -103; dotLeft = 112;
	}
	else if (town=='Red Bay') {
		dotTop = -36; dotLeft = 149;
	}
	else if (town=='Rigolet') {
		dotTop = -88; dotLeft = 120;
	}
        else if (town=='St. Barbe') {
                dotTop = -21; dotLeft = 145;
        }
	else if (town=='William\'s Harbour') {
		dotTop = -53; dotLeft = 151;
	}

  var scrollX = 0, scrollY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrollY = window.pageYOffset;
    scrollX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrollY = document.body.scrollTop;
    scrollX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrollY = document.documentElement.scrollTop;
    scrollX = document.documentElement.scrollLeft;
  }
	
	if (scrollY) {
		posY = scrollY+e.clientY-110;
	}
	else {
		posY = e.clientY-118;
	}
	if (town=='Blanc Sablon') town='Blanc Sablon<br>(Quebec)';
	if (town=='St. Barbe') town='St. Barbe<br>(Newfoundland)';
	document.getElementById('mapTown').innerHTML = town;
	
	//      var posY = adjustY+e.clientY;
	
	document.getElementById('littleMap').style.visibility = 'visible';
	document.getElementById('littleMap').style.left = e.clientX - 90 + 'px';
	document.getElementById('littleMap').style.top = posY + 'px';
	
	document.getElementById('mapDot').style.top = dotTop + 'px';
	document.getElementById('mapDot').style.left = dotLeft + 'px';

}


function hideMap() {
	if (document.getElementById('littleMap').style.visibility=='visible') {
		document.getElementById('littleMap').style.visibility = 'hidden';
	}
}

function mpgPlay(theURL) {
	var popW = 650;
	var popH = 450;
	var scroll = 'no';
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable'
	Win = window.open(theURL, '', winProp)
	if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}

