/*
 *
 *	スクリプト名           ： クイックジャンプ( quickJump.js )  Ver 1.00
 *	作った人               ： たかひろ
 *	作った人のサイト       ： http://www1.plala.or.jp/ayatohiroka/
 *	スクリプトの説明ページ ： http://www1.plala.or.jp/ayatohiroka/javascript/QuickJump.html
 *	著作権                 ： 放棄します。ご自由に。
 *
 */

function SelectOption_getUrl( ) {

	return ( this.url ) ? " value=\"" + this.url + "\"" : "" ;

}

function SelectOption_getLabel( ) {

	var lab = 
		( this.getRank( ) == 1 ) ? "　●" :
		( this.getRank( ) == 2 ) ? "　　○" :
		( this.getRank( ) == 3 ) ? "　　　　・" :
		                           "★" ;
	return lab + this.label;

}

function SelectOption_getRank( ) {

	return this.rank ;

}

function SelectOption( url, label, rank ) {

	this.url   = url ;
	this.label = label ;
	this.rank  = rank ;

	this.getUrl   = SelectOption_getUrl ;
	this.getLabel = SelectOption_getLabel ;
	this.getRank  = SelectOption_getRank ;

}


function QuickJumper_createForm( ) {

	var buf ;
	var o, i, len ;

	buf  = "<form id=\"QuickJumpForm\">\n" ;
	buf += "<p>\n" ;
	buf += "<select onChange=\"jump(this)\">\n" ;

	len = this.options.length ;
	for( i = 0; i < len; i++ ) {
		o = this.options[i] ;
		buf += "<option" + o.getUrl( ) + ( ( i == 0 ) ? " selected" : "" ) + ">" + o.getLabel( ) + "</opion>\n" ;
	}

	buf += "</select>\n" ;
	buf += "</p>\n" ;
	buf += "</form>\n" ;

	return buf;

}

function QuickJumper_jump( sel ) {

	if( sel.options[ sel.selectedIndex ].value ) {
		top.location.href = sel.options[ sel.selectedIndex ].value ;
	}

}

function QuickJumper( options ) {

	this.options = options ;

	this.createForm = QuickJumper_createForm ;
	this.jump       = QuickJumper_jump ;

}


function jump( sel ) {

	QuickJumper_jump( sel ) ;
//	QuickJumper.jump( sel ) ;

}


