function OpenTrackback (c) {
    window.open(c,
                    'trackback',
                    'width=480,height=480,scrollbars=yes,status=yes');
}

var HOST = 'enema.x51.org';

// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
    document.cookie = curCookie;
}

function getCookie (name) {
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie (name, path, domain) {
    if (getCookie(name))
        document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function fixDate (date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0)
        date.setTime(date.getTime() - skew);
}

function rememberMe (f) {
    var now = new Date();
    fixDate(now);
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    setCookie('mtcmtauth', f.author.value, now, '', HOST, '');
    setCookie('mtcmtmail', f.email.value, now, '', HOST, '');
    setCookie('mtcmthome', f.url.value, now, '', HOST, '');
}

function forgetMe (f) {
    deleteCookie('mtcmtmail', '', HOST);
    deleteCookie('mtcmthome', '', HOST);
    deleteCookie('mtcmtauth', '', HOST);
    f.email.value = '';
    f.author.value = '';
    f.url.value = '';
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
   if (restore) selObj.selectedIndex=0;
   } 



function insertCommentRef(n) {
    document.comments_form.text.value += ">>" + n + "\n";
    document.comments_form.text.focus();
}
  



//URL BRAKE

(function () {
	var resolver = document.createNSResolver(document.documentElement);
	var nodes = document.evaluate(
			'/descendant::*[not(contains(" TITLE STYLE SCRIPT TEXTAREA XMP ", concat(" ", local-name(), " ")))]/child::text()',
			document.documentElement,
			resolver,
			XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
			null
		);
	var regexp = new RegExp("([!-%'-/:=\\?@\\[-`\\{-~]|&amp;)");
	var range  = document.createRange();
	var wbr    = document.createElement('wbr');
	var lastIndex;
	var node;
	for (var i = 0; i < nodes.snapshotLength; i++)
	{
		node = nodes.snapshotItem(i);
		range.selectNode(node);
		while (node && (lastIndex = range.toString().search(regexp)) > -1)
		{
			range.setStart(node, lastIndex+RegExp.$1.length);
			range.insertNode(wbr.cloneNode(true));
			node = node.nextSibling.nextSibling;
			range.selectNode(node);
		}
	}
	range.detach();
})();


// スクロール始めのスクロール量
var SCROLL ;

var divCountScroller = 50 ; // 分割数（何段階でスクロールするか）

// 現在のスクロール位置から、指定座標までスクロールします
// 使用方法は BODY部ソースを参考
function scroller( x, y, count ){
	
	if( count === void 0 ){
		
		count = 0 ;
		SCROLL = getScroll();
		
	}
	
	if( count++ < divCountScroller ){
		
		var c = count/divCountScroller ;
		
		var nx = SCROLL.x+( x-SCROLL.x )*( c+1/Math.PI*Math.sin( Math.PI*c ) );
		var ny = SCROLL.y+( y-SCROLL.y )*( c+2/Math.PI*Math.sin( Math.PI*c ) );
		
		window.scrollTo( nx, ny );
		
		setTimeout( "scroller("+x+","+y+","+count+");", 7 ); // 再描画時間 10[msec] 小さい程早い
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
      eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
      if (restore) selObj.selectedIndex=0;
      }


var clickmessage=''
	function disableclick(e) {
		if (document.all) {
		if (event.button==2||event.button==3) {
		if (event.srcElement.tagName=='IMG'){
		alert(clickmessage);
		return false;
		}
		}
	} else if (document.layers) {
		if (e.which == 3) {
		alert(clickmessage);
		return false;
		}
	} else if (document.getElementById) {
		if (e.which==3&&e.target.tagName=='IMG'){
		alert(clickmessage)
		return false;
		}
		}
	}
	function associateimages() {
		for(i=0; i<document.images.length;i++) {
			document.images[i].onmousedown=disableclick;
		}
	}
	if (document.all) {
		document.onmousedown=disableclick
	} else if (document.getElementById) {
		document.onmouseup=disableclick
	} else if (document.layers) {
		associateimages()
	}

