var org_left = new Array(7); var org_width = new Array(7); var org_height = new Array(7); var org_alpha = new Array(7); var org_border = new Array(7); var tar_left = new Array(7); var tar_width = new Array(7); var tar_height = new Array(7); var tar_alpha = new Array(7); var tar_border = new Array(7); var bMove = 0; var mainImage = 4; var autoMove = false; function TOP_getPosition( num ) { var ret = new Array(5); switch ( num ) { case 1: ret[0] = 0; ret[1] = 35; ret[2] = 96; ret[3] = 50; ret[4] = 1; ret[5] = 1; break; case 2: ret[0] = 42; ret[1] = 40; ret[2] = 118; ret[3] = 70; ret[4] = 3; ret[5] = 2; break; case 3: ret[0] = 93; ret[1] = 52; ret[2] = 150; ret[3] = 90; ret[4] = 3; ret[5] = 3; break; case 4: ret[0] = 160; ret[1] = 500; ret[2] = 220; ret[3] = 100; ret[4] = 5; ret[5] = 4; break; case 5: ret[0] = 678; ret[1] = 52; ret[2] = 150; ret[3] = 90; ret[4] = 3; ret[5] = 3; break; case 6: ret[0] = 743; ret[1] = 40; ret[2] = 118; ret[3] = 70; ret[4] = 3; ret[5] = 2; break; case 7: ret[0] = 794; ret[1] = 35; ret[2] = 96; ret[3] = 50; ret[4] = 1; ret[5] = 1; break; } return ret; } function TOP_checkMoveTopImage2( num ) { autoMove = false; if ( ! bMove ) { if ( num == mainImage ) { TOP_changeURL( num ); } else { if ( mainImage < 4 ) { tmp1 = mainImage + 4; } else { tmp1 = mainImage - 3 } for ( i=1; i<=7; i++ ) { tmp2 = TOP_getPosition( i ); org_left[tmp1-1] = tmp2[0]; org_width[tmp1-1] = tmp2[1]; org_height[tmp1-1] = tmp2[2]; org_alpha[tmp1-1] = tmp2[3]; org_border[tmp1-1] = tmp2[4]; tmp1++; if ( tmp1 > 7 ) tmp1 = 1; } if ( num < 4 ) { tmp1 = num + 4; } else { tmp1 = num - 3; } for ( i=1; i<=7; i++ ) { tmp2 = TOP_getPosition( i ); tar_left[tmp1-1] = tmp2[0]; tar_width[tmp1-1] = tmp2[1]; tar_height[tmp1-1] = tmp2[2]; tar_alpha[tmp1-1] = tmp2[3]; tar_border[tmp1-1] = tmp2[4]; document.getElementById('top_picture' + tmp1).style.zIndex = tmp2[5]; tmp1++; if ( tmp1 > 7 ) tmp1 = 1; } bMove = 1; mainImage = num; TOP_setMoveTopImage2(); } } } function TOP_setMoveTopImage2() { if ( bMove ) { if ( bMove < 9 ) { for ( i=1; i<=7; i++ ) { document.getElementById('top_picture' + i).style.left = ( org_left[i-1] + parseInt( ( ( tar_left[i-1] - org_left[i-1] ) / 10 ) * bMove ) ) + "px"; document.getElementById('top_picture' + i).style.height = ( org_height[i-1] + parseInt( ( ( tar_height[i-1] - org_height[i-1] ) / 10 ) * bMove ) ) + "px"; document.getElementById('top_picture' + i).style.width = ( org_width[i-1] + parseInt( ( ( tar_width[i-1] - org_width[i-1] ) / 10 ) * bMove ) ) + "px"; document.getElementById('top_picture' + i).style.borderWidth = ( org_border[i-1] + parseInt( ( ( tar_border[i-1] - org_border[i-1] ) / 10 ) * bMove ) ) + "px"; document.getElementById('top_picture' + i).style.filter = "alpha(style=0,opacity=" + ( org_alpha[i-1] + parseInt( ( ( parseInt( tar_alpha[i-1] ) - parseInt( org_alpha[i-1] ) ) / 10 ) * bMove ) ) + ")"; document.getElementById('top_picture' + i).style.MozOpacity = ( org_alpha[i-1] + parseInt( ( ( parseInt( tar_alpha[i-1] ) - parseInt( org_alpha[i-1] ) ) / 10 ) * bMove ) ) / 100; document.getElementById('top_picture' + i).style.MozOpacity = ( org_alpha[i-1] + parseInt( ( ( parseInt( tar_alpha[i-1] ) - parseInt( org_alpha[i-1] ) ) / 10 ) * bMove ) ) / 100; document.getElementById('top_picture' + i).style.opacity = ( org_alpha[i-1] + parseInt( ( ( parseInt( tar_alpha[i-1] ) - parseInt( org_alpha[i-1] ) ) / 10 ) * bMove ) ) / 100; } bMove++; setTimeout( TOP_setMoveTopImage2, 10 ); } else { for ( i=1; i<=7; i++ ) { document.getElementById('top_picture' + i).style.left = tar_left[i-1] + "px"; document.getElementById('top_picture' + i).style.height = tar_height[i-1] + "px"; document.getElementById('top_picture' + i).style.width = tar_width[i-1] + "px"; document.getElementById('top_picture' + i).style.borderWidth = tar_border[i-1] + "px"; document.getElementById('top_picture' + i).style.filter = "alpha(style=0,opacity=" + tar_alpha[i-1] + ")"; document.getElementById('top_picture' + i).style.MozOpacity = ( tar_alpha[i-1] / 100 ); document.getElementById('top_picture' + i).style.MozOpacity = ( tar_alpha[i-1] / 100 ); document.getElementById('top_picture' + i).style.opacity = ( tar_alpha[i-1] / 100 ); } bMove = 0; } } } function TOP_checkMoveTopImage( num ) { if ( ! bMove ) { if ( num == mainImage ) { TOP_changeURL( num ); } else { if ( mainImage < 4 ) { tmp1 = mainImage + 4; } else { tmp1 = mainImage - 3 } for ( i=1; i<=7; i++ ) { tmp2 = TOP_getPosition( i ); org_left[tmp1-1] = tmp2[0]; org_width[tmp1-1] = tmp2[1]; org_height[tmp1-1] = tmp2[2]; org_alpha[tmp1-1] = tmp2[3]; org_border[tmp1-1] = tmp2[4]; tmp1++; if ( tmp1 > 7 ) tmp1 = 1; } if ( num < 4 ) { tmp1 = num + 4; } else { tmp1 = num - 3; } for ( i=1; i<=7; i++ ) { tmp2 = TOP_getPosition( i ); tar_left[tmp1-1] = tmp2[0]; tar_width[tmp1-1] = tmp2[1]; tar_height[tmp1-1] = tmp2[2]; tar_alpha[tmp1-1] = tmp2[3]; tar_border[tmp1-1] = tmp2[4]; document.getElementById('top_picture' + tmp1).style.zIndex = tmp2[5]; tmp1++; if ( tmp1 > 7 ) tmp1 = 1; } bMove = 1; mainImage = num; TOP_setMoveTopImage(); } } } function TOP_setMoveTopImage() { if ( bMove ) { if ( bMove < 9.5 ) { for ( i=1; i<=7; i++ ) { document.getElementById('top_picture' + i).style.left = ( org_left[i-1] + parseInt( ( ( tar_left[i-1] - org_left[i-1] ) / 10 ) * bMove ) ) + "px"; document.getElementById('top_picture' + i).style.height = ( org_height[i-1] + parseInt( ( ( tar_height[i-1] - org_height[i-1] ) / 10 ) * bMove ) ) + "px"; document.getElementById('top_picture' + i).style.width = ( org_width[i-1] + parseInt( ( ( tar_width[i-1] - org_width[i-1] ) / 10 ) * bMove ) ) + "px"; document.getElementById('top_picture' + i).style.borderWidth = ( org_border[i-1] + parseInt( ( ( tar_border[i-1] - org_border[i-1] ) / 10 ) * bMove ) ) + "px"; document.getElementById('top_picture' + i).style.filter = "alpha(style=0,opacity=" + ( org_alpha[i-1] + parseInt( ( ( parseInt( tar_alpha[i-1] ) - parseInt( org_alpha[i-1] ) ) / 10 ) * bMove ) ) + ")"; document.getElementById('top_picture' + i).style.MozOpacity = ( org_alpha[i-1] + parseInt( ( ( parseInt( tar_alpha[i-1] ) - parseInt( org_alpha[i-1] ) ) / 10 ) * bMove ) ) / 100; document.getElementById('top_picture' + i).style.MozOpacity = ( org_alpha[i-1] + parseInt( ( ( parseInt( tar_alpha[i-1] ) - parseInt( org_alpha[i-1] ) ) / 10 ) * bMove ) ) / 100; document.getElementById('top_picture' + i).style.opacity = ( org_alpha[i-1] + parseInt( ( ( parseInt( tar_alpha[i-1] ) - parseInt( org_alpha[i-1] ) ) / 10 ) * bMove ) ) / 100; } bMove+=0.5; setTimeout( TOP_setMoveTopImage, 40 ); } else { for ( i=1; i<=7; i++ ) { document.getElementById('top_picture' + i).style.left = tar_left[i-1] + "px"; document.getElementById('top_picture' + i).style.height = tar_height[i-1] + "px"; document.getElementById('top_picture' + i).style.width = tar_width[i-1] + "px"; document.getElementById('top_picture' + i).style.borderWidth = tar_border[i-1] + "px"; document.getElementById('top_picture' + i).style.filter = "alpha(style=0,opacity=" + tar_alpha[i-1] + ")"; document.getElementById('top_picture' + i).style.MozOpacity = ( tar_alpha[i-1] / 100 ); document.getElementById('top_picture' + i).style.MozOpacity = ( tar_alpha[i-1] / 100 ); document.getElementById('top_picture' + i).style.opacity = ( tar_alpha[i-1] / 100 ); } bMove = 0; } } } function autoImageMove() { if ( autoMove ) { if ( mainImage == 1 ) { TOP_checkMoveTopImage( 7 ); } else { TOP_checkMoveTopImage( mainImage-1 ); } } else { autoMove = true; } setTimeout( autoImageMove, 5000 ); }