//COPYRIGHT 2005 KAI KASUGAI var image_ontop = new Array(); image_ontop[0] = './images/explained_maps/pref01-colour-nomap0000.gif'; image_ontop[1] = './images/explained_maps/pref02-colour-nomap0000.gif'; image_ontop[2] = './images/explained_maps/pref03-colour-nomap0000.gif'; image_ontop[3] = './images/explained_maps/pref04-colour-nomap0000.gif'; var mask_width = 152; //MUST BE dividible by two and still even (because of shitty IE) var stepsize = 4; //MUST be even, IE doesn't like odd numbers var fps = 5; //Initialisieren var transcount = 0; var maxcount = 0; var mask_position = 0; var image_width = 0; var mask_maxpos = 0; var mask_left = 0; var mask_right = 0; var direction = 'right'; var tans_time = 1000 / fps; var step_image_diff = 0; var started = true; var inited = false; var preload = new Array(); var e; var xpos, ypos, posrelx; function initialise() { document.getElementById('hide_1').style.display = "none"; //Nur zum verschwindenlassen von js aktivierungs aufforderungen preload[0] = new Image; preload[0].onload = start; preload[0].src = image_ontop[0]; for (var i = 1; i <= image_ontop.length; i++) { preload[i] = new Image; preload[i].src = image_ontop[i]; } } function start() { document.getElementById('img_0_2').src = preload[0].src; document.getElementById('img_0_3').src = preload[0].src; document.getElementById('img_1_2').src = preload[1].src; document.getElementById('img_1_3').src = preload[1].src; document.getElementById('img_2_2').src = preload[2].src; document.getElementById('img_2_3').src = preload[2].src; document.getElementById('img_3_2').src = preload[3].src; document.getElementById('img_3_3').src = preload[3].src; image_width = document.getElementById('img_0_1').width; step_image_diff = image_width - Math.floor(image_width / stepsize) * stepsize; mask_maxpos = image_width - mask_width; setTimeout("trans()",tans_time); inited = true; } function trans() { transcount++; if (transcount < maxcount || maxcount == 0) { if (started === true) { if (direction == 'right' && mask_position >= mask_maxpos) direction = 'left'; else if (direction == 'left' && mask_position <= 0) direction = 'right'; if (direction =='right') mask_position += stepsize; else if (direction == 'left') mask_position -= stepsize; mask_left = mask_position; mask_right = image_width - mask_position - mask_width; if (mask_right < 0) mask_right = 0; document.getElementById('box_0_2').style.width = mask_left; document.getElementById('box_0_3').style.width = mask_right; document.getElementById('box_1_2').style.width = mask_left; document.getElementById('box_1_3').style.width = mask_right; document.getElementById('box_2_2').style.width = mask_left; document.getElementById('box_2_3').style.width = mask_right; document.getElementById('box_3_2').style.width = mask_left; document.getElementById('box_3_3').style.width = mask_right; if (started === true) setTimeout("trans()",tans_time); return true; } else return true; } else return true; } function moveit(el) { started = false; koordinaten(el); posrelx = Math.floor((xpos - document.getElementById('box_0_0').offsetLeft) / 2 ) * 2; mask_left = posrelx - (mask_width / 2); mask_right = image_width - mask_left - mask_width; if (mask_left < 0) mask_left = 0; if (mask_right <0 ) mask_right = 0; document.getElementById('box_0_2').style.width = mask_left;document.getElementById('box_0_3').style.width = mask_right;document.getElementById('box_1_2').style.width = mask_left;document.getElementById('box_1_3').style.width = mask_right;document.getElementById('box_2_2').style.width = mask_left;document.getElementById('box_2_3').style.width = mask_right;document.getElementById('box_3_2').style.width = mask_left;document.getElementById('box_3_3').style.width = mask_right; //document.getElementById('box_0_2').style.width = mask_left; //document.getElementById('box_0_3').style.width = mask_right; } function restart() { started = true; if (!inited) initialise(); else trans(); } if(document.layers) { window.captureEvents(Event.MOUSEMOVE); } function koordinaten(e) { xpos = (document.layers || (document.getElementById && !document.all)) ? e.pageX : document.body.scrollLeft + event.clientX; ypos = (document.layers || (document.getElementById && !document.all)) ? e.pageY : document.body.scrollTop + event.clientY; }