/*********************************************
 *             [[ VEIN System ]]             *
 *                                           *
 *     jump.js                               *
 *     2001.01.01                            *
 *     update 2001.04.25 For External File   *
 *     Programed by YIL Akira Yamanouchi     *
 *     Copyright (c) 2001 Akira Yamanouchi   *
 *********************************************/

var veintop = "http://vein.ne.jp/index.shtml";
var vein_id;
var vein_attri;
var invalid_alert = "不正なアクセスが検出されました。\n"+"トップページ（http://vein.ne.jp）からログインしてご利用ください。\n"+"トップページからログインしたにもかかわらずこのメッセージが表示された場合は、トップページに記載されているご使用ブラウザの設定の見なおしをお願いします。";
var guest_alert = "ご利用のIDは、VEIN体験評価用IDです。\n"+"guestの場合、以降のページの表示には時間制限が設けられています。\n"+"評価後、よろしければご入会いただけますようお願い申し上げます。";
var void_alert = "お客様のIDは有効期限が過ぎています。引き続きVEINをご利用になる場合は更新手続をしていただけますよう、お願い申し上げます。更新終了までは、体験評価用と同一の扱いとなります。\n"+"以降のページの表示には時間制限が設けられています。";
var uc_alert = "このページは現在制作中です。公開まで今しばらくお待ちいただけますようお願い申し上げます。";

var menu = new Array();

	function initialize() {
		return true;
	}

	function item(filename,extname,tagname,permission,menuname) {
		this.filename = filename;
		this.extname = extname;
		this.tagname = tagname;
		this.permission = permission;
		this.menuname = menuname;
	}

	function print_menu(cat,sub_cat,menu_array,arity) {
		if( cat != "" ) {
			document.write('<img src="../image/line-k.gif" height="1" width="100%"><br>');
			document.write('<img src="../image/tp1dot.gif" height="3" width="100%"><br>');
			document.write('<img src="../image/g-ball-16.gif" alt="g-ball" align="left" border="0" width="16" height="16">',cat,'<br clear="all">');
		}
		if( sub_cat != "" ) {
			if( top.vein_lang == "japanese" ) {
				document.write('<font size="2">　◆',sub_cat,'</font><br>');
			} else {
				document.write('<font size="2"> * ',sub_cat,'</font><br>');
			}
		}
		document.write('<table border="0" width="85%" align="right">');
		document.write('<tr><td>');
		for(i=0;i<arity;i++) {
			f = menu_array[i].filename;
			e = menu_array[i].extname;
			t = menu_array[i].tagname;
			p = menu_array[i].permission;
			m = menu_array[i].menuname;
			g = f.substr(0,1);
			if( g == '.' ) {
				file = f.split("/");
				filename = file[file.length - 1];
				g = filename.substr(0,1);
			}

			document.write('<a href="JavaScript:jump(\'',f,'\',\'',e,'\',\'',t,'\',\'',p,'\')" onMouseOver="status=\'',m,'\';return true">');
			document.write('<font size="2">');
			if( p == 0 ) {
				document.write('<font color="#707070">',m,'</font>');
			} else if( p & top.v_guest ) {
				document.write('<font color="#000070">',m,'</font>');
			} else {
				document.write('<font color="#002000">',m,'</font>');
			}
			document.write("</font></a><br>");
		}
		document.write('</table>');
		document.write('<br clear="all">');
		document.write('<img src="../../../../image/tp1dot.gif" height="5" width="100%"><br>');
		document.write('<img src="../../../../image/line-k.gif" height="1" width="100%"><br>');
	}

	function jump(file,ext,label,permission) {
		if( permission == 0 || file == "uc" ) {
			parent.info.location.href = "../info/sys/uc.htm";
			return;
		}

		file_jump = file + "." + ext;

		if( label == "" || label == "top" ) {
			label_jump = "";
		} else {
			label_jump = "#" + label;
		}

		if( !top.vein_attri || top.vein_attri == 0 || top.vein_attri == "" ) {
			alert(invalid_alert);
			window.location.href = veintop;
			return true;
		}

		if( permission & top.vein_attri || permission == "all" ) {
			if( top.vein_attri & top.v_guest ) {
				if(top.vein_lang == "japanese") {
					alert(guest_alert);
				}
			}
			if( top.vein_attri & top.v_void ) {
				if(top.vein_lang == "japanese") {
					alert(void_alert);
				}
			}
			parent.info.location.href = file_jump + label_jump;
		} else {
			if( permission & top.v_writer ) {
				alert(uc_alert);
			} else {
				if(top.vein_lang == "japanese") {
					parent.info.location.href = "../info/sys/fmo.htm";
				} else {
					parent.info.location.href = file_jump + label_jump;
				}
			}
		}
	}

	function is_member() {
		if( top.vein_attri & top.v_void ) {
			return false;
		} else if( top.vein_attri & top.v_member ) {
			return true;
		} else {
			return false;
		}
	}
