// ==UserScript==
// @name          rubyixi
// @namespace     http://a-h.parfe.jp/einfach/ 
// @description    
// @include        http://mixi.jp/*
// ==/UserScript==



(function () {

var log = function(){
	var c = unsafeWindow.console;
	if(c)	c.log.apply(c, arguments);
}
log.o = function(){
		log('ok');
}

document.title = document.title.replace(/mixi/, "Rubyixi");

var favicon = document.createElement('link');
with(favicon){
	type = 'image/x-icon';
	href = 'http://www.ruby-lang.org/favicon.ico';
	rel = 'SHORTCUT ICON';
}

//<link type="image/x-icon" href="http://www.ruby-lang.org/favicon.ico" rel="SHORTCUT ICON"/>

document.body.parentNode.firstChild.appendChild(favicon);

var logo = document.getElementsByTagName('img');
logo[0].src = 'http://www.ruby-lang.org/images/logo.gif';

var map = document.getElementsByTagName('map');
if(map[0])
	map[0].firstChild.href='http://www.ruby-lang.org/ja/';

for(var i=1, l=logo.length; i < l; i++){
	if(logo[i].src.match(/img.*?mixi.jp/)){
		logo[i].style.opacity = 0;
		logo[i].addEventListener('mouseover', showImage, false);
		//logo[i].addEventListener('mouseout', hideImage, false);
	}
}

var iframe = document.getElementsByTagName('iframe');
for(var i=0, l=iframe.length; i < l; i++){
	iframe[i].style.display = 'none';
}


function showImage(){
	this.style.opacity = 100;
}
function hideImage(){
	this.style.opacity = 0;
}

var temp = [
'td {',
	'color: #333 !important',
	'1px solid #8C0000',
	'background-color: #FFEFEF !important',
	'background-image: none !important',
'}',
].join(';');
GM_addStyle(temp);

})();
