$(document).ready(function() {
	// hides the slickbox as soon as the DOM is ready
	// (a little sooner than page load)
	$('span.slick').hide();
	// shows the slickbox on clicking the noted link
	//$('div#slick1').click(function() {
		//$('span#slick1').show('slow');
		//return false;
	//});
	$('div#slick1').toggle(function() {
		$('#slick1 > span').show();
		return false;
		},function() {
		$('#slick1 > span').hide();
		return false;
		}
	);
	$('div#slick2').toggle(function() {
		$('#slick2 > span').show();
		return false;
		},function() {
		$('#slick2 > span').hide();
		return false;
		}
	);
	$('div#slick3').toggle(function() {
		$('#slick3 > span').show();
		return false;
		},function() {
		$('#slick3 > span').hide();
		return false;
		}
	);
	$('div#slick4').toggle(function() {
		$('#slick4 > span').show();
		return false;
		},function() {
		$('#slick4 > span').hide();
		return false;
		}
	);
	$('div#slick5').toggle(function() {
		$('#slick5 > span').show();
		return false;
		},function() {
		$('#slick5 > span').hide();
		return false;
		}
	);
	$('div#slick6').toggle(function() {
		$('#slick6 > span').show();
		return false;
		},function() {
		$('#slick6 > span').hide();
		return false;
		}
	);
	$('div#slick7').toggle(function() {
		$('#slick7 > span').show();
		return false;
		},function() {
		$('#slick7 > span').hide();
		return false;
		}
	);
	$('div#slick8').toggle(function() {
		$('#slick8 > span').show();
		return false;
		},function() {
		$('#slick8 > span').hide();
		return false;
		}
	);
	$('div#slick9').toggle(function() {
		$('#slick9 > span').show();
		return false;
		},function() {
		$('#slick9 > span').hide();
		return false;
		}
	);
	$('div#slick10').toggle(function() {
		$('#slick10 > span').show();
		return false;
		},function() {
		$('#slick10 > span').hide();
		return false;
		}
	);
	$('div#slick11').toggle(function() {
		$('#slick11 > span').show();
		return false;
		},function() {
		$('#slick11 > span').hide();
		return false;
		}
	);
	$('div#slick12').toggle(function() {
		$('#slick12 > span').show();
		return false;
		},function() {
		$('#slick12 > span').hide();
		return false;
		}
	);
	$('div#slick13').toggle(function() {
		$('#slick13 > span').show();
		return false;
		},function() {
		$('#slick13 > span').hide();
		return false;
		}
	);
	$('div#slick14').toggle(function() {
		$('#slick14 > span').show();
		return false;
		},function() {
		$('#slick14 > span').hide();
		return false;
		}
	);
	$('div#slick15').toggle(function() {
		$('#slick15 > span').show();
		return false;
		},function() {
		$('#slick15 > span').hide();
		return false;
		}
	);
	
	// hides the slickbox on clicking the noted link
	$('a#slick-hide').click(function() {
		$('#slickbox').hide('fast');
		return false;
	});
	// toggles the slickbox on clicking the noted link
	$('a#slick-toggle').click(function() {
	$('#slickbox').toggle(400);
	return false;
	});
	
	
	$('div.slick-container').mouseover(function() {
		$(this).css('cursor','pointer');
		});
});

$(document).ready(function(){
    $("#top-nav li").hover(
        function(){ $("ul", this).show(); }, 
        function() { $("ul", this).hide(); } 
    );
    if (document.all) {
        $("#top-nav li").hoverClass ("sfhover");
    }
});

$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};   


$(document).ready(function() {
	$("a").each(
		function() {
			if(this.href.indexOf(location.hostname) == -1 && this.href.indexOf('javascript') < 0 && this.href.indexOf('mailto') < 0) {
				$(this).attr('target', '_blank');
				$(this).click(function() {alert("The Town & Country Insurance website provides links to other websites for convenience and informational purposes only. Users should be aware that when they select a link on the Town & Country Insurance’s website to an external website, they are leaving the Town & Country Insurance's site. Linked sites are not under the control of Town & Country Insurance, and Town & Country Insurance is not responsible for the contents of any linked site or any link contained in a linked site, or any changes or updates to such sites. Town & Country Insurance is not responsible for any transmission received from a linked site. The inclusion of a link does not imply endorsement by Town & Country Insurance of the site, its content, advertisers or sponsors. External sites may contain information that is copyrighted with restrictions on reuse. Permission to use copyrighted materials must be obtained from the original source and cannot be obtained from the Town & Country Insurance.");});
			}
		}
	)
	$(".disclaimer").click( function() {
		//$(this).attr('target', '_blank');
		alert("The Town & Country Insurance website provides links to other websites for convenience and informational purposes only. Users should be aware that when they select a link on the Town & Country Insurance’s website to an external website, they are leaving the Town & Country Insurance's site. Linked sites are not under the control of Town & Country Insurance, and Town & Country Insurance is not responsible for the contents of any linked site or any link contained in a linked site, or any changes or updates to such sites. Town & Country Insurance is not responsible for any transmission received from a linked site. The inclusion of a link does not imply endorsement by Town & Country Insurance of the site, its content, advertisers or sponsors. External sites may contain information that is copyrighted with restrictions on reuse. Permission to use copyrighted materials must be obtained from the original source and cannot be obtained from the Town & Country Insurance.");
	});
});