//--------------------------------------------------------------------------
function loadBookmark(){
	var t = $("input[name=t]").val();
	// var u = "http://pipes.yahoo.com/pipes/pipe.run?_id=b50faf02febcbd841d6b288bdc544582&_render=json";
	var u = "http://pipes.yahoo.com/pipes/pipe.run?_id=b50faf02febcbd841d6b288bdc544582&_render=json&_callback=?";
	$.getJSON(u,function(d){
		var items = d['value']['items'];
		var dt = new Date();
		var ft = dt.format('YmdHis',items[0]['dc:date']);ft -= 0;
		if(ft > t){
			$("input[name=t]").val(ft);
			var len = items.length - 1;
			var html = "";var link = "";var title = "";var udate = "";var service = "";
			for(i = len;i > -1;i --){
				service = items[i]['service'];
				link = items[i]['link'];
				title = items[i]['title'];
				stitle = title.slice(0,10) + "...";
				udate = dt.format('YmdHis',items[i]['dc:date']);
				if(udate > t){
					html = "";
					html = service + "<a href='" + link + "' target='_blank' title='" + title + "'>" + stitle + "</a><br />"
					$("div#startPoint").after(html);
				}
			}
		}
	});
}

$(document).ready(function(){
	// -------------------------------------------------------------------------
	$("#column_right li").hover(
		function(){
			$(this).css({"background-color":"#f9c0c0"});
		}
		,function(){
			$(this).css({"background-color":"#ffffff"});
		}
	);

	// -------------------------------------------------------------------------
	$("#boxmenu li").hover(
		function(){
			$(this).css({"background-color":"#f9c0c0"});
		}
		,function(){
			$(this).css({"background-color":"#ffffff"});
		}
	);

	// -------------------------------------------------------------------------
	$("#boxmenu li").click(function(){
		var id = $(this).attr("Id");
		var dp = $("." + id).css("display");
		if(dp === "none"){
			$(".top").css({"display":"none"});
			$(".blog").css({"display":"none"});
			$(".idntfy").css({"display":"none"});
			$("." + id).fadeIn(500);
		}
	});

	// -------------------------------------------------------------------------
	$("#column_right li").click(function(){
		var id = $(this).attr("Id");
		var w = $("#column_left").width();
		var dp = $("." + id).css("display");
		if(id === 'rowSwitch06'){
			if(w == 0){
				$("#column_detail").animate({
					width:"0px"
				},500,function(){
					$("#column_detail").children().css({"display":"none"});
					$("#column_left").children().fadeIn(500);
					$("#column_center").children().fadeIn(500);
					$("#column_left").animate({
						width:"395px"
					},500);
					$("#column_center").animate({
						width:"160px"
					},500);
				});
			}
		}else{
			if(w > 0){
				$("#column_left").children().fadeOut(500);
				$("#column_center").children().fadeOut(500);
				$("#column_left").animate({
					width:"0px"
				},500);
				$("#column_center").animate({
					width:"0px"
				},500,function(){
					$("#column_detail").animate({
						width:"570px"
					},100,function(){
						$("." + id).fadeIn(250);
					});
				});
			}else{
				if(dp == "none"){
					$("#column_detail").children().css({"display":"none"});
					$("." + id).fadeIn(250);
				}
			}
		}
	});

	//--------------------------------------------------------------------------
	x = setInterval(loadBookmark(),120000);
});