|
Rozhodnutí pro vakcinační centra |
|
|
|
|
Napsal uživatel Administrator
|
|
Pondělí, 25 Leden 2010 09:20 |
-
Rozhodnutí pro vakcinační centra
var idecko='';
function Vyskoc(mojeid)
{
document.getElementById('a_'+mojeid).title='';
opacity(mojeid,1,100,300);
idecko=mojeid;
document.onmousemove = getMouseXY;
}
function Skryj(mojeid)
{
opacity(mojeid,100,0,300);
document.onmousemove=null;
idecko=mojeid;
}
var tempX = 0
var tempY = 0
function getMouseXY(e) // works on IE6,FF,Moz,Opera7
{
if (!e) e = window.event; // works on IE, but not NS (we rely on NS passing us the event)
if (e)
{
if (e.clientX || e.clientY)
{ // works on IE6,FF,Moz,Opera7
mousex = e.clientX + document.body.scrollLeft + 10;
mousey = e.clientY ;
algor = '[e.clientX]';
if (e.pageX || e.pageY) algor += ' [e.pageX] '
}
else if (e.pageX || e.pageY)
{ // this doesn't work on IE6!! (works on FF,Moz,Opera7)
mousex = e.pageX + 10;
mousey = e.pageY;
algor = '[e.pageX]';
if (e.clientX || e.clientY) algor += ' [e.clientX] '
}
}
document.getElementById(idecko).style.zIndex=10;
mousex++;
mousey++;
mousex++;
mousey++;
document.getElementById(idecko).style.left=mousex.toString(10) + 'px';
document.getElementById(idecko).style.top=mousey.toString(10) + 'px';
}
function opacity(id, opacStart, opacEnd, millisec) {
//speed for each frame
var speed = Math.round(millisec / 100);
var timer = 0;
//determine the direction for the blending, if start and end are the same nothing happens
var i;
if(opacStart > opacEnd) {
for(i = opacStart; i >= opacEnd; i--) {
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
} else if(opacStart < opacEnd) {
changeOpac(opacStart,id);
document.getElementById(id).style.display='block';
document.getElementById(id).style.zIndex=10;
for(i = opacStart; i <= opacEnd; i++)
{
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
}
}
//change the opacity for different browsers
function changeOpac(opacity, id) {
var object = document.getElementById(id).style;
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
object.filter = "alpha(opacity=" + opacity + ")";
if(opacity==0)
{
document.getElementById(id).style.display='none';
document.getElementById(id).style.zIndex=1;
}
}
|