function JSONscriptRequest(fullUrl) {
    // REST request path
    this.fullUrl = fullUrl; 
    // Keep IE from caching requests
    this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
    // Get the DOM location to put the script tag
    this.headLoc = document.getElementsByTagName("head").item(0);
    // Generate a unique script tag id
    this.scriptId = 'JscriptId' + JSONscriptRequest.scriptCounter++;
}

// Static script ID counter
JSONscriptRequest.scriptCounter = 1;

// buildScriptTag method
//
JSONscriptRequest.prototype.buildScriptTag = function () {

    // Create the script tag
    this.scriptObj = document.createElement("script");
    
    // Add script object attributes
    this.scriptObj.setAttribute("type", "text/javascript");
    this.scriptObj.setAttribute("charset", "utf-8");
    this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
    this.scriptObj.setAttribute("id", this.scriptId);
}
 
// removeScriptTag method
// 
JSONscriptRequest.prototype.removeScriptTag = function () {
    // Destroy the script tag
    this.headLoc.removeChild(this.scriptObj);  
}

// addScriptTag method
//
JSONscriptRequest.prototype.addScriptTag = function () {
    // Create the script tag
    this.headLoc.appendChild(this.scriptObj);
}

var oGsr;
var oJsr;
var positions;

function showLAYER1(){
 oGsr = new JSONscriptRequest('http://www.eye-eye.net/ocular/take1.php?hyper=1');
 oGsr.buildScriptTag();
 oGsr.addScriptTag();
}


function showLAYER2(){
 oJsr = new JSONscriptRequest('http://www.eye-eye.net/ocular/take1.php?hyper=2');
 oJsr.buildScriptTag();
 oJsr.addScriptTag();
}

function callback1(data) {
  document.pajito.src = "http://www.eye-eye.net/img/toumei.gif";
  document.pajito.src = "http://www.eye-eye.net/" + data.image + ".jpg";
  oGsr.removeScriptTag();
}

function callback2(data) {
  document.pajito.src = "http://www.eye-eye.net/img/toumei.gif";
  document.pajito.src = "http://www.eye-eye.net/" + data.image + ".jpg";
  oJsr.removeScriptTag();
}

function hideLAYER(layName){document.pajito.src = "http://www.eye-eye.net/img/toumei.gif";}

if (position == 1) {positions = 0;} else {positions = -350;} 

document.write('<br />&#12539;<a href="javascript:showLAYER1();" onmouseout="hideLAYER();" class="dit">平行法トレーニング</a><br />&#12539;<a href="javascript:showLAYER2();" onmouseout="hideLAYER();" class="dit">交差法トレーニング</a><br />');
document.write('<div id="L2" style="z-index:100;margin:5px 0px 0px ' + positions + 'px;padding:0px;position:absolute;"><img src="http://www.eye-eye.net/img/toumei.gif" name="pajito" style="border:0px solid #000000;" alt="" /></div>');

