

function addToFavorite(favTitle){
  if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) {
    window.external.AddFavorite(location.href, unescape(favTitle));
  }
}

function saveas(saveAs){
  if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) {
	document.execCommand("SaveAs",false,saveAs);
  }
}

function custom_print() {
    if (document.all) {
        if (navigator.appVersion.indexOf("5.0") == -1) {
            var OLECMDID_PRINT = 6;
            var OLECMDEXECOPT_DONTPROMPTUSER = 2;
            var OLECMDEXECOPT_PROMPTUSER = 1;
            var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";
            document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
            WebBrowser1.ExecWB(6, 2);
            WebBrowser1.outerHTML = "";
        } else {
            self.print();
        }
    } else {
        self.print();
    }
}



function setAutoPathFinder() {

	// start of user configuration

	this._root   = [ 'http://www.zenmoku.jp/' , '全木連Web' ]
	this._hub    = new Array() ;
	this._hub[0] = [ 'moku_kankei/' , '木材事業関係' , 0 ]
	this._hub[1] = [ 'publishing/' , '出版物（書籍・パンフレット）' , 0 ]
	this._hub[2] = [ 'event/' , 'イベント・講習会情報' , 1 ,
						'event/others/' , '他団体が主催するイベント・講習会情報' , 
						'sample/style/' , 'StyleSheets' , ]

	this._cut = '&gt;' ; 
	this._end = document.title ; 

	// end of user configuration
	// never touch nor delete down below lines
	this._string = '' ;
	this._url = location.href.toString() ;
	if ( this._url.search( this._root[0] ) != -1 ) { this._rootmatch = 1 } 
		else { this._rootmatch =  0 }

	return this ;
} var oPathFind ;

function autoPathFinder() {
	oPathFind = new setAutoPathFinder ; var pal = oPathFind ;
	if( pal._rootmatch ) {
		pal._string += '<a href="' + pal._root[0] + '">' + pal._root[1] + '</a>\n' ;
		pal._string += pal._cut + '\n' ;
		
		for( var i = 0 ; i < pal._hub.length ; i++ ) {
			if( pal._url.search( pal._hub[i][0] ) != -1 ) {
				pal._string += '<a href="' + pal._root[0] + pal._hub[i][0] + '">' + 
					pal._hub[i][1] + '</a>\n' ;
				pal._string += pal._cut + '\n' ;
				if( pal._hub[i][2] ) { 
					for( var j = 3 ; j < pal._hub[i].length ; j++ ) {
						var submatch = pal._url.match( pal._hub[i][j] ) ;
			 			if( submatch == pal._hub[i][j] ) {
							pal._string += '<a href="' + pal._root[0] + pal._hub[i][j] + '">' + 
								pal._hub[i][j+1] + '</a>\n' ;
								pal._string += pal._cut + '\n' ;
						}
					}
				}
			}
		}
		pal._string += pal._end ;
		document.write( pal._string ) ;
	} else {
		document.write( 'undefined' ) ;
	}
}



