/*
 * Javascripts *
 */
 
 
 /********************
 * SmartRollover
 *********************/
 
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}



<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

 /********************
 * accordion lists
 *********************/
 
 // JavaScript Document

$(document).ready(function() {
	$(".navi dt").hover(function(){
		$(this).css("cursor","pointer"); 
	},function(){
		$(this).css("cursor","default"); 
		});
	$(".navi dd").css("display","none");
	$(".navi dt").click(function(){
		$(this).next().slideToggle("fast");
		});
});

 
 	$(document).ready(function () {
		
		$('#accordion li').click(function () {

			//slideup or hide all the Submenu
			$('#accordion li').children('ul').slideUp('fast');	
			
			//remove all the "Over" class, so that the arrow reset to default
			$('#accordion li > a').each(function () {
				if ($(this).attr('rel')!='') {
					$(this).removeClass($(this).attr('rel') + 'Over');	
				}
			});
			
			//show the selected submenu
			$(this).children('ul').slideDown('fast');
			
			//add "Over" class, so that the arrow pointing down
			$(this).children('a').addClass($(this).children('li a').attr('rel') + 'Over');			

		});
	
	});


 /********************
 * Ameba Blog lists
 *********************/

google.load("feeds", "1");  
function initialize()
{  
 //RSSフィードの取得
 var feed = new google.feeds.Feed("http://rssblog.ameba.jp/r-holiday/rss.html");  
 
 //取得するフィード数
 feed.setNumEntries(6)
 
 //実際に読む込む
 feed.load(function(result)
 {  
 
  //読み込めたか判別
  if (!result.error)
  {
   //表示部分を選択
   var container = document.getElementById("feed");
  
   //変数の初期化
   var list = "";
  
   //Feedの処理
   for (var i = 0; i < result.feed.entries.length; i++)
   {  
    //Feedを一つ抽出
    var entry = result.feed.entries[i];
 if(entry.title.match(/^PR:/)) {
 //「PR:」から始まるものがあれば何もしない
 }
 else{
    var div = document.createElement("li");  
    var a = document.createElement("a");
    var strdate = createDateString(entry.publishedDate);
    a.href = entry.link;  
          var list = entry.title + " (" + strdate + ")" ;  
          a.appendChild(document.createTextNode(list));  
          div.appendChild(a);  
          container.appendChild(div);  
        }
  
  }  
     }  
   });  
}

//日付の表示方法を変更
function createDateString(publishedDate)
{
 var pdate = new Date(publishedDate);
 var pday = pdate.getDate();
 var pmonth = pdate.getMonth() + 1;
 var pyear = pdate.getFullYear();
 var phour = pdate.getHours();
 var pminute = pdate.getMinutes();
 var psecond = pdate.getSeconds();
 //var strdate = pyear + "年" + pmonth + "月" + pday + "日" + phour + "時" + pminute + "分" + psecond + "秒";
 var strdate = + pmonth + "-" + pday ;
 return strdate;
}

google.setOnLoadCallback(initialize);  