function displayJumpForm( path ) {

	var o = new Array( ) ;

/*
 *		★カスタマイズここから
 *
 *		項目の数だけ以下の文を記入。
 *		o.push( new SelectOption( URL, ラベル, 階層の深さ ) ) ;
 *
 *		URL は無記入だと移動しません。
 *		階層の深さは 0 〜 3 までです。(大きい数ほど深い)
 */


	o.push( new SelectOption( "",                                                            "クイックジャンプ",           0 ) ) ;
	o.push( new SelectOption( path + "",                                                     "TopPage",                    1 ) ) ;
	o.push( new SelectOption( path + "php/",                                                 "PHP",                        2 ) ) ;
	o.push( new SelectOption( path + "php/bbs.html",                                         "掲示板",                     3 ) ) ;
	o.push( new SelectOption( path + "php/ThreadBbs.html",                                   "スレッドフロート型掲示板",   3 ) ) ;
	o.push( new SelectOption( path + "php/mob.html",                                         "携帯向け掲示板",             3 ) ) ;
	o.push( new SelectOption( path + "php/spbbs.html",                                       "シンプルケータイ用掲示板",   3 ) ) ;
	o.push( new SelectOption( path + "php/sbbbs.html",                                       "埋め込み型掲示板",           3 ) ) ;
	o.push( new SelectOption( path + "php/vs.html",                                          "闘技場",                     3 ) ) ;
	o.push( new SelectOption( path + "php/snovel.html",                                      "みんなでサウンドノベル",     3 ) ) ;
	o.push( new SelectOption( path + "php/counter.html",                                     "アクセスカウンタ",           3 ) ) ;
	o.push( new SelectOption( path + "php/URLSender.html",                                   "携帯にURL通知スクリプト",    3 ) ) ;
	o.push( new SelectOption( "http://cgi11.plala.or.jp/ayatohir/php/rank/rank.html",        "ダウンロードランキング",     3 ) ) ;
	o.push( new SelectOption( "http://cgi11.plala.or.jp/ayatohir/php/spdiary/spdiary1.html", "シンプル日記帳",             3 ) ) ;
	o.push( new SelectOption( path + "php/myPhrame.html",                                    "myPhrame",                   3 ) ) ;
	o.push( new SelectOption( path + "php/will.html",                                        "遺書スクリプト",             3 ) ) ;
	o.push( new SelectOption( path + "php/accessories.html",                                 "小物類",                     3 ) ) ;
	o.push( new SelectOption( path + "cgi/",                                                 "Perl",                       2 ) ) ;
	o.push( new SelectOption( path + "cgi/mob.html",                                         "ケータイ用掲示板",           3 ) ) ;
	o.push( new SelectOption( path + "cgi/vs2.html",                                         "真・闘技場",                 3 ) ) ;
	o.push( new SelectOption( path + "cgi/snovel.html",                                      "みんなでサウンドノベル",     3 ) ) ;
	o.push( new SelectOption( path + "cgi/tamail.html",                                      "携帯にメール送信フォーム",   3 ) ) ;
	o.push( new SelectOption( path + "cgi/tacheck.html",                                     "簡単○○チェック",           3 ) ) ;
	o.push( new SelectOption( path + "java/",                                                "Java",                       2 ) ) ;
	o.push( new SelectOption( path + "java/Reversi/",                                        "リバーシ",                   3 ) ) ;
	o.push( new SelectOption( path + "java/test.html",                                       "インベーダー",               3 ) ) ;
	o.push( new SelectOption( path + "java/Hello/Hello.html",                                "Hello",                      3 ) ) ;
	o.push( new SelectOption( path + "java/Bj/Bj.html",                                      "BlackJack",                  3 ) ) ;
	o.push( new SelectOption( path + "javascript/",                                          "JavaScript",                 2 ) ) ;
	o.push( new SelectOption( path + "javascript/random.html",                               "ランダム広告表示スクリプト", 3 ) ) ;
	o.push( new SelectOption( path + "javascript/QuickJump.html",                            "クイックジャンプ",           3 ) ) ;
	o.push( new SelectOption( path + "javascript/Cookie.html",                               "クッキー",                   3 ) ) ;
	o.push( new SelectOption( path + "freesoft/",                                            "WindowsSoft",                2 ) ) ;
	o.push( new SelectOption( path + "freesoft/srev/",                                       "超シンプルリバーシ",         3 ) ) ;
	o.push( new SelectOption( path + "freesoft/zyanken/",                                    "じゃんけんゲーム",           3 ) ) ;
	o.push( new SelectOption( path + "game/",                                                "TVGame",                     2 ) ) ;
	o.push( new SelectOption( path + "game/#machi",                                          "街",                         3 ) ) ;
	o.push( new SelectOption( path + "game/#ff1",                                            "FF1",                        3 ) ) ;
	o.push( new SelectOption( path + "game/#ff2",                                            "FF2",                        3 ) ) ;
	o.push( new SelectOption( path + "etc/",                                                 "Etc",                        2 ) ) ;
	o.push( new SelectOption( path + "etc/profile.html",                                     "プロフィール",               3 ) ) ;
	o.push( new SelectOption( "http://cgi11.plala.or.jp/ayatohir/php/spdiary/spdiary1.html", "日記",                       3 ) ) ;
	o.push( new SelectOption( "http://cgi11.plala.or.jp/ayatohir/php/snovel/snovel1.html",   "釜井達の夜",                 3 ) ) ;
	o.push( new SelectOption( "http://cgi11.plala.or.jp/ayatohir/php/bbs/main/log/",         "BBS",                        2 ) ) ;
	o.push( new SelectOption( path + "link/",                                                "Link",                       2 ) ) ;
	o.push( new SelectOption( path + "messenger/",                                           "Messenger",                  2 ) ) ;



	//	★カスタマイズここまで


	var jumper = new QuickJumper( o ) ;
	document.write( jumper.createForm( ) ) ;

}


