function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_showmenu(elmnt)
{
	document.getElementById(elmnt).style.visibility="visible";
  
  var pos_left=0;
  var pos_left_res=0;
  var winW=0;
  var winH=0;
  
  var b_name=navigator.appName;
  var b_version=navigator.appVersion;
  if (b_name.indexOf("Microsoft")!=-1)
  {
    winW=document.body.offsetWidth;
    if (b_version.indexOf("MSIE 8.0") != -1)
    {
      if (elmnt=="subnav_world")
      {
        winH=126;
      }
      else if (elmnt=="subnav_character")
      {
        winH=161;
      }
      else if (elmnt=="subnav_novel")
      {
        winH=196;
      }
      else if (elmnt=="subnav_anime")
      {
        winH=231;
      }
      else if (elmnt=="subnav_download")
      {
        winH=266;
      }
    }
    else
    {
      if (elmnt=="subnav_world")
      {
        winH=130;
      }
      else if (elmnt=="subnav_character")
      {
        winH=165;
      }
      else if (elmnt=="subnav_novel")
      {
        winH=200;
      }
      else if (elmnt=="subnav_anime")
      {
        winH=235;
      }
      else if (elmnt=="subnav_download")
      {
        winH=270;
      }
    }
  }
  else
  {
    winW=window.innerWidth;
    if (elmnt=="subnav_world")
    {
      winH=130;
    }
    else if (elmnt=="subnav_character")
    {
      winH=165;
    }
    else if (elmnt=="subnav_novel")
    {
      winH=200;
    }
    else if (elmnt=="subnav_anime")
    {
      winH=235;
    }
    else if (elmnt=="subnav_download")
    {
      winH=270;
    }
  }
  
  if (winW>1000)
  {
    pos_left=(winW-1000)/2;
  }
  
  if ((b_name.indexOf("Microsoft") != -1) && (b_version.indexOf("MSIE 8.0") == -1))
  {
    pos_left_res=pos_left+150;
    document.getElementById(elmnt).style.left=pos_left_res+"px";
  }
  document.getElementById(elmnt).style.top=winH+"px";
}

function MM_hidemenu(elmnt)
{
	document.getElementById(elmnt).style.visibility="hidden";
	//document.getElementById(elmnt).style.left="0px";
}

function MM_highlightmenu(elmnt)
{
  document.getElementById(elmnt).style.backgroundColor="#505C74";
  document.getElementById(elmnt).style.color="#F6E299";
}

function MM_dehighlightmenu(elmnt)
{
  if (elmnt.indexOf("subnav")!=-1)
  {
    document.getElementById(elmnt).style.backgroundColor="#EDD978";
  }
  else
  {
    document.getElementById(elmnt).style.backgroundColor="#CABA62";
  }
  document.getElementById(elmnt).style.color="#505C74";
}

function MM_highlightmenu_link(elmnt, elmnt2)
{
  document.getElementById(elmnt).style.backgroundColor="#505C74";
  document.getElementById(elmnt).style.color="#F6E299";
  document.getElementById(elmnt2).style.color="#F6E299";
}

function MM_dehighlightmenu_link(elmnt, elmnt2)
{
  if (elmnt.indexOf("subnav")!=-1)
  {
    document.getElementById(elmnt).style.backgroundColor="#EDD978";
  }
  else
  {
    document.getElementById(elmnt).style.backgroundColor="#CABA62";
  }
  document.getElementById(elmnt).style.color="#505C74";
  document.getElementById(elmnt2).style.color="#505C74";
}

function MM_openurl(address)
{
  window.location=address;
}

function MM_openurl_new(elmnt)
{
  document.getElementById(elmnt).target="_blank";
}

function MM_resizetd(elmnt, elmnt2)
{
  var b_name=navigator.appName;
  var b_version=navigator.appVersion;
  var td_one=0;
  var td_two=0;
  var td_total=0;
  
  if (b_name.indexOf("Microsoft")!=-1)
  {
    td_one=document.getElementById(elmnt).offsetHeight;
    td_two=document.getElementById(elmnt2).offsetHeight;
    
    var td_threshold=td_one+290;
    
    if (td_two>td_threshold)
    {
      var td_diff=td_two-td_threshold;
      if (b_version.indexOf("MSIE 8.0") != -1)
      {
        var current_url = window.location.href;
        
        if ((current_url.indexOf("?") != -1) && (current_url.indexOf("PageId=home") == -1))
          td_total=td_one+td_diff-8;
        else
          td_total=td_one+td_diff-22;

        document.getElementById(elmnt).style.height=td_total+"px";
      }
      else
      {
        td_total=td_one+td_diff;
        document.getElementById(elmnt).style.height=td_total+"px";
      }
    }
  }
  else
  {
    document.getElementById(elmnt).style.height="auto";
  }
}

function MM_moveimg(elmnt, elmnt2, elmnt3, elmnt4, elmnt5, elmnt6, elmnt7, elmnt8)
{
  var b_name=navigator.appName;
  var b_version = navigator.appVersion;
  
  if ((b_name.indexOf("Microsoft")!=-1) && (b_version.indexOf("MSIE 7.0") == -1) && (b_version.indexOf("MSIE 8.0") == -1))
  {
    document.getElementById(elmnt).style.verticalAlign="-6px";
    document.getElementById(elmnt2).style.verticalAlign="-6px";
    document.getElementById(elmnt3).style.verticalAlign="-6px";
    document.getElementById(elmnt4).style.verticalAlign="-6px";
    document.getElementById(elmnt5).style.verticalAlign="-6px";
    document.getElementById(elmnt6).style.verticalAlign="-6px";
    document.getElementById(elmnt7).style.verticalAlign="-6px";
    document.getElementById(elmnt8).style.verticalAlign="-6px";
  }
}

function MM_resizetextarea(elmnt)
{
  try
  {
    var b_name=navigator.appName;
  
    if (b_name.indexOf("Microsoft")!=-1)
    {
      document.getElementById(elmnt).rows=30;
      document.getElementById(elmnt).cols=23;
      document.getElementById(elmnt).style.height="363px";
    }
  }
  catch(err)
  {
    //Do nothing
  }
}

function MM_resizehome(elmnt,elmnt2)
{
  try
  {
    var b_name=navigator.appName;
    var b_version=navigator.appVersion;
    
    if ((b_name.indexOf("Microsoft")!=-1) && (b_version.indexOf("MSIE 8.0") == -1))
    {
      document.getElementById(elmnt).style.height="640px";
      document.getElementById(elmnt2).style.height="478px";
    }
  }
  catch(err)
  {
    //Do nothing
  }
}

