﻿jQuery.noConflict();

jQuery(function($){

	// for rollover
	var conf={ postfix : '_ov'};
	$('a img[src*=_o]').each(function() {
		$hoverFlag = "_ov";
		this.offSrc = this.src;
		this.overSrc = this.offSrc.replace('_o', '_ov');
		preloadImg(this.overSrc);
	}).hover(function(){
		this.src = this.overSrc;
	},function(){
		this.src = this.offSrc;
	});

  // for onlineshop link(popup)
  $('a[href^="/cart/"]').click(function(){
    cartWin = window.open(this.href,
    "cart",
    "width=665,height=610,toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
    cartWin.focus();
    return false;
  });
  
 
});

//preloadImg
preloadedImages = [];
function preloadImg(url){
	var p = preloadedImages;
	var l = p.length;
	p[l] = new Image();
	p[l].src = url;
}

// for blog feed
google.load("feeds", "1");

function initialize() {
  var feed = new google.feeds.Feed("http://blog.goo.ne.jp/wasabibito/index.rdf");
  feed.setNumEntries(5);   //エントリーの取得数
  feed.load(function(result) {
    if (!result.error) {
      var container = document.getElementById("feed");

      for (var i = 0; i < result.feed.entries.length; i++) {
        var entry = result.feed.entries[i];
      var date = new Date(entry.publishedDate);
      date = date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate();

        var li = document.createElement("li");
        li.innerHTML += '・<a href="' + entry.link + '">' + entry.title + ' <em>(' + date + ')</em></a>';
        container.appendChild(li);
      }
    }
  });
}
google.setOnLoadCallback(initialize);

