الجافا
إليكم مجموعات من بعض اوامر الجافا
السابعة
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> <meta http-equiv="Content-Language" content="ar-sa"> <meta http-equiv="The JavaScript Source" content="no-cache"> <meta name="description" content=" "> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <TITLE>jav</TITLE> <SCRIPT language=JavaScript> <!-- Original: Simon Tneoh (tneohcb@pc.jaring.my) --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin var Cards = new makeArray(8); Cards[0] = new CardType("MasterCard", "51,52,53,54,55", "16"); var MasterCard = Cards[0]; Cards[1] = new CardType("VisaCard", "4", "13,16"); var VisaCard = Cards[1]; Cards[2] = new CardType("AmExCard", "34,37", "15"); var AmExCard = Cards[2]; Cards[3] = new CardType("DinersClubCard", "30,36,38", "14"); var DinersClubCard = Cards[3]; Cards[4] = new CardType("DiscoverCard", "6011", "16"); var DiscoverCard = Cards[4]; Cards[5] = new CardType("enRouteCard", "2014,2149", "15"); var enRouteCard = Cards[5]; Cards[6] = new CardType("JCBCard", "3088,3096,3112,3158,3337,3528", "16"); var JCBCard = Cards[6]; var LuhnCheckSum = Cards[7] = new CardType(); /*************************************************************************\ CheckCardNumber(form) function called when users click the "check" button. \*************************************************************************/ function CheckCardNumber(form) { var tmpyear; if (form.CardNumber.value.length == 0) { alert("Please enter a Card Number."); form.CardNumber.focus(); return; } if (form.ExpYear.value.length == 0) { alert("Please enter the Expiration Year."); form.ExpYear.focus(); return; } if (form.ExpYear.value > 96) tmpyear = "19" + form.ExpYear.value; else if (form.ExpYear.value < 21) tmpyear = "20" + form.ExpYear.value; else { alert("The Expiration Year is not valid."); return; } tmpmonth = form.ExpMon.options[form.ExpMon.selectedIndex].value; // The following line doesn't work in IE3, you need to change it // to something like "(new CardType())...". // if (!CardType().isExpiryDate(tmpyear, tmpmonth)) { if (!(new CardType()).isExpiryDate(tmpyear, tmpmonth)) { alert("This card has already expired."); return; } card = form.CardType.options[form.CardType.selectedIndex].value; var retval = eval(card + ".checkCardNumber(\"" + form.CardNumber.value + "\", " + tmpyear + ", " + tmpmonth + ");"); cardname = ""; if (retval) // comment this out if used on an order form alert("This card number appears to be valid."); else { // The cardnumber has the valid luhn checksum, but we want to know which // cardtype it belongs to. for (var n = 0; n < Cards.size; n++) { if (Cards[n].checkCardNumber(form.CardNumber.value, tmpyear, tmpmonth)) { cardname = Cards[n].getCardType(); break; } } if (cardname.length > 0) { alert("This looks like a " + cardname + " number, not a " + card + " number."); } else { alert("This card number is not valid."); } } } /*************************************************************************\ Object CardType([String cardtype, String rules, String len, int year, int month]) cardtype : type of card, eg: MasterCard, Visa, etc. rules : rules of the cardnumber, eg: "4", "6011", "34,37". len : valid length of cardnumber, eg: "16,19", "13,16". year : year of expiry date. month : month of expiry date. eg: var VisaCard = new CardType("Visa", "4", "16"); var AmExCard = new CardType("AmEx", "34,37", "15"); \*************************************************************************/ function CardType() { var n; var argv = CardType.arguments; var argc = CardType.arguments.length; this.objname = "object CardType"; var tmpcardtype = (argc > 0) ? argv[0] : "CardObject"; var tmprules = (argc > 1) ? argv[1] : "0,1,2,3,4,5,6,7,8,9"; var tmplen = (argc > 2) ? argv[2] : "13,14,15,16,19"; this.setCardNumber = setCardNumber; // set CardNumber method. this.setCardType = setCardType; // setCardType method. this.setLen = setLen; // setLen method. this.setRules = setRules; // setRules method. this.setExpiryDate = setExpiryDate; // setExpiryDate method. this.setCardType(tmpcardtype); this.setLen(tmplen); this.setRules(tmprules); if (argc > 4) this.setExpiryDate(argv[3], argv[4]); this.checkCardNumber = checkCardNumber; // checkCardNumber method. this.getExpiryDate = getExpiryDate; // getExpiryDate method. this.getCardType = getCardType; // getCardType method. this.isCardNumber = isCardNumber; // isCardNumber method. this.isExpiryDate = isExpiryDate; // isExpiryDate method. this.luhnCheck = luhnCheck;// luhnCheck method. return this; } /*************************************************************************\ boolean checkCardNumber([String cardnumber, int year, int month]) return true if cardnumber pass the luhncheck and the expiry date is valid, else return false. \*************************************************************************/ function checkCardNumber() { var argv = checkCardNumber.arguments; var argc = checkCardNumber.arguments.length; var cardnumber = (argc > 0) ? argv[0] : this.cardnumber; var year = (argc > 1) ? argv[1] : this.year; var month = (argc > 2) ? argv[2] : this.month; this.setCardNumber(cardnumber); this.setExpiryDate(year, month); if (!this.isCardNumber()) return false; if (!this.isExpiryDate()) return false; return true; } /*************************************************************************\ String getCardType() return the cardtype. \*************************************************************************/ function getCardType() { return this.cardtype; } /*************************************************************************\ String getExpiryDate() return the expiry date. \*************************************************************************/ function getExpiryDate() { return this.month + "/" + this.year; } /*************************************************************************\ boolean isCardNumber([String cardnumber]) return true if cardnumber pass the luhncheck and the rules, else return false. \*************************************************************************/ function isCardNumber() { var argv = isCardNumber.arguments; var argc = isCardNumber.arguments.length; var cardnumber = (argc > 0) ? argv[0] : this.cardnumber; if (!this.luhnCheck()) return false; for (var n = 0; n < this.len.size; n++) if (cardnumber.toString().length == this.len[n]) { for (var m = 0; m < this.rules.size; m++) { var headdigit = cardnumber.substring(0, this.rules[m].toString().length); if (headdigit == this.rules[m]) return true; } return false; } return false; } /*************************************************************************\ boolean isExpiryDate([int year, int month]) return true if the date is a valid expiry date, else return false. \*************************************************************************/ function isExpiryDate() { var argv = isExpiryDate.arguments; var argc = isExpiryDate.arguments.length; year = argc > 0 ? argv[0] : this.year; month = argc > 1 ? argv[1] : this.month; if (!isNum(year+"")) return false; if (!isNum(month+"")) return false; today = new Date(); expiry = new Date(year, month); if (today.getTime() > expiry.getTime()) return false; else return true; } /*************************************************************************\ boolean isNum(String argvalue) return true if argvalue contains only numeric characters, else return false. \*************************************************************************/ function isNum(argvalue) { argvalue = argvalue.toString(); if (argvalue.length == 0) return false; for (var n = 0; n < argvalue.length; n++) if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9") return false; return true; } /*************************************************************************\ boolean luhnCheck([String CardNumber]) return true if CardNumber pass the luhn check else return false. Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl \*************************************************************************/ function luhnCheck() { var argv = luhnCheck.arguments; var argc = luhnCheck.arguments.length; var CardNumber = argc > 0 ? argv[0] : this.cardnumber; if (! isNum(CardNumber)) { return false; } var no_digit = CardNumber.length; var oddoeven = no_digit & 1; var sum = 0; for (var count = 0; count < no_digit; count++) { var digit = parseInt(CardNumber.charAt(count)); if (!((count & 1) ^ oddoeven)) { digit *= 2; if (digit > 9) digit -= 9; } sum += digit; } if (sum % 10 == 0) return true; else return false; } /*************************************************************************\ ArrayObject makeArray(int size) return the array object in the size specified. \*************************************************************************/ function makeArray(size) { this.size = size; return this; } /*************************************************************************\ CardType setCardNumber(cardnumber) return the CardType object. \*************************************************************************/ function setCardNumber(cardnumber) { this.cardnumber = cardnumber; return this; } /*************************************************************************\ CardType setCardType(cardtype) return the CardType object. \*************************************************************************/ function setCardType(cardtype) { this.cardtype = cardtype; return this; } /*************************************************************************\ CardType setExpiryDate(year, month) return the CardType object. \*************************************************************************/ function setExpiryDate(year, month) { this.year = year; this.month = month; return this; } /*************************************************************************\ CardType setLen(len) return the CardType object. \*************************************************************************/ function setLen(len) { // Create the len array. if (len.length == 0 || len == null) len = "13,14,15,16,19"; var tmplen = len; n = 1; while (tmplen.indexOf(",") != -1) { tmplen = tmplen.substring(tmplen.indexOf(",") + 1, tmplen.length); n++; } this.len = new makeArray(n); n = 0; while (len.indexOf(",") != -1) { var tmpstr = len.substring(0, len.indexOf(",")); this.len[n] = tmpstr; len = len.substring(len.indexOf(",") + 1, len.length); n++; } this.len[n] = len; return this; } /*************************************************************************\ CardType setRules() return the CardType object. \*************************************************************************/ function setRules(rules) { // Create the rules array. if (rules.length == 0 || rules == null) rules = "0,1,2,3,4,5,6,7,8,9"; var tmprules = rules; n = 1; while (tmprules.indexOf(",") != -1) { tmprules = tmprules.substring(tmprules.indexOf(",") + 1, tmprules.length); n++; } this.rules = new makeArray(n); n = 0; while (rules.indexOf(",") != -1) { var tmpstr = rules.substring(0, rules.indexOf(",")); this.rules[n] = tmpstr; rules = rules.substring(rules.indexOf(",") + 1, rules.length); n++; } this.rules[n] = rules; return this; } // End --> </SCRIPT> </HEAD> <BODY vLink=#0000ff background="../../images/bakbody.jpg"> <CENTER> <BASEFONT> <!-- Demonstration --> <FORM name=ThisForm> <INPUT maxLength=19 name=CardNumber size=16> رقم البطاقة <BR> <SELECT name=CardType> <OPTION selected value=MasterCard>MasterCard<OPTION value=VisaCard>Visa<OPTION value=AmExCard>American Express<OPTION value=DinersClubCard>Diners Club<OPTION value=DiscoverCard>Discover<OPTION value=enRouteCard>enRoute<OPTION value=JCBCard>JCB</OPTION></SELECT> نوع البطاقة <BR>تاريخ الأنتهاء <SELECT name=ExpMon> <OPTION selected value=1>1<OPTION value=2>2<OPTION value=3>3<OPTION value=4>4<OPTION value=5>5<OPTION value=6>6<OPTION value=7>7<OPTION value=8>8<OPTION value=9>9<OPTION value=10>10<OPTION value=11>11<OPTION value=12>12</OPTION></SELECT> السنة <INPUT maxLength=2 name=ExpYear size=2> السنة من 97 الى 2002<BR><INPUT onclick=CheckCardNumber(this.form) type=button value=فحص><BR></FORM> <P> <a href="http://almuhajer.tripod.com"> Almuhajir</a></CENTER> </BODY></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- saved from url=(0057)http://javascript.internet.com/calculators/pregnancy.html --> <HTML><HEAD> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> <meta http-equiv="Content-Language" content="ar-sa"> <meta http-equiv="The JavaScript Source" content="no-cache"> <meta name="description" content="Enter the mother's pregnancy information into this calculator and JavaScript will provide an estimated conception date, birth due date, and an estimated current fetal age. Great for all those mothers-to-be!"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <TITLE>java</TITLE> <SCRIPT language=JavaScript> <!-- Original: Ronnie T. Moore, Editor --> <!-- Web Site: The JavaScript Source --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function isValidDate(dateStr) { // Date validation function courtesty of // Sandeep V. Tamhankar (stamhankar@hotmail.com) --> // Checks for the following valid date formats: // MM/DD/YY MM/DD/YYYY MM-DD-YY MM-DD-YYYY var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/; // requires 4 digit year var matchArray = dateStr.match(datePat); // is the format ok? if (matchArray == null) { alert("Date is not in a valid format.") return false; } month = matchArray[1]; // parse date into variables day = matchArray[3]; year = matchArray[4]; if (month < 1 || month > 12) { // check month range alert("Month must be between 1 and 12."); return false; } if (day < 1 || day > 31) { alert("Day must be between 1 and 31."); return false; } if ((month==4 || month==6 || month==9 || month==11) && day==31) { alert("Month "+month+" doesn't have 31 days!") return false; } if (month == 2) { // check for february 29th var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); if (day>29 || (day==29 && !isleap)) { alert("February " + year + " doesn't have " + day + " days!"); return false; } } return true; } function dispDate(dateObj) { month = dateObj.getMonth()+1; month = (month < 10) ? "0" + month : month; day = dateObj.getDate(); day = (day < 10) ? "0" + day : day; year = dateObj.getYear(); if (year < 2000) year += 1900; return (month + "/" + day + "/" + year); } function pregnancyCalc(pregform) { menstrual = new Date(); // creates new date objects ovulation = new Date(); duedate = new Date(); today = new Date(); cycle = 0, luteal = 0; // sets variables to invalid state ==> 0 if (isValidDate(pregform.menstrual.value)) { // Validates menstual date menstrualinput = new Date(pregform.menstrual.value); menstrual.setTime(menstrualinput.getTime()) } else return false; // otherwise exits cycle = (pregform.cycle.value == "" ? 28 : pregform.cycle.value); // defaults to 28 // validates cycle range, from 22 to 45 if (pregform.cycle.value != "" && (pregform.cycle.value < 22 || pregform.cycle.value > 45)) { alert("Your cycle length is either too short or too long for \n" + "calculations to be very accurate! We will still try to \n" + "complete the calculation with the figure you entered. "); } luteal = (pregform.luteal.value == "" ? 14 : pregform.luteal.value); // defaults to 14 // validates luteal range, from 9 to 16 if (pregform.luteal.value != "" && (pregform.luteal.value < 9 || pregform.luteal.value > 16)) { alert("Your luteal phase length is either too short or too long for \n" + "calculations to be very accurate! We will still try to complete \n" + "the calculation with the figure you entered. "); } // sets ovulation date to menstrual date + cycle days - luteal days // the '*86400000' is necessary because date objects track time // in milliseconds; 86400000 milliseconds equals one day ovulation.setTime(menstrual.getTime() + (cycle*86400000) - (luteal*86400000)); pregform.conception.value = dispDate(ovulation); // sets due date to ovulation date plus 266 days duedate.setTime(ovulation.getTime() + 266*86400000); pregform.duedate.value = dispDate(duedate); // sets fetal age to 14 + 266 (pregnancy time) - time left var fetalage = 14 + 266 - ((duedate - today) / 86400000); weeks = parseInt(fetalage / 7); // sets weeks to whole number of weeks days = Math.floor(fetalage % 7); // sets days to the whole number remainder // fetal age message, automatically includes 's' on week and day if necessary fetalage = weeks + " week" + (weeks > 1 ? "s" : "") + ", " + days + " days"; pregform.fetalage.value = fetalage; return false; // form should never submit, returns false } // End --> </SCRIPT> </HEAD> <BODY vLink=#0000ff background="../../images/bakbody.jpg"> <CENTER> <BASEFONT> <TABLE border=0 cellPadding=3 cellSpacing=0 width=486> <TBODY> <TR> <TD> <p align="center"><FONT face=helvetica,arial,geneva><!-- Description --></FONT><font size="2" face="Tahoma" color="#000080">مخطوطة رائعة لحساب الحمل .. قم بتعبيئة اول فراغ وسوف تحصل على نتيجة دقيقة .. مفيد للأمهات المستقبل</font><FONT face=helvetica,arial,geneva> <HR> </FONT></TD></TR></TBODY></TABLE><!-- Demonstration --> <CENTER> <FORM onsubmit="return pregnancyCalc(this);"> <p><font color="#FF0000" size="3" face="Tahoma">كل التواريخ الميلادي وحسب اتجاه شكل التاريخ الموضح بأدناه</font></p> <TABLE> <TBODY> <TR> <TD><PRE> <INPUT maxLength=10 name=menstrual size=10> تاريخ فترة آخر حيض ( الدورة الشهرية ) بالدقة من فضلك (<font color="#FF0000">سنة/يوم/شهر</font> ) </PRE><PRE> <INPUT maxLength=3 name=cycle size=3 value="22"> اتركها كما هي <INPUT maxLength=3 name=luteal size=3 value="9"> اتركها كما هي <CENTER><INPUT type=submit value=أحسب></CENTER> <INPUT name=conception> التاريخ المتوقع للحمل <INPUT name=duedate> التاريخ المتوقع للولادة <INPUT name=fetalage> العمر المتوقع للجنين </PRE></TD></TR></TBODY></TABLE></FORM></CENTER> </CENTER> <p align="center"><a href="http://www.bnturki.com">BnTurki</a></p> </BODY></HTML>
<!-- ONE STEP TO INSTALL RAIN: 1. Copy the coding into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the BODY of your HTML document --> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- Original: Matthew Musgrove ( muskrat@lvnworth.com) --> <!-- Web Site: http://free.prohosting.com/~musgrove --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin var no = 50; var speed = 1; var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? 1 : 0; var s, x, y, sn, cs; var a, r, cx, cy; var i, doc_width = 800, doc_height = 600; if (ns4up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } else if (ie4up) { doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } x = new Array(); y = new Array(); r = new Array(); cx = new Array(); cy = new Array(); s = 8; for (i = 0; i < no; ++ i) { initRain(); if (ns4up) { if (i == 0) { document.write("<layer name=\"dot"+ i +"\" left=\"1\" "); document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">"); document.write(",</font></layer>"); } else { document.write("<layer name=\"dot"+ i +"\" left=\"1\" "); document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">"); document.write(",</font></layer>"); } } else if (ie4up) { if (i == 0) { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: "); document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: "); document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">"); document.write(",</font></div>"); } else { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: "); document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: "); document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">"); document.write(",</font></div>"); } } } function initRain() { a = 6; r[i] = 1; sn = Math.sin(a); cs = Math.cos(a); cx[i] = Math.random() * doc_width + 1; cy[i] = Math.random() * doc_height + 1; x[i] = r[i] * sn + cx[i]; y[i] = cy[i]; } function makeRain() { r[i] = 1; cx[i] = Math.random() * doc_width + 1; cy[i] = 1; x[i] = r[i] * sn + cx[i]; y[i] = r[i] * cs + cy[i]; } function updateRain() { r[i] += s; x[i] = r[i] * sn + cx[i]; y[i] = r[i] * cs + cy[i]; } function raindropNS() { for (i = 0; i < no; ++ i) { updateRain(); if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) { makeRain(); doc_width = self.innerWidth; doc_height = self.innerHeight; } document.layers["dot"+i].top = y[i]; document.layers["dot"+i].left = x[i]; } setTimeout("raindropNS()", speed); } function raindropIE() { for (i = 0; i < no; ++ i) { updateRain(); if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) { makeRain(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } document.all["dot"+i].style.pixelTop = y[i]; document.all["dot"+i].style.pixelLeft = x[i]; } setTimeout("raindropIE()", speed); } if (ns4up) { raindropNS(); } else if (ie4up) { raindropIE(); } // End --> </script> <p><center> <font face="arial, helvetica" size="-2"><br> <a href="http://javascriptsource.com"></a></font> </center><p> <!-- Script Size: 3.14 KB -->
<!-- TWO STEPS TO INSTALL AGE CALCULATOR: 1. Copy the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Original: Dev Pragad (devpragad@yahoo.com) --> <!-- Web Site: http://www.geocities.com/devpragad --> <!-- Modified by: Ronnie T. Moore, Editor --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function run() { with (document.agecalc) { dd = parseInt(day.selectedIndex) + 1; mm = parseInt(month.selectedIndex) + 1; yy = year.value; if (yy.length != 4 || isNaN(yy)) { document.agecalc.timealive.value = "Please enter a 4-digit year."; document.agecalc.year.select(); document.agecalc.year.focus(); return; } } days = new Date(); gdate = days.getDate(); gmonth = days.getMonth(); gyear = days.getYear(); if (gyear < 2000) gyear += 1900; age = gyear - yy; if ((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) { age = age; } else { if (mm <= (gmonth)) { age = age; } else { age = age - 1; } } if (age == 0) age = age; document.agecalc.timealive.value = "You are " + age+ " years old . . .\n\n"; if (mm <= (gmonth + 1)) age = age - 1; if ((mm == (gmonth + 1)) && (dd > parseInt(gdate))) age = age + 1; var m; var n; if (mm == 12) n = 31 - dd; if (mm == 11) n = 61 - dd; if (mm == 10) n = 92 - dd; if (mm == 9) n = 122 - dd; if (mm == 8) n = 153 - dd; if (mm == 7) n = 184 - dd; if (mm == 6) n = 214 - dd; if (mm == 5) n = 245 - dd; if (mm == 4) n = 275 - dd; if (mm == 3) n = 306 - dd; if (mm == 2) { n = 334 - dd; if (leapyear(yy)) n++; } if (mm == 1) { n = 365 - dd; if (leapyear(yy)) n++; } if (gmonth == 1) m = 31; if (gmonth == 2) { m = 59; if (leapyear(gyear)) m++; } if (gmonth == 3) { m = 90; if (leapyear(gyear)) m++; } if (gmonth == 4) { m = 120; if (leapyear(gyear)) m++; } if (gmonth == 5) { m = 151; if (leapyear(gyear)) m++; } if (gmonth == 6) { m = 181; if (leapyear(gyear)) m++; } if (gmonth == 7) { m = 212; if (leapyear(gyear)) m++; } if (gmonth == 8) { m = 243; if (leapyear(gyear)) m++; } if (gmonth == 9) { m = 273; if (leapyear(gyear)) m++; } if (gmonth == 10) { m = 304; if (leapyear(gyear)) m++; } if (gmonth == 11) { m = 334; if (leapyear(gyear)) m++; } if (gmonth == 12) { m = 365; if (leapyear(gyear)) m++; } months = age * 12; months += 12 - parseInt(mm); months += gmonth; totdays = (parseInt(age) * 365); totdays += age / 4; totdays = parseInt(totdays) + gdate + m + n; if (gmonth == 1) p = 31 + gdate; if (gmonth == 2) { p = 59 + gdate; if (leapyear(gyear)) m = m+1; } if (gmonth == 3) { p = 90 + gdate; if (leapyear(gyear)) p++; } if (gmonth == 4) { p = 120 + gdate; if (leapyear(gyear)) p++; } if (gmonth == 5) { p = 151 + gdate; if (leapyear(gyear)) p++; } if (gmonth == 6) { p = 181 + gdate; if (leapyear(gyear)) p++; } if (gmonth == 7) { p = 212 + gdate; if (leapyear(gyear)) p++; } if (gmonth == 8) { p = 243 + gdate; if (leapyear(gyear)) p++; } if (gmonth == 9) { p = 273 + gdate; if (leapyear(gyear)) p++; } if (gmonth == 10) { p = 304 + gdate; if (leapyear(gyear)) p++; } if (gmonth == 11) { p = 334 + gdate; if (leapyear(gyear)) p++; } if (gmonth == 12) { p = 365 + gdate; if (leapyear(gyear)) p++; } weeks = (age * 365) + n + p; weeks = weeks / 7; etcdays = parseFloat(weeks) - parseInt(weeks); etcdays = Math.round(etcdays * 7); weeks = parseInt(weeks); etcdays += parseInt(age / 4); if (etcdays > 7) weeks += parseInt(etcdays / 7); document.agecalc.timealive.value += " or " + weeks + " Weeks old\n"; document.agecalc.timealive.value += " or " + months + " Months old\n"; document.agecalc.timealive.value += " or " + totdays + " days old\n"; var time = new Date(); ghour = time.getHours(); gmin = time.getMinutes(); gsec = time.getSeconds(); hour = ((age * 365) + n + p) * 24; hour += (parseInt(age / 4) * 24); document.agecalc.timealive.value += " or " + hour + " Hours old\n"; var min = (hour * 60) + gmin; document.agecalc.timealive.value += " or " + min + " Minutes old\n"; sec = (min * 60) + gsec; document.agecalc.timealive.value += " or " + sec + " Seconds old"; mm = mm - 1; var r; if (mm == 0) r = 0; if (mm == 1) r = 31; if (mm == 2) { r = 59; if (leapyear(gyear)) m++; } if (mm == 3) { r = 90; if (leapyear(gyear)) r++; } if (mm == 4) { r = 120; if (leapyear(gyear)) r++; } if (mm == 5) { r = 151; if (leapyear(gyear)) r++; } if (mm == 6) { r = 181; if (leapyear(gyear)) r++; } if (mm == 7) { r = 212; if (leapyear(gyear)) r++; } if (mm == 8) { r = 243; if (leapyear(gyear)) r++; } if (mm == 9) { r = 273; if (leapyear(gyear)) r++; } if (mm == 10) { r = 304; if (leapyear(gyear)) r++; } if (mm == 11) { r = 334; if (leapyear(gyear)) r++; } mm = mm + 1; r = parseInt(r) + parseInt(dd); if ((mm >= (gmonth + 1)) && (dd > gdate)) { bday = r - m - gdate; } else { if ((leapyear(gyear)) && ((mm > 2) && (dd < 29))) { a = 366; } else { a = 365; } bday = a + (r - m - gdate); } nhour = 24 - parseInt(ghour); nmin = 60 - parseInt(gmin); nsec = 60 - parseInt(gsec); while (bday > 366) bday -= 365; if (((bday == 366) && (leapyear(gyear)) || ((bday == 365) && (!leapyear(gyear))))) { document.agecalc.timealive.value += "\n\nAnd, today is your birthday!"; } else { document.agecalc.timealive.value += "\n\nAnd, your next birthday is in:\n" + bday + " days " + nhour + " hrs " + nmin + " mins " + nsec + " secs"; setTimeout("run()", 1000); } } function leapyear(a) { if (((a%4 == 0) && (a%100 != 0)) || (a%400 == 0)) return true; else return false; } // End --> </script> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <center> <form name=agecalc> <table> <tr><td align=center> <select name=month size=1> <option>January <option>February <option>March <option>April <option>May <option>June <option>July <option>August <option>September <option>October <option>November <option>December </select> <select name=day size=1> <option>1 <option>2 <option>3 <option>4 <option>5 <option>6 <option>7 <option>8 <option>9 <option>10 <option>11 <option>12 <option>13 <option>14 <option>15 <option>16 <option>17 <option>18 <option>19 <option>20 <option>21 <option>22 <option>23 <option>24 <option>25 <option>26 <option>27 <option>28 <option>29 <option>30 <option>31 </select> <input type=text name=year size=4 maxlength=4>تاريخ الميلاد <br> <input type=button name=start value="إحسب" onclick="run();" style="font-weight: bold"><br> <br> <textarea rows=12 cols=35 name=timealive>
يمكنك تغيير طول وعرض الصفحه من الارقام التي 300 و 100 <IFRAME WIDTH=100% HEIGHT=300 SRC="http://www.yahoo.com"></IFRAME>
العاب نارية
<layer name="a0" left=10 top=10 visibility=show bgcolor="#ffffff" clip="0,0,1,1"></layer> <layer name="a1" left=10 top=10 visibility=show bgcolor="#fff000" clip="0,0,1,1"></layer> <layer name="a2" left=10 top=10 visibility=show bgcolor="#ffa000" clip="0,0,1,1"></layer> <layer name="a3" left=10 top=10 visibility=show bgcolor="#ff00ff" clip="0,0,1,1"></layer> <layer name="a4" left=10 top=10 visibility=show bgcolor="#00ff00" clip="0,0,1,1"></layer> <layer name="a5" left=10 top=10 visibility=show bgcolor="#ff00ff" clip="0,0,1,1"></layer> <layer name="a6" left=10 top=10 visibility=show bgcolor="#ff0000" clip="0,0,1,1"></layer> <layer name="a7" left=10 top=10 visibility=show bgcolor="#ffffff" clip="0,0,1,1"></layer> <layer name="a8" left=10 top=10 visibility=show bgcolor="#fff000" clip="0,0,1,1"></layer> <layer name="a9" left=10 top=10 visibility=show bgcolor="#ffa000" clip="0,0,1,1"></layer> <layer name="a10" left=10 top=10 visibility=show bgcolor="#ff00ff" clip="0,0,1,1"></layer> <layer name="a11" left=10 top=10 visibility=show bgcolor="#00ff00" clip="0,0,2,2"></layer> <layer name="a12" left=10 top=10 visibility=show bgcolor="#0000ff" clip="0,0,2,2"></layer> <layer name="a13" left=10 top=10 visibility=show bgcolor="#ff0000" clip="0,0,2,2"></layer> <script language="JavaScript"> /* Document firework script (By Kurt Gregg, kurt.grigg@virgin.net) Modified granted to Dynamic Drive to feature script in archive For full source and 100's more DHTML scripts, visit http://dynamicdrive.com */ if (document.all) with(document){ write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">') write('<div style="position:relative;width:2px;height:2px;background:#ffffff;font-size:2px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#fff000;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#ffa000;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#ff00ff;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#00ff00;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#0000ff;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#FF0000;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#ffffff;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#fff000;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#ffa000;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#ff00ff;font-size:1px"></div>') write('<div style="position:relative;width:2px;height:2px;background:#ff00ff;font-size:2px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#0000ff;font-size:1px"></div>') write('<div style="position:relative;width:1px;height:1px;background:#FF0000;font-size:1px"></div>') write('</div>') } var Clrs=new Array(9) Clrs[0]='ff0000'; Clrs[1]='00ff00'; Clrs[2]='000aff'; Clrs[3]='ff00ff'; Clrs[4]='ffa500'; Clrs[5]='ffff00'; Clrs[6]='00ff00'; Clrs[7]='ffffff'; Clrs[8]='fffff0'; var sClrs=new Array(5) sClrs[0]='ffa500'; sClrs[1]='55ff66'; sClrs[2]='AC9DFC'; sClrs[3]='fff000'; sClrs[4]='fffff0'; var yBase; var xBase; var step; var currStep = 0; var Xpos = 1; var Ypos = 1; var initialStarColor='ffa000'; var Mtop=250; var Mleft=250; function Fireworks() { if (document.all) { yBase = window.document.body.offsetHeight/3; xBase = window.document.body.offsetWidth/8; } else if (document.layers) { yBase = window.innerHeight/3; xBase = window.innerWidth/8; } if (document.all) { step=5; for ( i = 0 ; i < starsDiv.all.length ; i++ ) { for (ai=0; ai < Clrs.length; ai++) { var c=Math.round(Math.random()*[ai]); } if (currStep < 90) starsDiv.all[i].style.background=initialStarColor; if (currStep > 90) starsDiv.all[i].style.background=Clrs[c]; starsDiv.all[i].style.top = Mtop + yBase*Math.sin((currStep+i*5)/3)*Math.sin(550+currStep/100) starsDiv.all[i].style.left = Mleft + yBase*Math.cos((currStep+i*5)/3)*Math.sin(550+currStep/100) } } else if (document.layers) { step = 5; for ( j = 0 ; j < 14 ; j++ ) //number of NS layers! { var templayer="a"+j for (ai=0; ai < Clrs.length; ai++) { var c=Math.round(Math.random()*[ai]); } if (currStep < 90) document.layers[templayer].bgColor=initialStarColor; if (currStep > 90) document.layers[templayer].bgColor=Clrs[c]; document.layers[templayer].top = Mtop + yBase*Math.sin((currStep+j*5)/3)*Math.sin(550+currStep/100) document.layers[templayer].left = Mleft + yBase*Math.cos((currStep+j*5)/3)*Math.sin(550+currStep/100) } } currStep+= step; //window.status=currStep; T=setTimeout("Fireworks()",5); if (currStep==220) { currStep=-10; for (n=0; n < sClrs.length; n++) { var k=Math.round(Math.random()*n); } initialStarColor=sClrs[k]; if (document.all) { Dtop=window.document.body.clientHeight-250; Dleft=xBase*3.5; Mtop=Math.round(Math.random()*Dtop); Mleft=Math.round(Math.random()*Dleft); document.all.starsDiv.style.top=Mtop+document.body.scrollTop; document.all.starsDiv.style.left=Mleft+document.body.scrollLeft; } else if (document.layers) { Dleft=window.innerWidth-100; Dtop=window.innerHeight-100; Mtop=Math.round(Math.random()*Dtop+window.pageYOffset); Mleft=Math.round(Math.random()*Dleft+window.pageXOffset); document.layers[templayer].top=Mtop; document.layers[templayer].left=Mleft; } if ((Mtop < 20) || (Mleft < 20)) { Mtop+=90; Mleft+=90; } } } if (document.all||document.layers) Fireworks(); </script>
© حقوق النشر محفوظة لموقع رحاب المحبة 2002-2003