$(document).ready(function() {
	$("#vatip").tooltip({ offset: [0, 398] ,effect: 'fade' });
});

$(document).ready(function() {
	$("#bitip").tooltip({ offset: [0, 262],effect: 'fade' });
});

$(document).ready(function() {
	$("#citip").tooltip({ offset: [0, 106],effect: 'fade' });
});

$(document).ready(function() {
	$("#mmtip").tooltip({ offset: [0, -70],effect: 'fade' });
});

$(document).ready(function() {
	$("#pitip").tooltip({ offset: [0, -232],effect: 'fade' });
});


function showmap(mapType){
	var mapDisplay = document.getElementById('map');
	if (mapType == 'andover') {
		mapDisplay.innerHTML = '<a href="http://maps.google.com/maps/place?cid=10109291396696572954" target="_blank" title="Kiley Law Group - 342 North Main Street, Andover, MA 01810 - Click for Larger Map"></a>';
		mapDisplay.style.backgroundImage = "url(http://www.tomkileylaw.com/images/andover.jpg)";
	}
	if (mapType == 'boston') {
		mapDisplay.innerHTML = '<a href="http://maps.google.com/maps/place?cid=2954833316877758362" target="_blank" title="Kiley Law Group - 200 State Street, Boston, Massachusetts 02109 - Click for Larger Map"></a>';
		mapDisplay.style.backgroundImage = "url(http://www.tomkileylaw.com/images/boston.jpg)";
	}	
}

//Contact form country and state drop-down controllers

function countryControl(country)
	{ 
		if (country=='CA') {
			var stateField = document.getElementById('state-display');
			var provinceField = document.getElementById('province-display');
			var stateText = document.getElementById('state-text');
			stateField.style.display = 'none';
			provinceField.style.display = 'block';	
			stateText.innerHTML = 'Canadian Provinces:<font color=#FF0000> *</font>';
		}
		else {
			var stateField = document.getElementById('state-display');
			var provinceField = document.getElementById('province-display');
			var stateText = document.getElementById('state-text');
			stateField.style.display = 'block';
			provinceField.style.display = 'none';
			stateText.innerHTML = 'State:<font color=#FF0000> *</font>';
		}
	}
	
function stateControl() {
		var stateText = document.getElementById('state-text');
		stateText.style.color = '#FF0000';
}

$(document).ready(function() { 
    $("#chat-box").css("position", "fixed"); 
});

function clchat() {
	var chShow = document.getElementById('chat-box');
	chShow.style.display = 'none';
}

