// EXTERNAL LINKS IN A NEW WINDOW
function oc(a) {
	var o = {};
	for(var i=0;i<a.length;i++){o[a[i]]='';}
	return o;
}
function buildExternal() {
	$('a').each(function(){
		try{
			domain = $(this).attr("href").match(/:\/\/(.[^/]+)/)[1];
			exceptions = new Array('wildwoodri.com','www.wildwoodri.com');
			/* OPEN PDFS AND EXTERNAL LINKS IN NEW WINDOW */
			if((domain in oc(exceptions)) || ($(this).attr("href").indexOf('.pdf') !== -1)){}else{
				$(this).unbind('click').bind('click',function(){
					window.open($(this).attr("href"));
					return false;		
				});
			}
		}catch(e){}		
	});
}

$(function() {
					 
	// MAIN NAV
	$('#header ul li').hover(function() {
		$(this).addClass('over');
	}, function() {
		$(this).removeClass('over');
	});

	buildExternal();

});
