1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
| var diapos = new Array(1);
diapos[0] = new Array(13);
diapos[0][0] = 0; // timer
diapos[0][1] = 2000; // timeout
diapos[0][2] = 0; // bauto
diapos[0][3] = 1; // effect
diapos[0][4] = 0; // unused
diapos[0][5] = 9; // image count
diapos[0][6] = new Image;
diapos[0][6].src = "../topic3/bv000009.thumb.jpg";
diapos[0][7] = new Image;
diapos[0][7].src = "../topic3/bv000001.thumb.jpg";
diapos[0][8] = new Image;
diapos[0][8].src = "../topic3/bv000002.thumb.jpg";
diapos[0][9] = new Image;
diapos[0][9].src = "../topic3/bv000004.thumb.jpg";
diapos[0][10] = new Image;
diapos[0][10].src = "../topic3/bv000005.thumb.jpg";
diapos[0][11] = new Image;
diapos[0][11].src = "../topic3/bv000006.thumb.jpg";
diapos[0][12] = new Image;
diapos[0][12].src = "../topic3/bv000007.thumb.jpg";
diapos[0][13] = new Image;
diapos[0][13].src = "../topic3/bv000010.thumb.jpg";
diapos[0][14] = new Image;
diapos[0][14].src = "../topic3/bv000008.thumb.jpg";
// Diapo functions
DIAPO_DATA_IDX = 5;
function diapo_clear_timer( idx ) { window.clearTimeout( diapos[idx][0] ); }
function diapo_fadein( idx )
{
var imgelt = document.getElementById( "diapo" + idx );
if( imgelt )
{
fadeincall = "diapo_fadein(" + idx + ")";
if( document.all )
{
imgelt.filters.alpha.opacity += parseFloat(3);
if( imgelt.filters.alpha.opacity == 100 ) {
return;
} else setTimeout( fadeincall, 1 );
}
else
{
i=parseFloat( imgelt.style.getPropertyValue( "-moz-opacity" ) );
i+=parseFloat(0.1);
imgelt.style.setProperty( "-moz-opacity", i, "" );
if( i >= 1 ) {
return;
} else setTimeout( fadeincall, 60 );
}
}
}
function diapo_fadeout(idx,index)
{
var imgelt = document.getElementById( "diapo" + idx );
if( imgelt )
{
fadeoutcall = "diapo_fadeout(" + idx + ", '0')";
if( document.all )
{
if( index == "1" )
imgelt.filters.alpha.opacity = 100;
imgelt.filters.alpha.opacity -= parseFloat(3);
if( imgelt.filters.alpha.opacity == 0 )
{
imgelt.src = imgelt.src2;
diapo_fadein( idx );
return;
}
else setTimeout( fadeoutcall, 1 );
}
else
{
if( index == "1" )
imgelt.style.setProperty( "-moz-opacity", 1, "" );
i = parseFloat(imgelt.style.getPropertyValue("-moz-opacity"));
i -= parseFloat(0.1);
imgelt.style.setProperty( "-moz-opacity", i, "" );
if( i <= 0 )
{
imgelt.src = imgelt.src2;
diapo_fadein( idx );
return;
}
else setTimeout( fadeoutcall, 60 );
}
}
}
function diapo_display_image(idx, imgelt, index)
{
if( imgelt )
{
imgelt.src2=eval( "diapos[" + idx + "][" + (DIAPO_DATA_IDX + index) + "].src" );
imgelt.name=index;
if (navigator.appName=="Opera" || diapos[idx][3] == 0 || (navigator.userAgent.toLowerCase()).search(/safari/) >= 0
/*|| navigator.appVersion.search(/MSIE 7/) > 0*/ || navigator.appVersion.search(/MSIE 8/) > 0 ) {
imgelt.src=imgelt.src2;
/* if( navigator.appVersion.search(/MSIE 7/) > 0 )
diapo_fadeout(idx,'1');
*/
} else
diapo_fadeout(idx,'1');
}
}
function diapo_next_image( idx )
{
var imgelt = document.getElementById( "diapo" + idx );
if( imgelt )
{
i = parseInt(imgelt.name);
if( i < diapos[idx][DIAPO_DATA_IDX] ) { i++; } else i = 1;
diapo_display_image( idx, imgelt, i );
}
return false;
}
function diapo_previous_image( idx )
{
var imgelt = document.getElementById( "diapo" + idx );
if( imgelt )
{
i = diapos[idx][DIAPO_DATA_IDX];
if (imgelt.name > 1 )
i = -1 + parseInt(imgelt.name);
diapo_display_image( idx, imgelt, i );
}
return false;
}
function diapo_set_timer( idx )
{
diapo_next_image( idx );
diapos[idx][0]=setTimeout( "diapo_set_timer(" + idx + ")", diapos[idx][1] );
}
function diapo_auto( idx )
{
var btn = document.getElementById( "diapo_auto" + idx );
if( diapos[idx][2] == 0 )
{
diapos[idx][2] = 1;
if( btn )
btn.src="diapo" + idx + "_stop.gif";
diapo_set_timer( idx );
}
else
{
diapos[idx][2] = 0;
if( btn )
btn.src="diapo" + idx + "_play.gif";
diapo_clear_timer( idx );
}
return false;
}
function diapo_open_album( idx, url, lang )
{
var imgelt = document.getElementById( "diapo" + idx );
var i = 1;
if( imgelt )
i = parseInt( imgelt.name );
if( !lang )
lang = "";
document.location.href = url + "page" + i + lang + ".html";
} |
Partager