/* スタイルシートにプロパティを追加 */
function insetRule(selector,declarations){
	var sheets=document.styleSheets;
	if (sheets){
		for (var i=0; i < sheets.length; i++){
			if ((sheets[i].disabled == false)||(!sheets[i].title)) {
				if ((!!window.ActiveXObject)&&(navigator.userAgent.indexOf("MSIE"))) sheets[i].addRule(selector,declarations);
				else sheets[i].insertRule(selector+"{"+declarations+"}",sheets[i].cssRules.length);
			}
		}
	}
}

/* スタイルシートに設定するプロパティ */
// 例 insetRule('dd#banner-sec dl dd','display:none;');

/* スタイルシート全てを OFF/ON */
function allCSSoff(param){
	if (document.styleSheets) {
		var allCSS = document.styleSheets;
		if (param != 'ON'){
			for (var i=0; i < allCSS.length; i++) allCSS[i].disabled = true;
		}
		else {
			for (var i=0; i < allCSS.length; i++) allCSS[i].disabled = false;
		}
	}
}


/* 外部サイトを新規ウィンドウで開く(use jQuery) */
function openNewWin(target) {
	if ($(target)) {
	var trg = $(target);
	trg.click(function(){window.open(this.href);return false;});
	trg.keypress(function(){window.open(this.href);return false;});
	for (var i=0;i<trg.length;i++) trg[i].title = trg[i].title+'(新規ウィンドウ→)';
	}
}


$(document).ready(function(){
	openNewWin('a.external');
});
