var user_attri		= "void";
var user_id			= "";
var user_name		= "";
var user_zip		= "";
var user_pref		= "";
var user_address	= "";
var user_tel		= "";
var user_mail		= "";
var user_sh			= 1000;

var det_win = "";

function user_regist(i_id,i_name,i_zip,i_pref,i_address,i_tel,i_mail,i_sh) {
	user_id			= i_id;
	user_name		= i_name;
	user_zip		= i_zip;
	user_pref		= i_pref;
	user_address	= i_address;
	user_tel		= i_tel;
	user_mail		= i_mail;
	user_sh			= i_sh;
}

function item(code,name,prea,num,image,msize,attri) {
	this.code	= code;
	this.name	= name;
	this.prea	= prea;
	this.num	= num;
	this.image	= image;
	this.msize	= msize;
	this.attri	= attri;
}

var order = new Array();
var item_num = 0;

function dispatch(code,name,prea,num,image,msize,attri) {
	for(i=0;i<item_num;i++) {
		if( order[i].code == code ) {
			order[i].num = num;
			return true;
		}
	}
	if( num != 0 ) {
		order[item_num++] = new item(code,name,prea,num,image,msize,attri);
	}
	return true;
}

function getnum(code) {
	if( item_num == 0 ) {
		return 0;
	}
	for(i=0;i<item_num;i++) {
		if( order[i].code == code ) {
			return order[i].num;
		}
	}
	return 0;
}

function authentication(id) {
	if( id == "guest" ) {
		if( user_attri != id ) {
			item_num = 0;
		}
		user_attri = "guest";
		return true;
	}
	if( (top.vein_attri & top.v_member) == top.v_member ) {
		user_attri = "member";
		return true;
	}
	alert("ID が正しくありません。3");
	return false;
}

function detail(code) {
	if( det_win == "" ) {
		det_win = window.open("","detail","SCROLLBARS=yes,width=600,height=500");
	} else {
		if( det_win.closed ) {
			det_win = window.open("","detail","SCROLLBARS=yes,width=600,height=500");
		} else {
			det_win.focus();
		}
	}
	det_win.location = code + ".htm";
}

function close_det_win() {
	if( det_win != "" ) {
		if( !det_win.closed ) {
			det_win.close();
			det_win = "";
		}
	}
}

