

$(document).ready(function() {
	// content-tbl jQuery
	$(".content-tbl tr:odd").addClass("alt");

	// clears the default search box value on focus
	$('#header input[type="text"]').focus(function() {
		this.style.color = "#666";
		if (this.value == this.defaultValue) {
			this.value = "";
		} else {
			this.select();
		}
	}).blur(function() {
		this.style.color = "#ccc";
		if (this.value == "") this.value = this.defaultValue;
	});

	// print page link
	$("#footer .print-page a").click(function(event) {
		window.print();
		event.preventDefault();
	});



	$('a[rel="popup"]').click(function(event) {
		window.open(this.href, "telecom_form", "width=792,height=500,scrollbars=yes,status=yes,resizable=yes");
		event.preventDefault();
	});

	$("a.storelocatorlink").click(function(event) {
		var id = (new Date()).getTime();
		window.open(this.href, id, "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=975,height=675");
		event.preventDefault();
	});


	// tooltips
	$("span.definition").each(function(){
		var title = ($(this).attr("title"));
		$(this).tooltip({
			bodyHandler: function(){
				return $("<div class=\"content\"><span>" + title + "</span></div><div class=\"bottom\"></div>");
			},
			track: true,
			delay: 0,
			showURL: false,
			opacity: 1,
			fixPNG: true,
			top: -16
		});
	});
});


function getCookie(name) {
	var dcookie = document.cookie;
	var prefix = name + "=";
	var begin = dcookie.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dcookie.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
	}
	var end = dcookie.indexOf(";", begin);
	if (end == -1) end = dcookie.length;
	return unescape(dcookie.substring(begin + prefix.length, end));
}

