function _open(event, source)
{
	var newWindow = window.open(source);
	newWindow.focus();
	event.returnValue = false;
	return false;
}

$(document).ready(function() {
	// menu
	/*
	var url = window.location.toString();
	if (url.indexOf("/about") > 0) $("li#mmAbout img").attr("src", "/images/menu/about-on.jpg");
	else if (url.indexOf("/services") > 0) $("li#mmServices img").attr("src", "/images/menu/services-on.jpg");
	else if (url.indexOf("/portfolio") > 0) $("li#mmPortfolio img").attr("src", "/images/menu/portfolio-on.jpg");
	else if (url.indexOf("/contact") > 0) $("li#mmContact img").attr("src", "/images/menu/contact-on.jpg");
	*/
	
	$("ul#mainMenu img").hover(
		function () {
			$(this).attr("src", "/images/menu/" + $(this).attr("alt").toLowerCase() + "-on.jpg");
		}, 
		function () {
			if (!$(this).parent().hasClass("current"))
				$(this).attr("src", "/images/menu/" + $(this).attr("alt").toLowerCase() + ".jpg");
		}
    );
	
	$("a#logo img").hover(
		function () {
			$(this).attr("src", "/images/logo-on.jpg");
		}, 
		function () {
			$(this).attr("src", "/images/logo.jpg");
		}
    );
	// replace w/ image // /g: global search
	/*
	$("h1.imgRepl").each(function() {
		var h1Text =  $(this).html();
		$(this).html('<img src="/images/h1/' + h1Text.toLowerCase().replace(/ /g, "-") + '.jpg" alt="' + h1Text + '" />')
	});
	
	$("h2.imgRepl").each(function() {
		var h2Text =  $(this).html();
		$(this).html('<img src="/images/h2/' + h2Text.toLowerCase().replace(/ /g, "-") + '.jpg" alt="' + h2Text + '" />');
	});
	$("p.banner").each(function() {
		var quote =  $(this).html();
		$(this).html('<img src="/images/banners/' + $(this).attr("title") + '.jpg" alt="' + quote + '" />');
	});*/
	
	// preload images
	var img;
	img = new Image(); img.src = "/images/logo-on.jpg";
	img = new Image(); img.src = "/images/menu/about-on.jpg";
	img = new Image(); img.src = "/images/menu/services-on.jpg";
	img = new Image(); img.src = "/images/menu/portfolio-on.jpg";
	img = new Image(); img.src = "/images/menu/contact-on.jpg";
	img = new Image(); img.src = "/images/h1/about.jpg";
	img = new Image(); img.src = "/images/h1/services.jpg";
	img = new Image(); img.src = "/images/h1/portfolio.jpg";
	img = new Image(); img.src = "/images/h1/contact.jpg";
});
