// ==UserScript==
// @name           Asahis
// @namespace      http://www.nikep.net/asahis/
// @description    Asahi.com UIカスタマイズ設定
// @include        http://*.asahi.com/*
// ==/UserScript==
//
// $Id: asahis.user.js,v 1.3 2010/02/01 01:56:52 satan Exp $
// auther: Shigeki Kaneko <http://www.nikep.net/>
// version: 0.1.0
// Copyright(c): 2010 Shigeki Kaneko, all right reserved.
//
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//

(function(){

    //-->> 設定パラメータ Configuration parameters of the script
    //-- TopBnrというマーキーを削除
    //-- Hide the marquee which id is TopBnr.
    var REMOVE_BANNER = true;

    //-- [PR]を削除
    //-- Remove the [PR] blocks.
    var REMOVE_PRS = true;

    //--<< 設定パラメータ Configuration parameters of the script

    //-- Begin the script
    var currentURL = document.URL;

    if (currentURL == "http://www.asahi.com/" && REMOVE_BANNER) {
	//-- Hide the marquee which id is TopBnr.
	var tr = document.getElementById("TopBnr");
	if (tr) {
	    tr.style.display = "none";
	}
    }    

    if (REMOVE_PRS) {
	var trs = document.getElementsByTagName("div");
	for (var i = 0; i < trs.length; i++) {
	    var tr = trs[i];
	    //-- Remove the [PR] blocks.
	    if (tr.getAttribute("class") == "Box1" && tr.innerHTML.match(/<h2>\[PR\]/i)) {
		tr.style.display = "none";
	    }
	    if (tr.getAttribute("class") == "BnrPr") {
		tr.style.display = "none";
	    }
	}
    }    
})();

