// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var Nav = {
	go0: "index.html",
	go1: "iPhonedev.html"
}

$(document).ready( function () {
	$("#email-link").click(function () {
		Nav.email();
		return false;
	});

	$(".sectionbtn").each( function () {
		if (Nav[$(this).attr("id")] && (!$(this).hasClass("selected")))
			$(this).click(function () {
				document.location.href=Nav[$(this).attr("id")];
			})
	})
	
	$(".popup").each( function () {
		var link = $(this).attr("href");
		$(this).attr("href","#");
		$(this).click( function () {
			Nav.popup(link);
			return false;	
		})
	})
});

Nav.popup = function (link)
{
	window.open(link, "screenshot","resizable=no,menubar=no,status=no,scrollbars=no,title=no,height=480px,width=320px");
};

Nav.email = function () {
	document.location.href = "mail" + "to:" + "drilbu" + "." + "hk" +
		"@gmail.com";
};

Nav.preload = function (arrayOfImages) {
    $(arrayOfImages).each(function(){
        $('<img/>')[0].src = this;
        // Alternatively you could use:
        // (new Image()).src = this;
    });
};
