
function PrintPage(){
	if(document.getElementById || document.layers){
		window.print();
	}
}

//$BF02h:F@8Ak(B
function openWindow(n) {
  sw = screen.availWidth; 
  sh = screen.availHeight;
  if(navigator.platform=="Win32"){
  	ww = 400;
  	wh = 400;
  }
  else if(navigator.platform=="MacPPC"){
	ww = 400;
	wh = 400;
  }
  else{
	ww = 400;
	wh = 400;
  }
  wl = 0;
  wt = 0;
  window.open(n,"window","width=" + ww + ",height=" + wh + ",,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + wl + ",top=" + wt);

}

//$B9V;U>R2pAk(B
function openKoushi(n) {
  sw = screen.availWidth; 
  sh = screen.availHeight;
  if(navigator.platform=="Win32"){
  	ww = 500;
  	wh = 330;
  }
  else if(navigator.platform=="MacPPC"){
	ww = 500;
	wh = 330;
  }
  else{
	ww = 500;
	wh = 330;
  }
  wl = 0;
  wt = 0;
  window.open(n,"window","width=" + ww + ",height=" + wh + ",,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + wl + ",top=" + wt);

}


//$B9`L\A*Br%9%/%j%W%H(B
function wa(){
  var i=0;
  this[i++] = new Opt('$B$*Fy(B',  'niku');
  this[i++] = new Opt('$B$*Ln:Z(B','yasai');
  this[i++] = new Opt('$B5{2pN`(B','sakana');
  this.length = i;
  return this;
}

function yo(){
  var i=0;
  this[i++] = new Opt('$B$*Fy(B',  'niku');
  this[i++] = new Opt('$B$*Ln:Z(B','yasai');
  this[i++] = new Opt('$B5{2pN`(B','sakana');
  this.length = i;
  return this;
}

function chu(){
  var i=0;
  this[i++] = new Opt('$B$*Fy(B',  'niku');
  this[i++] = new Opt('$B$*Ln:Z(B','yasai');
  this[i++] = new Opt('$B5{2pN`(B','sakana');
  this.length = i;
  return this;
}

function katei(){
  var i=0;
  this[i++] = new Opt('$B$*Fy(B',  'niku');
  this[i++] = new Opt('$B$*Ln:Z(B','yasai');
  this[i++] = new Opt('$B5{2pN`(B','sakana');
  this.length = i;
  return this;
}

function okashi(){
  var i=0;
  this[i++] = new Opt('$B%1!<%-(B',  'cake');
  this[i++] = new Opt('$B%<%j!<(B',  'jelly');
  this[i++] = new Opt('$B%U%k!<%D(B','fruit');
  this[i++] = new Opt('$BBgJ!(B $BL_(B','mochi');
  this[i++] = new Opt('$B$=$NB>(B',  'etc');
  this.length = i;
  return this;
}

function DefOptions(){
  var i=0;
  this[i++] = new wa();
  this[i++] = new yo();
  this[i++] = new chu();
  this[i++] = new katei();
  this[i++] = new okashi();
  this.length = i;
  return this;
}

options   = new DefOptions();
num = 0;

function Opt(text,value){
  this.text  = text;
  this.value = value;
}

function loadOption(obj,n){

    var ot = obj.options;
    var os = options[n];
    ot.length = os.length;
    for (var i=0; i<os.length; i++)
      ot[i] = new Option(os[i].text,os[i].value,false,false);
    ot[0].selected=true;

  num = n;
}

function optionString(){
  var os = options[num];
  var bunrui2 = '';
  for (var i=0; i<os.length; i++){
    bunrui2 += '<option value="'+os[i].value+'">'+os[i].text;
  }
  return bunrui2;
}

function init(){
    loadOption(document.f.bunrui2,num);
}

function changeOpt(n,bunrui2,t,v){
  if ( n == '$BOB?)(B'){
       n = 0;
  }else if( n == '$BMN?)(B'){
       n = 1;
  }else if( n == '$BCf2Z(B'){
       n = 2;
  }else if( n == '$B2HDmNAM}(B'){
       n = 3;
  }else if( n == '$B$*2[;R(B'){
       n = 4;
  }
  loadOption(bunrui2,n);
}

