onload = function () {
  rip();
}

function rip() {
  var d = document;
  if(d.images){
    if(!d.MM_p) d.MM_p=new Array();
    var anchorFields = d.getElementsByTagName('A');
    for ( var i =0; i <anchorFields.length ; i++  ) {
      var anchor = anchorFields[i];
      if ( !anchor.firstChild ) continue;
      if ( !anchor.firstChild.src ) continue;
      if ( new String(anchor.firstChild.src).match(/-fir-/) ) {
        var src_on  = new String(anchor.firstChild.src).replace(/-fir-/,'-sec-') ;
        anchor.onmouseover = function () {this.firstChild.src = this.firstChild.src.replace(/-fir-/,'-sec-')};
        anchor.onmouseout  = function () {this.firstChild.src = this.firstChild.src.replace(/-sec-/,'-fir-')};
        d.MM_p[i] = new Image;
        d.MM_p[i].src = src_on;
      }
    }
  }
}

function addBookmark(title,url) {
    if (window.sidebar) {
        window.sidebar.addPanel(title, url,"");
    } else if( document.all ) {
        window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
        return true;
    }
}

function initialize() {
var feed = new google.feeds.Feed("http://pipes.yahoo.com/pipes/pipe.run?URL=http%3A%2F%2Frssblog.ameba.jp%2Fsumaino-quest%2Frss20.xml&_id=DrFZRK663RGaE1sE1pzWFw&_render=rss");
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 dd = new Date(entry.publishedDate); // now
var yearNum = dd.getYear();
if (yearNum < 2000) yearNum += 1900;
var date = '<li>' + yearNum + "."+(dd.getMonth()+1)+"."+dd.getDate()+"  ";
container.innerHTML += "　" + date +"<a href='" + entry.link + "' title='" + entry.title + "'>" + entry.title + "</a></li>";
}
}
});
}
(function($) {
	
	$.fn.opOver = function(op,oa,durationp,durationa){
		
		var c = {
			op:op? op:1.0,
			oa:oa? oa:0.6,
			durationp:durationp? durationp:'fast',
			durationa:durationa? durationa:'fast'
		};
		

		$(this).each(function(){
			$(this).css({
					opacity: c.op,
					filter: "alpha(opacity="+c.op*100+")"
				}).hover(function(){
					$(this).fadeTo(c.durationp,c.oa);
				},function(){
					$(this).fadeTo(c.durationa,c.op);
				})
		});
	},
	
	$.fn.wink = function(durationp,op,oa){

		var c = {
			durationp:durationp? durationp:'200',
			op:op? op:1.0,
			oa:oa? oa:0.2
		};
		
		$(this).each(function(){
			$(this)	.css({
					opacity: c.op,
					filter: "alpha(opacity="+c.op*100+")"
				}).hover(function(){
				$(this).css({
					opacity: c.oa,
					filter: "alpha(opacity="+c.oa*100+")"
				});
				$(this).fadeTo(c.durationp,c.op);
			},function(){
				$(this).css({
					opacity: c.op,
					filter: "alpha(opacity="+c.op*100+")"
				});
			})
		});
	}
	
})(jQuery);
(function($) {
$(function() {

  $('#over1').wink();
  $('#over2').wink();
  $('#over3').wink();
  $('#over4').wink();
  $('#over5').wink();
  $('#over6').wink();
  $('#over7').wink();
  $('#over8').wink();
  $('#over9').wink();
  $('#over10').opOver(1.0,0.6,200,500);
  $('#over11').opOver(1.0,0.6,200,500);
  $('#over12').opOver(1.0,0.6,200,500);
  $('#over13').wink();
  $('#over14').wink();

});
})(jQuery);
$(function () {
	//DropDown Menu
	$('#gnv li').hover(
	function () {
		$('ul.drop', this).stop(true, true).slideDown('normal');
	}, function () {
		$('ul.drop', this).slideUp('fast');
	});

	//DropDown Menu On
	$('ul.drop').each(function () {
		var parentImg = $(this).parent().find('img');
		var parentOf = parentImg.attr('src');
		var parentOn = parentOf.replace('_of.', '_ov.');
		$(this).hover(
		function () {
			parentImg.attr('src', parentOn);
		}, function () {
			parentImg.attr('src', parentOf);
		});
	});

	// Rollover
        $('img,input[type=image]').each(function () {
                var ofSrc = $(this).attr('src');
                var ovSrc = ofSrc.replace('_of.', '_ov.');
                $(this).hover(function () {
                        $(this).attr('src', ovSrc);
                }, function () {
                        $(this).attr('src', ofSrc);
                });
                $(window).unload(function () {
                        $(this).attr('src', ofSrc);
                });
        });
});
