function goHome() {
	window.location = "http://www.francesco.iovine.name/";
}
function goLinkedin() {
	window.location = "http://www.francesco.iovine.name/";
}
function goWordpress() {
	window.location = "http://www.francesco.iovine.name/blog/?nosidebar=";
}
function goFlickr() {
	window.location = "http://www.francesco.iovine.name/";
}
function goBlogger() {
	window.location = "http://www.francesco.iovine.name/";
}
function goDelicious() {
	window.location = "http://delicious.com/franciov";
}


function showFacebook() {
	hideHome();
	hideSections();
	$("#loader").fadeIn();
	$("#iframe").html('<iframe id="content_iframe" class="content_iframe" name="content_iframe" src="http://www.facebook.com/franciov" frameborder="0" scrolling="auto"></iframe>');
	$("#iframe").show();
}

function showFlickr() {
	hideHome();
	hideSections();
	$("#loader").hide();
	/*
	$("#loader").fadeIn();
	$("#iframe").html('<iframe id="content_iframe" class="content_iframe" name="content_iframe" src="http://www.flickr.com/photos/franciov/" frameborder="0" scrolling="auto"></iframe>');
	$("#iframe").show();
	*/
	$("#iframe_flickr").animate({ top: "150px", left: "0" }, 500 );
	$("#iframe_flickr").show();	
}

function showLinkedin() {
	hideHome();
	hideSections();
	$("#loader").fadeIn();
	$("#iframe").html('<iframe id="content_iframe" class="content_iframe" name="content_iframe" src="http://www.linkedin.com/in/franciov" frameborder="0" scrolling="auto"></iframe>');
	$("#iframe").show();
}

function showWordpress() {
	hideHome();
	hideSections();
	$("#loader").fadeIn();
	$("#iframe").html('<iframe id="content_iframe" class="content_iframe" name="content_iframe" src="http://www.francesco.iovine.name/blog/?nosidebar=&nomenu=" frameborder="0" scrolling="auto"></iframe>');
	$("#iframe").show();
}

function showBlogger() {
	hideHome();
	hideSections();
	$("#loader").fadeIn();
	$("#iframe").html('<iframe id="content_iframe" class="content_iframe" name="content_iframe" src="http://franciov.blogspot.com" frameborder="0" scrolling="auto"></iframe>');
	$("#iframe").show();
}

function showDelicious() {
	hideHome();
	hideSections();
	$("#loader").fadeIn();
	$("#iframe").html('<iframe id="content_iframe" class="content_iframe" name="content_iframe" src="http://delicious.com/franciov" frameborder="0" scrolling="auto"></iframe>');
	$("#iframe").show();
}

function showHome() {
	hideSections();
	$("#loader").hide();
	
	$("#facebook").fadeIn("slow");
	$("#flickr").fadeIn("slow");
	$("#linkedin").fadeIn("slow");
	$("#twitter_div").fadeIn("slow");
	$("#wordpress").fadeIn("slow");
	$("#delicious").fadeIn("slow");
}

function hideHome() {
	$("#facebook").hide();
	$("#flickr").hide();
	$("#linkedin").hide();
	$("#twitter_div").hide();
	$("#wordpress").hide();
	$("#delicious").hide();
}
function hideSections() {
	$("#iframe").hide();
	$("#iframe_flickr").hide();	
}

var currentpage = "homeli";

function deselectCurrentPage() {
	$("#" + currentpage).removeClass("hover");
}

function selectCurrentPage() {
	$("#" + currentpage).addClass("menubox_hover");
}

function isCurrentPage(id) {
	return (currentpage == id);
}

function init() {
	currentpage = "homeli";
	
	$("#facebook").hide();
	$("#flickr").hide();
	$("#linkedin").hide();
	$("#wordpress").hide();
	$("#twitter_div").hide();
	$("#delicious").hide();
	
	/* MENU 
	selectCurrentPage();
	$("#menu li").hover(
		function(){
			// setTimeout("deselectCurrentPage()", 1000);
			$("#menu li").removeClass("menubox_hover");
			$(this).addClass("menubox_hover");
		},
		function(){
			$("#menu li").removeClass("menubox_hover");
			setTimeout("selectCurrentPage()", 2000);
		}
	);
	$("#menu li").click(
		function(){
			currentpage = $(this).attr("id");
		}
	);	

	$("#homeli").click(showHome);
	$("#flickrli").click(showFlickr);
	$("#linkedinli").click(showLinkedin);
	$("#wordpressli").click(showWordpress);
	$("#bloggerli").click(showBlogger);
	
	*/
	
	/* LINKS */
	$(".flickr_badge_image").children("a").attr("target", "_blank");
	$("#twitter_update_list").children().children().children("a").attr("target", "_blank");
		
	/* BOXES */
	$(".box").hover(
		function() {
			$(this).addClass("hover");
		},
		function() {
			$(this).removeClass("hover");
		}
	);
	
	/* BODY */
	$("#wordpress").animate({ top: "12%", left: "3%" }, 500 );
	$("#facebook").animate({ top: "14%", left: "45%" }, 500 );
	$("#twitter_div").animate({ top: "12%", left: "59%" }, 500 );
	$("#delicious").animate({ top: "63%", left: "3%" }, 500 );
	$("#linkedin").animate({ top: "59%", left: "43%" }, 500 );
	$("#flickr").animate({ top: "63%", left: "59%" }, 500 );
}

function main() {
	init();
	showHome();
}
