var x = 0;
page = location.search.substr(1).split("?");
for (x=0;x<=page.length;x++) 
{
  eval(page);
}
page = escape(page);
page = page.slice(7);


function NYKMenu()
{
  this.header = null;
  this.flashFile = "nyk_FLASH_menu.swf";
  this.useHeader = true;
  this.background ="img/graphic_navBkgrd.gif";
  this.useBackground = true;
 
  this.category = new Array(); 
  this.category_useImage=true;
  this.category_openName="img/open.gif";
  this.category_openHeight=29;
  this.category_openWidth=24;

  this.category_closeName="img/fold.gif";
  this.category_closeHeight=29;
  this.category_closeWidth=24;
}


function _flashContent()
{
	paramStr="";
	if(page!="")
	{
		paramStr = "?page=" + page;
	}
	
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="156" HEIGHT="400" id="nyk_FLASH_menu" ALIGN="">');
	document.write('	<PARAM NAME=movie VALUE="'+ this.flashFile + paramStr + '">');
	document.write('	<PARAM NAME=quality VALUE=high>');
	document.write('	<PARAM NAME=wmode VALUE=transparent>');
	document.write('	<PARAM NAME=bgcolor VALUE=#FFFFFF>');
	document.write('	<EMBED src="' + this.flashFile + paramStr + '" quality=high bgcolor=#FFFFFF  WIDTH="156" HEIGHT="400" NAME="stripDown_menu_FINAL_noSroll" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</OBJECT>');
}

function _jsContent()
{
		for(i=0;i<this.category.length;i++)
	  {
	    if(page == this.category[i].id || this.category[i].visible == false)
	    {
	      this.opened(this.category[i])
	    }
	    else
	    {
	      this.closed(this.category[i].name, this.category[i].id);
	    }
  	}
}


function _build()
{
 this.begin();
 
  if ( MM_FlashCanPlay )
	{
 		this.flashContent();
	}
	else
	{
		this.jsContent();
	}
  this.end();
}



function _begin()
{
	document.write('<TABLE width="156" border=0 cellPadding=0 cellSpacing=0>');
	document.write('<TR>');
	document.write('<TD><img src="'+ this.header +'" width="156" height="33"></TD>');
	document.write('</TR>');
	document.write('<TR>');
	document.write('<TD height="3" bgcolor="#000000"></TD>');
	document.write('</TR>');
	document.write('<TR>');
	if(this.useHeader)
	{
		document.write('<TD background="'+ this.background + '">');
	}
}

function _end()
{
	document.write('</TD>');
	document.write('</TR>');
	document.write('<TR>');
	if(this.useBackground)
  {
		document.write('<TD align="center" valign="top" background="' + this.background + '"><br><img src="img/graphic_endPoint.gif" width="24" height="6"></TD></TR>');
	}
	document.write('</TABLE>');
}




function _closed(cat, id)
{
  document.write('<table width="99%" cellpadding="0" cellspacing="0" border="0"><tr><td width="2"></td><td background="img/button.gif">');
  document.write('<a class="foldType" href = "?page='+ id +'" target="_self">');

  if (this.category_useImage)
  {
    document.write('&nbsp;&nbsp;<img align="absmiddle" src="' + this.category_closeName +'" width="' + this.category_closeWidth + '" height="' + this.category_closeHeight + '"border="0">');
  }
  document.write(cat + '</a></td></td></tr></table>');
}

function _opened(cat) 
{
  if(this.category[i].visible == true)
  {
  	document.write('<table  width="99%" cellpadding="0" cellspacing="0" border="0"><tr><td width="2"></td><td background="img/button.gif">');
  	document.write('<a class="foldType" href = "?page=null" target="_self">');
  
  	if (this.category_useImage) 
  	{
  	  document.write('&nbsp;&nbsp;<img align="absmiddle" src="' + this.category_openName +'" width="' + this.category_openWidth + '" height="' + this.category_openHeight + '"border="0">');
  	}
  
  	document.write(cat.name + '</a></td></tr></table>');
  }	
  
  if(cat.subCategory.length > 0)
    {
      document.write('<table cellpadding="0" cellspacing="0" border="0" width="99%" ><tr><td height="5"></td></tr>');
      for (x=0;x<cat.subCategory.length;x++)
      {
        if (cat.subcategory_useImage)
        {
          document.write('<tr><td>&nbsp;&nbsp;</td><td><img align="absmiddle" src="' + cat.subcategory_image +'" width="' + cat.subcategory_width + '" height="' + cat.subcategory_height + '">');
        }
        
        document.write(' <a href="' + cat.subCategory[x].link +'?page='+ cat.id +'">' + cat.subCategory[x].name + '</a></td></tr>');
      }
      document.write('<tr><td height="5"></td></tr></table>');
  }
}

function Category(name, id, visible)
{
  this.name=name;
  this.id=id;
  this.visible = true;
  if(visible != null)
  {
  	this.visible = visible;
  }	
  this.subCategory = new Array();
  this.subcategory_useImage=true;
  this.subcategory_image="img/list.gif";
  this.subcategory_height="9";
  this.subcategory_width="8";
}

function _setCategory(categoryName, id, visible)
{
  this.category[this.category.length] = new Category(categoryName, id, visible);
}

function _getCategory(id)
{
 for(i=0;i<this.category.length;i++)
  {
    if(this.category[i].id == id)
    {
      return this.category[i];
    }
  }
}

function SubCategory(name, link)
{
  this.name=name;
  this.link = link;
}

function _setSubCategory(name, link)
{
  this.subCategory[this.subCategory.length] = new SubCategory(name, link);
}

Category.prototype.setSubCategory = _setSubCategory;

NYKMenu.prototype.begin = _begin;
NYKMenu.prototype.end = _end;
NYKMenu.prototype.build = _build;
NYKMenu.prototype.closed = _closed;
NYKMenu.prototype.opened = _opened;
NYKMenu.prototype.setCategory = _setCategory;
NYKMenu.prototype.getCategory = _getCategory;
NYKMenu.prototype.flashContent = _flashContent;
NYKMenu.prototype.jsContent = _jsContent;



function gotoPage(url)
{
	location.href=url;
}