<body>
<script>
if ((document.getElementById && document.firstChild) &&
window.addEventListener || window.attachEvent){
(function(){
var pick = 6;
var from = 1;
var to = 45;
var buttonText = "로또생성기";
var initialText = "Daum카페 리더 모임";
var playing = false;
var timer = null;
var counter = 0;
function numsort(n1,n2) {
if (n1 < n2) x=-1;
else if (n1 > n2) x=1;
else x=0;
return x;
}
function justOnce(b){
controlButton.blur();
if (playing){
return false;
}
else{
lotto();
}
}
function lotto(){
var rng = to-from;
var dum = "";
var e = (rng + 1);
var draw = new Array();
var number;
if (from >= to ){
alert!("from value must be less than to value");
return false;
}
if ( (to+1)-from < pick){
alert!("Error - You want "+pick+" numbers.\n\n"
+"The range you have entered is from "+from+" to "+to+".\n"
+"This leaves "+(rng+1)+" available random numbers.");
return false;
}
playing = true;
for (i=0; i < pick; i++){
number = parseInt(from + Math.random() * e);
for (j=0; j < pick; j){
if (number!=draw[j]){
j++;
}
else{
number = parseInt(from + Math.random() * e);
j = 0;
}
}
draw[i] = number;
}
draw.sort(numsort);
for (i=0; i < pick; i++){
disp = dum += (draw[i]+" ");
}
counter++;
document.getElementById("result"+idx).firstChild.data = disp;
timer = setTimeout(lotto,50);
if (counter > 50){
clearTimeout(timer);
playing=false;
counter=0;
}
}
var idx = document.getElementsByTagName('div').length;
document.write('<div id="container'+idx+'" style="'
+'position:relative;'
+'width:160px;height:50px;'
+'font-family:verdana,arial,sans-serif;'
+'font-size:12px;'
+'color:#000000;'
+'background-color:#FFCCFF;'
+'text-align:center;'
+'border : 1px solid #000000">'
+'<input title="인생대역전 클릭" type="button" id="play'+idx+'"'
+'value="'+buttonText+'" style="margin:5px">'
+'<div id="result'+idx+'" style="'
+'width:150px;'
+'font-family:verdana,arial,sans-serif;'
+'font-size:12px;'
+'color:#000000">'+initialText+'<\/div><\/div>');
var controlButton = document.getElementById("play"+idx);
if (window.addEventListener){
controlButton.addEventListener("click",justOnce,false);
}
else if (window.attachEvent){
controlButton.attachEvent("xx[안내]태그제한으로등록되지않습니다-onclick",justOnce);
}
})();
}
</script>
</body>
<script>
if ((document.getElementById && document.firstChild) &&
window.addEventListener || window.attachEvent){
(function(){
var pick = 6;
var from = 1;
var to = 45;
var buttonText = "로또생성기";
var initialText = "Daum카페 리더 모임";
var playing = false;
var timer = null;
var counter = 0;
function numsort(n1,n2) {
if (n1 < n2) x=-1;
else if (n1 > n2) x=1;
else x=0;
return x;
}
function justOnce(b){
controlButton.blur();
if (playing){
return false;
}
else{
lotto();
}
}
function lotto(){
var rng = to-from;
var dum = "";
var e = (rng + 1);
var draw = new Array();
var number;
if (from >= to ){
alert!("from value must be less than to value");
return false;
}
if ( (to+1)-from < pick){
alert!("Error - You want "+pick+" numbers.\n\n"
+"The range you have entered is from "+from+" to "+to+".\n"
+"This leaves "+(rng+1)+" available random numbers.");
return false;
}
playing = true;
for (i=0; i < pick; i++){
number = parseInt(from + Math.random() * e);
for (j=0; j < pick; j){
if (number!=draw[j]){
j++;
}
else{
number = parseInt(from + Math.random() * e);
j = 0;
}
}
draw[i] = number;
}
draw.sort(numsort);
for (i=0; i < pick; i++){
disp = dum += (draw[i]+" ");
}
counter++;
document.getElementById("result"+idx).firstChild.data = disp;
timer = setTimeout(lotto,50);
if (counter > 50){
clearTimeout(timer);
playing=false;
counter=0;
}
}
var idx = document.getElementsByTagName('div').length;
document.write('<div id="container'+idx+'" style="'
+'position:relative;'
+'width:160px;height:50px;'
+'font-family:verdana,arial,sans-serif;'
+'font-size:12px;'
+'color:#000000;'
+'background-color:#FFCCFF;'
+'text-align:center;'
+'border : 1px solid #000000">'
+'<input title="인생대역전 클릭" type="button" id="play'+idx+'"'
+'value="'+buttonText+'" style="margin:5px">'
+'<div id="result'+idx+'" style="'
+'width:150px;'
+'font-family:verdana,arial,sans-serif;'
+'font-size:12px;'
+'color:#000000">'+initialText+'<\/div><\/div>');
var controlButton = document.getElementById("play"+idx);
if (window.addEventListener){
controlButton.addEventListener("click",justOnce,false);
}
else if (window.attachEvent){
controlButton.attachEvent("xx[안내]태그제한으로등록되지않습니다-onclick",justOnce);
}
})();
}
</script>
</body>
'━━━━ Perhaps > •……태그 HTML' 카테고리의 다른 글
링크걸기 (0) | 2007.10.23 |
---|---|
아드레날린으로 동영상 캡춰하기 (0) | 2007.10.23 |
원으로 돌아가는이미지 슬라이드 (0) | 2007.10.23 |
기초글씨 태그 (0) | 2007.10.23 |
소스보기금지소스 (0) | 2007.10.23 |