// ==UserScript==
// @name          NoAd_mixi
// @namespace     http://www.smzl.info/home/tn/
// @include       http://mixi.jp/*
// @include       http://*.mixi.jp/*
// ==/UserScript==

(function() {

	if (true) {

		var scripts = document.getElementsByTagName('script');
		
		var cur1 = scripts.item(1);
		var cur2 = scripts.item(2);
		var next = cur1.nextSibling;
		
		var table = document.createElement("table");
		table.setAttribute("align", "center");
		table.setAttribute("width", "553");
		table.setAttribute("height", "60");
		table.setAttribute("border", "0");
		table.setAttribute("background", "http://img.mixi.jp/img/title2-.gif");
		table.innerHTML = '<tr><td> </td></tr>';
		
		cur1.parentNode.insertBefore(table, cur1);
		
		cur1.parentNode.removeChild(cur1);
		next.parentNode.removeChild(next);
		
		
		if (document.URL == "http://mixi.jp/" || 
			document.URL == "http://mixi.jp/home.pl") {
			next = cur2.nextSibling;
			var table = document.createElement("table");
			table.setAttribute("align", "center");
			table.setAttribute("width", "0");
			table.innerHTML = '<tr><td> </td></tr>';
			
			cur2.parentNode.insertBefore(table, cur2);
			
			cur2.parentNode.removeChild(cur2);
			next.parentNode.removeChild(next);
			
			var tables = document.getElementsByTagName('table');
			for (var i=0; i<tables.length; i++) {
				if (tables.item(i).getAttribute("width") == "710") {
					tables.item(i).setAttribute("width","940");
				} else if (tables.item(i).getAttribute("width") == "553" & tables.item(i).getAttribute("height") != "60" ) {
					tables.item(i).setAttribute("width","810");
				} else if (tables.item(i).getAttribute("width") == "570") {
					tables.item(i).setAttribute("width","800");
				} else if (tables.item(i).getAttribute("width") == "565") {
					tables.item(i).setAttribute("width","795");
				} else if (tables.item(i).getAttribute("width") == "448") {
					tables.item(i).setAttribute("width","678");
				}
			}
		}


	}

})();

