/**
 * @Name     
 * @Desc    サイト全般に使用
 * @Author  inexio[ http://www.inexio.jp ]
 * @Date    2010/08/24 17:23
**/

function sourceReplace()
{  
  if(document.getElementsByTagName)
  {
    var images = document.getElementsByTagName("img");
    for(var i=0; i < images.length; i++)
    {
      if(images[i].getAttribute("src").match("_off."))
      {
        images[i].onmouseover = function()
        {
          this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
        }
        images[i].onmouseout = function()
        {
          this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));  
        }
      }
    }
  }
}



if(window.addEventListener)
{
  window.addEventListener("load", sourceReplace, false);
  window.addEventListener("load", setupZoom, false);
}
else if(window.attachEvent)
{
  window.attachEvent("onload", sourceReplace);
  window.attachEvent("onload", setupZoom);
}



function loadFlash(file,width,height) {
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"" + width + "\" height=\"" + height + "\" id=\"flashImage\" align=\"middle\">");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"" + file + ".swf\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"wmode\" value=\"transparent\" />");
	document.write("<embed src=\"" + file + ".swf\" quality=\"high\" wmode=\"transparent\" width=\"" + width + "\" height=\"" + height + "\" name=\"flashImage\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" />");
	document.write("</object>");
}


