var n;
var testObj;
var i;
var k;
k=0;
var cur
function showban(){
testObj = document.getElementById("fade" );
for (var i=0;i<11;i++)
setTimeout('setOpacity('+i+')',100*i);
}

function showrund() {
n = Math.floor(Math.random()*3);

cur = document.getElementById("div" + n  );
cur.style.visibility = 'visible';
testObj = document.getElementById("fade" + n );
for (var i=11;i>0;i--)
setTimeout('setOpacity('+i+')',100*i);

}



function setOpacity(value)
{
        testObj.style.opacity = value/10;
        testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
}

function x_window(imgSrc) {
margin = 50;
x_win = open("", "x_win", "resizable,width=800,height=800,top=0,left=0");
img = new Image();
img.onload = function() {
x_win.resizeTo(w = img.width + margin, h = img.height + margin*3);
x_win.moveTo( (document.body.clientWidth - w) / 2 , (document.body.clientHeight - h) / 2);
if( img.outerHTML ) x_win.document.write( img.outerHTML );
else x_win.document.body.appendChild(img);
}
img.src = imgSrc;
}
var m = new Array(0,100);
var t = new Array();
function next() {
m[0]+=1;
m[1]-=1;

document.getElementById("div1").style.opacity = m[1]/100;
document.getElementById("div1").style.filter="alpha(opacity="+m[0]+")";
document.getElementById("div2").style.opacity = m[0]/100;
document.getElementById("div2").style.filter="alpha(opacity="+m[1]+")";

t[0] = setTimeout("next()",5);
if (m[0]>98) clearTimeout(t[0]);
}

function back() {
m[0]-=1;
m[1]+=1;
document.getElementById("div2").style.filter="alpha(opacity="+m[0]+")";
document.getElementById("div1").style.opacity = m[1]/100;
document.getElementById("div1").style.filter="alpha(opacity="+m[1]+")";
document.getElementById("div2").style.opacity = m[0]/100;
t[1] = setTimeout("back()",5);
if (m[1]>98) clearTimeout(t[1]);
}

