Taki mały bajer do wklejenia na stronie informacyjnej :) Dzialanie mozna zobaczyc u mnie http://wloclavia....page_id=22
<script language="JAVASCRIPT">
<!-- hide this script tag's contents from old browsers
function lifetimer(){
today = new Date()
BirthDay = new Date(document.live.age.value)
timeold = (today.getTime() - BirthDay.getTime());
sectimeold = timeold / 1000;
secondsold = Math.floor(sectimeold);
msPerDay = 24 * 60 * 60 * 1000 ;
timeold = (today.getTime() - BirthDay.getTime());
e_daysold = timeold / msPerDay;
daysold = Math.floor(e_daysold);
e_hrsold = (e_daysold - daysold)*24;
hrsold = Math.floor(e_hrsold);
minsold = Math.floor((e_hrsold - hrsold)*60);
document.live.time1.value = daysold
document.live.time2.value = hrsold
document.live.time3.value = minsold
window.status = "Teraz już żyjesz " + secondsold + "............ sekund.";
timerID = setTimeout("lifetimer()",1000)
}
// -- done hiding from old browsers -->
</script><script
language="JAVASCRIPT">
<!-- hide this script tag's contents from old browsers
var today = new Date()
dayStr = today.toLocaleString();
document.write("<b>Date:");
document.write(dayStr);
document.write("</b>");
// -- done hiding from old browsers -->
</script><script language="JavaScript">
<!-- begin script
//General Array Function
function MakeArray(n) {
this.length = n;
for (var i = 1; i <=n; i++) {
this[i] = 0;
}
}
//Initialize Days of Week Array
days = new MakeArray(7);
days[0] = "SOBOTA"
days[1] = "NIEDZIELA"
days[2] = "PONIEDZIAŁEK"
days[3] = "WTOREK"
days[4] = "ŚRODA"
days[5] = "CZWARTEK"
days[6] = "PIĄTEK"
//Initialize Months Array
months = new MakeArray(12);
months[1] = "STYCZEŃ"
months[2] = "LUTY"
months[3] = "MARZEC"
months[4] = "KWIECIEŃ"
months[5] = "MAJ"
months[6] = "CZERWIEC"
months[7] = "LIPIEC"
months[8] = "SIERPIEŃ"
months[9] = "WRZESIEŃ"
months[10] = "PAŹDZIERNIK"
months[11] = "LISTOPAD"
months[12] = "GRUDZIEŃ"
//Day of Week Function
function compute(form) {
var val1 = parseInt(form.day.value, 10)
if ((val1 < 0) || (val1 > 31)) {
alert("Zly dzien!")
}
var val2 = parseInt(form.month.value, 10)
if ((val2 < 0) || (val2 > 12)) {
alert("Zly miesiac!")
}
var val2x = parseInt(form.month.value, 10)
var val3 = parseInt(form.year.value, 10)
if (val3 < 1900) {
alert("Jestes za stary!!!")
}
if (val2 == 1) {
val2x = 13;
val3 = val3-1
}
if (val2 == 2) {
val2x = 14;
val3 = val3-1
}
var val4 = parseInt(((val2x+1)*3)/5, 10)
var val5 = parseInt(val3/4, 10)
var val6 = parseInt(val3/100, 10)
var val7 = parseInt(val3/400, 10)
var val8 = val1+(val2x*2)+val4+val3+val5-val6+val7+2
var val9 = parseInt(val8/7, 10)
var val0 = val8-(val9*7)
form.result1.value = months[val2]+" "+form.day.value +", "+form.year.value
form.result2.value = days[val0]
}
// end script -->
</script><!-- DESCRIPTION OF SCRIPT -->
<h3><i>Ktorego dnia sie urodziles ?</i></h3>
<p><b>Wpisz date urodzin </b>(potem przycisnij
"Sprawdz" ):</p>
<form>
<p>Numer Miesiaca (1-12): <input type="text" size="2"
name="month"> </p>
<p>Dzien Miesiaca (1-31): <input type="text" size="2"
name="day"> </p>
<p>Rok (1960): <input type="text" size="4" name="year"> </p>
<p><input type="button" value="Sprawdz"
onclick="compute(this.form)"> <input type="reset"
value="Wyczysc"> </p>
<p>Data Urodzin: <input type="text" size="35" name="result1">
</p>
<p>Dzien tygodnia: <input type="text" size="18"
name="result2"> </p>
</form>
<form name="live">
<hr color="#FF0000">
<p>Twój wiek:<input type="text" size="20" name="age">
przykład (po angielsku wpisz...) : (november 1,1966) <br>
<br>
<br>
<input type="button" name="start" value="Sprawdz czas"
onclick="lifetimer(this.form)"> <input type="reset"
name="resetb" value="Skasuj wiek"> <br>
<br>
</p>
<table border="0">
<tr>
<td>Zyjesz tyle dni:</td>
<td><input type="text" size="8" name="time1"> </td>
</tr>
<tr>
<td>Tyle godzin:</td>
<td><input type="text" size="8" name="time2"> </td>
</tr>
<tr>
<td>I tyle minut:</td>
<td><input type="text" size="8" name="time3"></td>
</tr>
</table>
</form>
|