4 * Copyright (C) 2006 matteo.nastasi@milug.org
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details. You should have received a
15 * copy of the GNU General Public License along with this program; if
16 * not, write to the Free Software Foundation, Inc, 59 Temple Place -
17 * Suite 330, Boston, MA 02111-1307, USA.
29 var is_my_time = false;
30 /* number of takes cards */
46 var cards_width = 55 + 2;
47 var cards_width_d2 = 27;
49 /* height of images */
50 var cards_height = 101 + 2;
51 var cards_height_d2 = 51;
53 /* width of hands area */
54 var hands_width = 400;
56 /* width of the border */
57 var border_width = 10;
59 /* time to send a card to the player 10 or 250 */
60 var G_send_time = 250;
61 var G_play_time = 500;
62 var G_take_time = 500;
64 /* suffix to add to images name */
65 var sux = new Array( "", "_ea", "", "", "_we");
67 var cards_pos = new Array (8);
68 var cards_ea_pos = new Array (8);
69 var cards_ne_pos = new Array (8);
70 var cards_nw_pos = new Array (8);
71 var cards_we_pos = new Array (8);
73 var take_x = new Array(562, 745, 452, 30, 52);
74 var take_y = new Array(545, 177, 70, 62,155);
76 for (i = 0 ; i < 8 ; i++) {
83 function $(id) { return document.getElementById(id); }
85 function cards_dispose_so(car_n, tak_n)
89 $("takes").style.left = 200 + 400 - 90 + ((90 - cards_width) / 2);
90 $("takes").style.top = 475 + (125 - cards_height)/2;
91 $("takes").style.zIndex = 1;
92 $("takes").style.visibility = "visible";
98 disp = 400 - delta - (2 * border_width);
100 inter = parseInt((disp - cards_width) / (car_n - 1));
101 if (inter > cards_width)
106 wcard = cards_width + inter * (car_n - 1);
107 start = 200 + border_width + (400 - border_width - border_width - wcard - delta) / 2;
109 for (i = 0 ; i < car_n ; i++) {
110 $("card" + cards_pos[i]).style.left = start + (i * inter);
111 $("card" + cards_pos[i]).style.top = 475 + (125 - cards_height)/2;
112 $("card" + cards_pos[i]).style.zIndex = 8 - i;
113 $("card" + cards_pos[i]).style.visibility = "visible";
122 function cards_dispose_ne(car_n, tak_n) {
127 $("takes_ne").style.left = 800 - cards_width - 400 + 90 - ((90 - cards_width) / 2);
128 $("takes_ne").style.top = (125 - cards_height)/2;
129 $("takes_ne").style.zIndex = 1;
130 $("takes_ne").style.visibility = "visible";
136 disp = 400 - delta - (2 * border_width);
138 inter = parseInt((disp - cards_width) / (car_n - 1));
139 if (inter > cards_width)
144 wcard = cards_width + inter * (car_n - 1);
145 start = 800 - cards_width - border_width - (400 - border_width - border_width - wcard - delta) / 2;
148 for (i = 0 ; i < car_n ; i++) {
149 $("card_ne" + cards_ne_pos[i]).style.left = start - ((car_n - i -1) * inter);
150 $("card_ne" + cards_ne_pos[i]).style.top = (125 - cards_height)/2;
151 $("card_ne" + cards_ne_pos[i]).style.zIndex = 8-i;
152 $("card_ne" + cards_ne_pos[i]).style.visibility = "visible";
161 function cards_dispose_nw(car_n, tak_n) {
166 $("takes_nw").style.left = 400 - cards_width - 400 + 90 - ((90 - cards_width) / 2);
167 $("takes_nw").style.top = (125 - cards_height)/2;
168 $("takes_nw").style.zIndex = 1;
169 $("takes_nw").style.visibility = "visible";
175 disp = 400 - delta - (2 * border_width);
177 inter = parseInt((disp - cards_width) / (car_n - 1));
178 if (inter > cards_width)
183 wcard = cards_width + inter * (car_n - 1);
184 // start = 0 + delta + border_width + (400 - border_width - border_width - wcard - delta) / 2;
185 start = 400 - cards_width - border_width - (400 - border_width - border_width - wcard - delta) / 2;
188 for (i = 0 ; i < car_n ; i++) {
189 $("card_nw" + cards_nw_pos[i]).style.left = start - ((car_n-i-1) * inter);
190 $("card_nw" + cards_nw_pos[i]).style.top = (125 - cards_height)/2;
191 $("card_nw" + cards_nw_pos[i]).style.zIndex = (8-i);
192 $("card_nw" + cards_nw_pos[i]).style.visibility = "visible";
193 // alert("xx "+start + (i * inter)+" yy " + (125 - cards_height)/2);
202 function cards_dispose_ea(car_n, tak_n) {
205 $("takes_ea").style.left = 675 + (125 - cards_height)/2;
206 $("takes_ea").style.top = 125 + ((90 - cards_width) / 2);
207 $("takes_ea").style.zIndex = 1;
208 $("takes_ea").style.visibility = "visible";
213 disp = 400 - delta - (2 * border_width);
215 inter = parseInt((disp - cards_width) / (car_n - 1));
216 if (inter > cards_width)
221 wcard = cards_width + inter * (car_n - 1);
222 start = 125 + delta + border_width + (400 - border_width - border_width - wcard - delta) / 2;
225 for (i = 0 ; i < car_n ; i++) {
226 $("card_ea" + cards_ea_pos[i]).style.left = 675 + (125 - cards_height)/2;
227 $("card_ea" + cards_ea_pos[i]).style.top = start + (i * inter);
228 $("card_ea" + cards_ea_pos[i]).style.zIndex = 8 - i;
229 $("card_ea" + cards_ea_pos[i]).style.visibility = "visible";
230 // alert("xx "+ (675 + (125 - cards_height)/2) +" yy " + start + (i * inter));
239 function cards_dispose_we(car_n, tak_n)
243 $("takes_we").style.left = (125 - cards_height)/2;
244 // $("takes_we").style.top = 125 + 400 - 90 + ((90 - cards_width) / 2);
245 $("takes_we").style.top = 525 - cards_width - 400 + 90 - ((90 - cards_width) / 2);
246 $("takes_we").style.zIndex = 1;
247 $("takes_we").style.visibility = "visible";
252 /* pixel a disposizione per mettere le carte: 400 - delta - 2 bordi */
253 disp = 400 - delta - (2 * border_width);
254 /* se c'e' piu' di una carta calcola di quanti pixel devono rimanere scoperte le carte dopo la prima */
256 inter = parseInt((disp - cards_width) / (car_n - 1));
257 if (inter > cards_width)
263 /* dopo avere fatto tutti i conti ricalcola quanti pixel effettivamente verranno occupati dalle carte */
264 wcard = cards_width + inter * (car_n - 1);
266 /* calcola il punto d'inizio da dove disporre le carte: DELTAY + lo spessore del bordo + la meta' di quello
267 che resta della larghezza totale meno tutti gli altri ingombri */
268 // start = 125 + border_width + (400 - border_width - border_width - wcard - delta) / 2;
269 start = 525 - cards_width - border_width - (400 - border_width - border_width - wcard - delta) / 2;
271 for (i = 0 ; i < car_n ; i++) {
272 $("card_we" + cards_we_pos[i]).style.left = (125 - cards_height)/2;
273 $("card_we" + cards_we_pos[i]).style.top = start - (i * inter);
274 $("card_we" + cards_we_pos[i]).style.zIndex = 8 - i;
275 $("card_we" + cards_we_pos[i]).style.visibility = "visible";
284 var cards_dispose_arr = new Array(cards_dispose_so, cards_dispose_ea,
285 cards_dispose_ne, cards_dispose_nw,
288 function cards_dispose(player_pos, cards, takes)
290 var idx = (player_pos - table_pos + PLAYERS_N) % PLAYERS_N;
292 return (cards_dispose_arr[idx](cards,takes));
298 function card_mouseup_cb(o) {
299 var idx = o.id.substring(4);
300 var briskid = o.briskid;
306 /* case swap in the group */
309 if (parseInt(o.style.top) > 475 &&
310 parseInt(o.style.left) >= 200 && parseInt(o.style.left) < 600) {
311 /* Rearrange cards */
313 // $("sandbox3").innerHTML = "REARRANGE: "+idx;
320 /* found the associated index of the current card. */
321 for (i = 0 ; i < cards_n ; i++)
322 if (cards_pos[i] == idx)
326 disp = 400 - delta - (2 * border_width);
328 inter = parseInt((disp - cards_width) / (cards_n - 1));
329 if (inter > cards_width)
334 wcard = cards_width + inter * (cards_n - 1);
335 start = 200 + border_width + (400 - border_width - border_width - wcard - delta) / 2;
337 for (i = 0 ; i < cards_n ; i++) {
338 /* $("sandbox").innerHTML = */
339 // alert( "LEFT: " + o.style.left + "VALUE " + (cards_width + start + (i * (cards_width / 2))));
340 // $("sandbox3").innerHTML += "<br>LEFT: "+parseInt(o.style.left)+" START["+i+"]: "+(start + ((i+1) * inter));
342 tst = (parseInt(o.style.left) < start + ((i+1) * inter));
344 tst = (parseInt(o.style.left) > start + (i * inter));
346 // $("sandbox2").innerHTML = "old: " +old_idx+ " i: " +i+ "left: " + parseInt(o.style.left) + "comp: " + (start + (cards_width / 2) + (i * (cards_width / 2)));
352 for (e = old_idx ; e < i ; e++)
353 cards_pos[e] = cards_pos[e+1];
357 for (e = old_idx ; e > i ; e--)
358 cards_pos[e] = cards_pos[e-1];
365 cards_dispose_so(cards_n,takes_n);
369 else if (is_my_time &&
370 parseInt(o.style.top) >= 250 &&
371 parseInt(o.style.top) + cards_height < 450 &&
372 parseInt(o.style.left) >= 300 &&
373 (parseInt(o.style.left) + cards_width) < 500) {
376 $("sandbox2").innerHTML = "PLAYED";
378 for (i = 0 ; i < cards_n ; i++) {
379 if (cards_pos[i] == idx) {
380 /* $("sandbox").innerHTML = "Pippo: "+ i; */
381 for (e = i ; e < cards_n-1 ; e++) {
382 cards_pos[e] = cards_pos[e+1];
384 cards_pos[cards_n-1] = idx;
386 cards_dispose_so(cards_n, takes_n);
389 act_play(briskid,o.style.left,o.style.top);
393 cards_dispose_so(cards_n, takes_n);
398 $("sandbox2").innerHTML = "TO ORIGINAL";
399 /* alert("out card " + parseInt(o.style.top)); */
400 /* return to the original position */
401 cards_dispose_so(cards_n, takes_n);
408 function card_send_so(id,card,free,ct)
410 var img = $("card"+id);
411 img.src = getcard(-1,0);
414 img.style.left = 400 - cards_width_d2;
415 img.style.top = 300 - cards_height_d2;
416 img.style.zIndex = 100;
418 var movimg = new slowimg(img,400 - cards_width / 2,475 + (125 - cards_height)/2,25,free,"cards_dispose_so("+ct+", 0)",getcard(card,0));
419 movimg.settime(G_send_time);
423 function card_send_ea(id,card,free,ct)
425 var img = $("card_ea"+id);
426 img.src = getcard(card,1);
429 img.style.left = 400 - cards_height_d2;
430 img.style.top = 300 - cards_width_d2;
431 img.style.zIndex = 100;
433 var movimg = new slowimg(img,686,296,25,free,"cards_dispose_ea("+ct+", 0);",getcard(card,1));
434 movimg.settime(G_send_time);
438 function card_send_ne(id,card,free,ct)
440 var img = $("card_ne"+id);
441 img.src = getcard(card,2);
444 img.style.left = 400 - cards_width_d2;
445 img.style.top = 300 - cards_height_d2;
446 img.style.zIndex = 100;
448 var movimg = new slowimg(img,571,11,25,free,"cards_dispose_ne("+ct+", 0);",getcard(card,2));
449 movimg.settime(G_send_time);
453 function card_send_nw(id,card,free,ct)
455 var img = $("card_nw"+id);
456 img.src = getcard(card,3);
459 img.style.left = 400 - cards_width_d2;
460 img.style.top = 300 - cards_height_d2;
461 img.style.zIndex = 100;
463 var movimg = new slowimg(img,171,11,25,free,"cards_dispose_nw("+ct+", 0);",getcard(card,3));
464 movimg.settime(G_send_time);
468 function card_send_we(id,card,free,ct)
470 var img = $("card_we"+id);
471 img.src = getcard(card,4);
474 if (id < 0 || id > 39)
475 alert("ID ERRATO"+id);
477 img.style.left = 400 - cards_height_d2;
478 img.style.top = 300 - cards_width_d2;
479 img.style.zIndex = 100;
480 var movimg = new slowimg(img,11,296,25,free,"cards_dispose_we("+ct+", 0);",getcard(card,4));
481 movimg.settime(G_send_time);
485 var card_send_arr = new Array(card_send_so, card_send_ea,
486 card_send_ne, card_send_nw,
489 function card_send(player_pos,id,card,free,ct)
491 var idx = (player_pos - table_pos + PLAYERS_N) % PLAYERS_N;
493 card_send_arr[idx](id,card,free,ct);
496 function getcard(card,pos_id)
499 return ("img/cover"+sux[pos_id]+".png");
501 return ("img/0"+card+sux[pos_id]+".png");
503 return ("img/"+card+sux[pos_id]+".png");
506 function card_setours(zer,uno,due,tre,qua,cin,sei,set)
509 var arg = new Array(zer,uno,due,tre,qua,cin,sei,set);
511 for (i = 0 ; i < 8 ; i++) {
512 $("card"+i).src = getcard(arg[i], 0);
513 $("card"+i).briskid = arg[i];
519 function card_play_so(card_idx, x, y)
521 alert("card_play_so: unreachable function.");
523 function card_play_ne(card_idx, x, y)
525 // alert("card_play_nw: card_pos="+ card_pos+" card_idx="+card_idx+" x="+x+" y="+y);
529 function card_postplay_ea(card_pos)
531 var img = $("card_ea"+card_pos);
534 for (i = 0 ; i < cards_ea_n ; i++) {
535 if (cards_ea_pos[i] == card_pos) {
536 for (e = i ; e < cards_ea_n-1 ; e++) {
537 cards_ea_pos[e] = cards_ea_pos[e+1];
539 cards_ea_pos[cards_ea_n-1] = card_pos;
541 cards_dispose_ea(cards_ea_n, takes_ea_n);
547 function card_play_ea(card_idx, x, y)
549 // var card_pos = RANGE 0 <= x < cards_ea_n
550 var card_pos = rnd_int(0,cards_ea_n-1);
551 var img = $("card_ea"+cards_ea_pos[card_pos]);
552 // alert("IMMO CON "+cards_ea_pos[card_pos]);
553 var newname = getcard(card_idx,1);
556 x1 = 500 + ((y-250) * (125 - cards_height) / (200 - cards_height));
557 y1 = 450 - cards_width - (x - 300);
559 var movimg = new slowimg(img, x1, y1, 25, 1, "card_postplay_ea("+cards_ea_pos[card_pos]+");", newname);
560 movimg.settime(G_play_time);
565 function card_postplay_ne(card_pos)
567 var img = $("card_ne"+card_pos);
570 for (i = 0 ; i < cards_ne_n ; i++) {
571 if (cards_ne_pos[i] == card_pos) {
572 for (e = i ; e < cards_ne_n-1 ; e++) {
573 cards_ne_pos[e] = cards_ne_pos[e+1];
575 cards_ne_pos[cards_ne_n-1] = card_pos;
577 cards_dispose_ne(cards_ne_n, takes_ne_n);
583 function card_play_ne(card_idx, x, y)
585 var card_pos = rnd_int(0,cards_ne_n-1);
586 var img = $("card_ne"+cards_ne_pos[card_pos]);
587 var newname = getcard(card_idx,2);
590 x1 = 600 - cards_width - (x - 300);
591 y1 = 250 - cards_height - ((y-250) * (125 - cards_height) / (200 - cards_height));
593 var movimg = new slowimg(img, x1, y1, 25, 1, "card_postplay_ne("+cards_ne_pos[card_pos]+");", newname);
594 movimg.settime(G_play_time);
599 function card_postplay_nw(card_pos)
601 var img = $("card_nw"+card_pos);
604 for (i = 0 ; i < cards_nw_n ; i++) {
605 if (cards_nw_pos[i] == card_pos) {
606 for (e = i ; e < cards_nw_n-1 ; e++) {
607 cards_nw_pos[e] = cards_nw_pos[e+1];
609 cards_nw_pos[cards_nw_n-1] = card_pos;
611 cards_dispose_nw(cards_nw_n, takes_nw_n);
617 function card_play_nw(card_idx, x, y)
619 var card_pos = rnd_int(0,cards_nw_n-1);
620 var img = $("card_nw"+cards_nw_pos[card_pos]);
621 var newname = getcard(card_idx,3);
624 x1 = 400 - cards_width - (x - 300);
625 y1 = 250 - cards_height - ((y-250) * (125 - cards_height) / (200 - cards_height));
627 var movimg = new slowimg(img, x1, y1, 25, 1, "card_postplay_nw("+cards_nw_pos[card_pos]+");", newname);
628 movimg.settime(G_play_time);
633 function card_postplay_we(card_pos)
635 var img = $("card_we"+card_pos);
638 for (i = 0 ; i < cards_we_n ; i++) {
639 if (cards_we_pos[i] == card_pos) {
640 for (e = i ; e < cards_we_n-1 ; e++) {
641 cards_we_pos[e] = cards_we_pos[e+1];
643 cards_we_pos[cards_we_n-1] = card_pos;
645 cards_dispose_we(cards_we_n, takes_we_n);
651 function card_play_we(card_idx, x, y)
653 var card_pos = rnd_int(0,cards_we_n-1);
654 var img = $("card_we"+cards_we_pos[card_pos]);
655 var newname = getcard(card_idx,4);
658 x1 = 300 - cards_height - ((y-250) * (125 - cards_height) / (200 - cards_height));
661 var movimg = new slowimg(img, x1, y1, 25, 1, "card_postplay_we("+cards_we_pos[card_pos]+");", newname);
662 movimg.settime(G_play_time);
666 var card_play_arr = new Array( card_play_so, card_play_ea, card_play_ne, card_play_nw, card_play_we);
668 /* card_play(player_pos, card_pos, card_idx, x, y)
669 player_pos - position of the player on the table
670 card_pos - position of the card in the hand of the player
671 card_idx - id of the card (to show it after the move)
672 x, y - coordinates of the card on the original table
674 orig 200x200 dest 200x125
676 function card_play(player_pos, card_idx, x, y)
678 var idx = (player_pos - table_pos + PLAYERS_N) % PLAYERS_N;
680 card_play_arr[idx](card_idx, x, y);
685 function card_place_so(card_pos, card_idx, x, y)
687 var img = $("card"+card_pos);
689 // alert("card_place_so"+card_pos);
693 img.style.visibility = "visible";
694 img.src = getcard(card_idx,0);
698 function card_place_ea(card_pos, card_idx, x, y)
700 var img = $("card_ea"+card_pos);
702 // alert("card_place_ea");
704 img.style.left = 500 + ((y-250) * (125 - cards_height) / (200 - cards_height));
705 img.style.top = 450 - cards_width - (x - 300);
706 img.style.visibility = "visible";
707 img.src = getcard(card_idx,1);
711 function card_place_ne(card_pos, card_idx, x, y)
713 var img = $("card_ne"+card_pos);
715 // alert("card_place_ne");
717 img.style.left = 600 - cards_width - (x - 300);
718 img.style.top = 250 - cards_height - ((y-250) * (125 - cards_height) / (200 - cards_height));
719 img.style.visibility = "visible";
720 img.src = getcard(card_idx,2);
724 function card_place_nw(card_pos, card_idx, x, y)
726 var img = $("card_nw"+card_pos);
728 // alert("card_place_nw");
730 img.style.left = 400 - cards_width - (x - 300);
731 img.style.top = 250 - cards_height - ((y-250) * (125 - cards_height) / (200 - cards_height));
732 img.style.visibility = "visible";
733 img.src = getcard(card_idx,3);
737 function card_place_we(card_pos, card_idx, x, y)
739 var img = $("card_we"+card_pos);
741 // alert("card_place_we");
743 img.style.left = 300 - cards_height - ((y-250) * (125 - cards_height) / (200 - cards_height));
744 img.style.top = 250 + x - 300;
745 img.style.visibility = "visible";
746 img.src = getcard(card_idx,4);
749 var card_place_arr = new Array( card_place_so, card_place_ea, card_place_ne, card_place_nw, card_place_we );
752 function card_place(player_pos, card_pos, card_idx, x, y)
754 var idx = (player_pos - table_pos + PLAYERS_N) % PLAYERS_N;
756 // alert("card_place"+idx);
758 card_place_arr[idx](card_pos, card_idx, x, y);
763 function card_post_take(card)
765 var img = $("card"+card);
766 img.style.visibility = "hidden";
767 cards_dispose_so(cards_n, takes_n);
770 function card_ea_post_take(card)
772 var img = $("card_ea"+card);
773 img.style.visibility = "hidden";
774 cards_dispose_ea(cards_ea_n, takes_ea_n);
777 function card_ne_post_take(card)
779 var img = $("card_ne"+card);
780 img.style.visibility = "hidden";
781 cards_dispose_ne(cards_ne_n, takes_ne_n);
784 function card_nw_post_take(card)
786 var img = $("card_nw"+card);
787 img.style.visibility = "hidden";
788 cards_dispose_nw(cards_nw_n, takes_nw_n);
791 function card_we_post_take(card)
793 var img = $("card_we"+card);
794 img.style.visibility = "hidden";
795 cards_dispose_we(cards_we_n, takes_we_n);
799 function cards_take(win)
801 var taker = (win - table_pos + PLAYERS_N) % PLAYERS_N;
803 // alert("cards_n: "+cards_n+"card: "+cards_pos[cards_n]+"cards_ea_n: "+cards_ea_n+"card_ea: "+cards_ea_pos[cards_ea_n]+"cards_ne_n: "+cards_ne_n+"card_ne: "+cards_ne_pos[cards_ne_n] + "taker:"+taker);
807 takes_n += PLAYERS_N; break;
809 takes_ea_n += PLAYERS_N; break;
811 takes_ne_n += PLAYERS_N; break;
813 takes_nw_n += PLAYERS_N; break;
815 takes_we_n += PLAYERS_N; break;
820 var img = $("card"+cards_pos[cards_n]);
821 var movimg = new slowimg(img,
822 take_x[taker] - cards_width_d2,
823 take_y[taker] - cards_height_d2,
824 25, 0, "card_post_take("+cards_pos[cards_n]+");", null);
825 movimg.settime(G_take_time);
828 var img = $("card_ea"+cards_ea_pos[cards_ea_n]);
829 var movimg = new slowimg(img,
830 take_x[taker] - cards_height_d2,
831 take_y[taker] - cards_width_d2,
832 25, 0, "card_ea_post_take("+cards_ea_pos[cards_ea_n]+");", null);
833 movimg.settime(G_take_time);
836 var img = $("card_ne"+cards_ne_pos[cards_ne_n]);
837 var movimg = new slowimg(img,
838 take_x[taker] - cards_width_d2,
839 take_y[taker] - cards_height_d2,
840 25, (PLAYERS_N == 3 ? 1 : 0), "card_ne_post_take("+cards_ne_pos[cards_ne_n]+");", null);
841 movimg.settime(G_take_time);
844 var img = $("card_nw"+cards_nw_pos[cards_nw_n]);
845 var movimg = new slowimg(img,
846 take_x[taker] - cards_width_d2,
847 take_y[taker] - cards_height_d2,
848 25, 0, "card_nw_post_take("+cards_nw_pos[cards_nw_n]+");", null);
849 movimg.settime(G_take_time);
852 var img = $("card_we"+cards_we_pos[cards_we_n]);
853 var movimg = new slowimg(img,
854 take_x[taker] - cards_height_d2,
855 take_y[taker] - cards_width_d2,
856 25, 1, "card_we_post_take("+cards_we_pos[cards_we_n]+");", null);
857 movimg.settime(G_take_time);
862 function cards_hidetake(win)
870 window.onload = function() {
871 $("log").innerHTML += " xxxxxxxxxxxxxxxxxxxxxONLOAD<br>"; 53;
874 // $("imm2").style.left = 600;
875 // $("imm2").style.top = 400;
876 var zigu = new slowimg($("imm"),300,100,15,"fin");
879 // setTimeout(function() { alert("FIN:" + fin); }, 5000);
886 window.onload = function() {
888 var greet = document.createElement("span");
889 greet.style.backgroundColor = "yellow";
890 greet.innerHTML = "Hello World!";
891 $("sandbox").appendChild(greet);
895 for (i=0 ; i < 8 ; i++) {
896 Drag.init($("card" + i), card_mouseup_cb);