----------------------------------------------
قائمة متساقطة تتساقط مرة واحدة فقط .. عند دخول الصفحة
بهذا الشكل <body>توضع هذه الجملة بين تنصيصتي
<body onLoad="buildMenu(), scrollItems();"> وغير ما يلزم <body> انسخ ما يلي في
كود:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function buildMenu() {
speed=5;
topdistance=20;
items=6;
y=-50;
ob=1;
if (navigator.appName == "Netscape") {
v=".top=",dS="document.",sD="";
}
else {
v=".pixelTop=",dS="",sD=".style";
}
}
function scrollItems() {
if (ob<items+1) {
objectX="object"+ob; y+=10; eval(dS + objectX + sD + v + y);
if (y<topdistance) setTimeout("scrollItems()",speed);
else y=-50, topdistance+=40, ob+=1, setTimeout("scrollItems()",speed);
}
}
// End -->
</SCRIPT>
<div id="object1" style="position:absolute; visibility:show; left:10px; top:-50px; z-index:2">
<table border=1 width=120 bgcolor=ffffff><td>
<p align="center"><center>
<a href="javascript:if(confirm('http://العنوان.html/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://العنوان.html/'" tppabs="http://العنوان.html/">الأرتباط الأول</a>
</center></p>
</td></table>
</div>
<div id="object2" style="position:absolute; visibility:show; left:10px; top:-50px; z-index:2">
<table border=1 width=120 bgcolor=f0f0f0>
<td><center>
<a href="javascript:if(confirm('http://العنوان.html/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://العنوان.html/'" tppabs="http://العنوان.html/">الأرتباط الثاني</a>
</center></td>
</table>
</div>
<div id="object3" style="position:absolute; visibility:show; left:10px; top:-50px; z-index:2">
<table border=1 width=120 bgcolor=ffffff>
<td><center>
<a href="javascript:if(confirm('http://العنوان.html/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://العنوان.html/'" tppabs="http://العنوان.html/">الأرتباط الثالث</a>
</center></td>
</table>
</div>
<div id="object4" style="position:absolute; visibility:show; left:10px; top:-50px; z-index:2">
<table border=1 width=120 bgcolor=f0f0f0>
<td><center>
<a href="javascript:if(confirm('http://العنوان.html/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://العنوان.html/'" tppabs="http://العنوان.html/">الأرتباط الرابع</a>
</center></td>
</table>
</div>
<div id="object5" style="position:absolute; visibility:show; left:10px; top:-50px; z-index:2">
<table border=1 width=120 bgcolor=ffffff>
<td><center>
<a href="javascript:if(confirm('http://العنوان.html/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://العنوان.html/'" tppabs="http://العنوان.html/">الأرتباط الخامس</a>
</center></td>
</table>
</div>
<div id="object6" style="position:absolute; visibility:show; left:10px; top:-50px; z-index:2">
<table border=1 width=120 bgcolor=f0f0f0>
<td><center>
<a href="javascript:if(confirm('http://العنوان.html/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://العنوان.html/'" tppabs="http://العنوان.html/">الأرتباط السادس</a>
</center></td>
</table>
</div>
<div id="object7" style="position:absolute; visibility:show; left:10px; top:-50px; z-index:2">
<table border=1 width=120 bgcolor=ffffff>
<td><center>
<a href="javascript:if(confirm('http://العنوان.html/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://العنوان.html/'" tppabs="http://العنوان.html/">الأرتباط السابع</a>
</center></td>
</table>
</div>
<!-- -->
غير ما يلزم تغييرة في الكود السابق من الوان الروابط
والخلفيات ونوع الخط .. وادخل مسميات الروابط وعناوينها
وسرعة نزول القائمة .. وما الى ذلك
-------------------------------------
قائمة منسدلة 2 وغير ما يلزم <body> انسخ ما يلي في
------------------------------------ قائمة ديناميكية
وغير ما يلزم <head> انسخ ما يلي في
كود:
<script language="javascript">
function movein(which,html){
which.style.background='#f0f0f0'
iedescription.innerHTML=html
}
function moveout(which){
which.style.background='#d6d6d6'
iedescription.innerHTML=' '
}
</script>
تستطيع من خلال الكود اعلاه تغيير لون الخلفية للجدول
وغير ما يلزم <body> انسخ ما يلي في
كود:
<DIV align=center>
<table bgcolor="#d6d6d6" border="1" bordercolor="#d6d6d6" cellpadding="2" cellspacing="0" width="170">
<tr>
<TD borderColor=blue class=menu id=choice1 onmouseout=moveout(choice1)
onmouseover="movein(choice1,'وصف الرابطة 1 ')"
style="BACKGROUND-COLOR: bisque; CURSOR: hand" align="center" width="162"><A href="javascript:if(confirm('http://عنوان الرابطة 1/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://عنوان الرابطة 1/'" tppabs="http://عنوان الرابطة 1/"><font face="Tahoma">إضافة روابط</font></A></TD></tr>
<TR>
<TD borderColor=blue class=menu id=choice2 onmouseout=moveout(choice2)
onmouseover="movein(choice2,' وصف الرابطة 2')"
style="BACKGROUND-COLOR: bisque; CURSOR: hand" align="center" width="162"><A href="javascript:if(confirm('http://عنوان الرابطة 2/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://عنوان الرابطة 2/'" tppabs="http://عنوان الرابطة 2/"><font face="Tahoma">موقع الجافا</font></A></TD></TR>
<TR>
<TD borderColor=blue class=menu id=choice3 onmouseout=moveout(choice3)
onmouseover="movein(choice3,' وصف الرابطة 3')"
style="BACKGROUND-COLOR: bisque; CURSOR: hand" align="center" width="162"><A href="javascript:if(confirm('http://عنوان الرابطة 3/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://عنوان الرابطة 3/'" tppabs="http://عنوان الرابطة 3/"><font face="Tahoma">البرامج</font></A></TD></TR>
<TR>
<TD borderColor=blue class=menu id=choice4 onmouseout=moveout(choice4)
onmouseover="movein(choice4,' وصف الرابطة 4')"
style="BACKGROUND-COLOR: bisque; CURSOR: hand" align="center" width="162"><A href="javascript:if(confirm('http://عنوان الرابطة 4/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://عنوان الرابطة 4/'" tppabs="http://عنوان الرابطة 4/"><font face="Tahoma">الهلال</font></a></TD></TR>
<tr>
<td bordercolor="#f0f0f0" bgcolor="#f0f0f0" height="18" align="center" width="162"><font id="iedescription" face="tahoma" size="2"></font><font color="#ffffff"> </font></td></tr>
</table></DIV>
في كود الجسم تستطيع تغيير الكثير واهمها بالطبع الجمل الوصفية وعناوين الروبط كما تستطيع تغيير انواع الخطوط والوانها والخلفيات .. والكود المعروض هو للقائمة المعروضة امامك
--------------------------------------------------------- ساعات و حاسبات و تواريخ مصنعة بواسطة الجافا
تقويم للسنه الميلادية
كود:
<SCRIPT LANGUAGE="JavaScript">
<!--
setCal()
function getTime() {
// initialize time-related variables with current time settings
var now = new Date()
var hour = now.getHours()
var minute = now.getMinutes()
now = null
var ampm = ""
// validate hour values and set value of ampm
if (hour >= 12) {
hour -= 12
ampm = "PM"
} else
ampm = "AM"
hour = (hour == 0) ? 12 : hour
// add zero digit to a one digit minute
if (minute < 10)
minute = "0" + minute // do not parse this number!
// return time string
return hour + ":" + minute + " " + ampm
}
function leapYear(year) {
if (year % 4 == 0) // basic rule
return true // is leap year
/* else */ // else not needed when statement is "return"
return false // is not leap year
}
function getDays(month, year) {
// create array to hold number of days in each month
var ar = new Array(12)
ar[0] = 31 // January
ar[1] = (leapYear(year)) ? 29 : 28 // February
ar[2] = 31 // March
ar[3] = 30 // April
ar[4] = 31 // May
ar[5] = 30 // June
ar[6] = 31 // July
ar[7] = 31 // August
ar[8] = 30 // September
ar[9] = 31 // October
ar[10] = 30 // November
ar[11] = 31 // December
// return number of days in the specified month (parameter)
return ar[month]
}
function getMonthName(month) {
// create array to hold name of each month
var ar = new Array(12)
ar[0] = "January"
ar[1] = "February"
ar[2] = "March"
ar[3] = "April"
ar[4] = "May"
ar[5] = "June"
ar[6] = "July"
ar[7] = "August"
ar[8] = "September"
ar[9] = "October"
ar[10] = "November"
ar[11] = "December"
// return name of specified month (parameter)
return ar[month]
}
function setCal() {
// standard time attributes
var now = new Date()
var year = now.getYear()
var month = now.getMonth()
var monthName = getMonthName(month)
var date = now.getDate()
now = null
// create instance of first day of month, and extract the day on which it occurs
var firstDayInstance = new Date(year, month, 1)
var firstDay = firstDayInstance.getDay()
firstDayInstance = null
// number of days in current month
var days = getDays(month, year)
// call function to draw calendar
drawCal(firstDay + 1, days, date, monthName, 1900 + year)
}
function drawCal(firstDay, lastDate, date, monthName, year) {
// constant table settings
var headerHeight = 50 // height of the table's header cell
var border = 2 // 3D height of table's border
var cellspacing = 4 // width of table's border
var headerColor = "midnightblue" // color of table's header
var headerSize = "+3" // size of tables header font
var colWidth = 60 // width of columns in table
var dayCellHeight = 25 // height of cells containing days of the week
var dayColor = "darkblue" // color of font representing week days
var cellHeight = 40 // height of cells representing dates in the calendar
var todayColor = "red" // color specifying today's date in the calendar
var timeColor = "purple" // color of font representing current time
// create basic table structure
var text = "" // initialize accumulative variable to empty string
text += '<CENTER>'
text += '<TABLE BORDER=' + border + ' CELLSPACING=' + cellspacing + '>' // table settings
text += '<TH COLSPAN=7 HEIGHT=' + headerHeight + '>' // create table header cell
text += '<FONT COLOR="' + headerColor + '" SIZE=' + headerSize + '>' // set font for table header
text += monthName + ' ' + year
text += '</FONT>' // close table header's font settings
text += '</TH>' // close header cell
// variables to hold constant settings
var openCol = '<TD WIDTH=' + colWidth + ' HEIGHT=' + dayCellHeight + '>'
openCol += '<FONT COLOR="' + dayColor + '">'
var closeCol = '</FONT></TD>'
// create array of abbreviated day names
var weekDay = new Array(7)
weekDay[0] = "Sun"
weekDay[1] = "Mon"
weekDay[2] = "Tues"
weekDay[3] = "Wed"
weekDay[4] = "Thu"
weekDay[5] = "Fri"
weekDay[6] = "Sat"
// create first row of table to set column width and specify week day
text += '<TR ALIGN="center" VALIGN="center">'
for (var dayNum = 0; dayNum < 7; ++dayNum) {
text += openCol + weekDay[dayNum] + closeCol
}
text += '</TR>'
// declaration and initialization of two variables to help with tables
var digit = 1
var curCell = 1
for (var row = 1; row <= Math.ceil((lastDate + firstDay - 1) / 7); ++row) {
text += '<TR ALIGN="right" VALIGN="top">'
for (var col = 1; col <= 7; ++col) {
if (digit > lastDate)
break
if (curCell < firstDay) {
text += '<TD></TD>';
curCell++
} else {
if (digit == date) { // current cell represent today's date
text += '<TD HEIGHT=' + cellHeight + '>'
text += '<FONT COLOR="' + todayColor + '">'
text += digit
text += '</FONT><BR>'
text += '<FONT COLOR="' + timeColor + '" SIZE=2>'
text += '<CENTER>' + getTime() + '</CENTER>'
text += '</FONT>'
text += '</TD>'
} else
text += '<TD HEIGHT=' + cellHeight + '>' + digit + '</TD>'
digit++
}
}
text += '</TR>'
}
// close all basic table tags
text += '</TABLE>'
text += '</CENTER>'
// print accumulative HTML string
document.write(text)
}
// -->
</SCRIPT>
<script language="JavaScript"><!--
var timerID = null;
var TimerRunning = false;
function stop(){
if(TimerRunning)
clearTimeout(timerID);
TimerRunning = false;
}
function display() {
var thedate = new Date();
var hours = thedate.getHours();
var Min = thedate.getMinutes();
var Sec = thedate.getSeconds();
var TimeV = "" + ((hours >12) ? hours -12 :hours)
TimeV += ((Min < 10) ? ":0" : ":") + Min
TimeV += ((Sec < 10) ? ":0" : ":") + Sec
TimeV += (hours >= 12) ? " P.M." : " A.M."
window.status = TimeV;
timerID = setTimeout("display()",1000);
TimerRunning = true;
}
function start() {
stop();
display();
}
start();
// end hide
// --></script>
-----------------------------------
ساعة في شريط العنوان
كود:
<SCRIPT Language="JavaScript">
<!-- Hide
var scroller;
var ampm;
var actualtitle=document.title+" "
function antiMilitaryTime()
{
if (hr == "12"){
ampm="P.M."
}
else if (hr == "13"){
hr="1"
ampm="P.M."
}
else if (hr == "14"){
hr="2"
ampm="P.M."
}
else if (hr == "15"){
hr ="3"
ampm="P.M."
}
else if (hr == "16"){
hr = "4"
ampm="P.M."
}
else if (hr == "17"){
hr = "5"
ampm="P.M."
}
else if (hr == "18"){
hr = "6"
ampm="P.M."
}
else if (hr == "19"){
hr = "7"
ampm="P.M."
}
else if (hr == "20"){
hr = "8"
ampm="P.M."
}
else if (hr == "21"){
hr = "9"
ampm="P.M."
}
else if (hr == "22"){
hr = "10"
ampm="P.M."
}
else if (hr == "23"){
hr = "11"
ampm="P.M."
}
else if (hr == "24"){
hr = "12"
}
}
function addZero(){
if (min <= "9"){
min = "0"+min
}
if (sec<= "9"){
sec = "0"+sec
}
if (hr <="9"){
hr = "0"+hr
}
}
function time(){
dt=new Date()
sec=dt.getSeconds()
hr=dt.getHours()
ampm="A.M."
min=dt.getMinutes()
}
function scroll() {
time()
antiMilitaryTime()
addZero()
var scroller="TIME: "+hr+":"+min+":"+sec+" "+ampm
var timeout=setTimeout("scroll()", 1000)
document.title=actualtitle+scroller
}
if (document.all)
scroll()
//-->
</SCRIPT>
-------------------------------------------
الة حاسبة
كود:
<SCRIPT LANGUAGE=LiveScript><!-- Hide the script from browsers which do not support it.
// Global Variables
var acc = 0; // accumulator for calculations
var oper = " "; // the previous operation
var startnum = true; // is this a new number
var decpoint = false; // is there a decimal point
var errorstate = false; // an error has occured so lock keys until "AC" is pressed
// Global "Constants" (...)
MAXLEN = 14;
//
// IsNumeric - returns true if a string is a valid numeric literal
//
function IsNumeric(num) {
var idx = 0;
var ch = "";
var foundpoint = false;
for (idx = 0; idx < num.length; idx++) {
ch = num.substring(idx, idx +1 );
if ((ch < "0") || (ch > "9")) {
if ((ch == ".") && (!foundpoint)) {
foundpoint = true;
continue;
} else {
if ((ch == "-") && (idx == 0)) {
continue;
}
}
return false;
}
} // for idx
return true;
}
//
// ContainsChar - check if a string contains a certain char
//
function ContainsChar(str, ch) {
var idx;
for (idx = 0; idx < str.length; idx++) {
if (str.substring(idx, idx + 1) == ch) {
return true;
}
} // for idx
return false;
}
//
// ContainsDecimalPoint - check if a number string contains a decimal point
//
function ContainsDecimalPoint(num) {
return ContainsChar(num, ".");
}
//
// DisplayChanged - the display was explicitly changed, so check if it is valid
//
function DisplayChanged(form, display) {
if (!errorstate) {
if (IsNumeric(display.value)) {
display.defaultValue = display.value;
startnum = false;
decpoint = ContainsDecimalPoint(display.value);
} else {
alert("You must enter a numeric value here.");
display.value = display.defaultValue;
}
} else { // errorstate
alert('An error has occured. Press the "AC" button.');
}
}
//
// NumPressed - a digit button was pressed, add it to the current display
//
function NumPressed(form, digit) {
if (!errorstate) {
if ((digit !=0) || (form.display.value != "0")) {
if (startnum) { // need to put a new number on the display (e.g. after "=")
form.display.value = eval(digit);
} else {
if (form.display.value.length < MAXLEN) {
form.display.value = form.display.value + digit;
} // enough room to put new digit
} // add the digit
startnum = false;
form.display.defaultValue = form.display.value;
} // not trying to add leading zeros
} else { //errorstate
alert('An error has occured. Please press the "AC" button');
}
}
//
// ChangeSign - "+/-" button was pressed, change sign of current display
//
function ChangeSign(form) {
if (!errorstate) {
if (form.display.value != "0") {
if (eval(form.display.value) < 0) { // negative no problem
form.display.value = 0 - eval(form.display.value);
} else { // positive, make sure it's not too long
if (form.display.value.length < MAXLEN)
form.display.value = 0 - eval(form.display.value);
} // positive
form.display.defaultValue = form.display.value;
startnum = false;
} // not 0, can be negated
} else { // errorstate
alert('An error has occured. Please press the "AC" button');
}
}
//
// PointPressed - the decimal dot was pressed, add it to number and start putting disits after it
//
function PointPressed(form) {
if (!errorstate) {
if ((!decpoint) && (form.display.value.length < MAXLEN - 1)) {
form.display.value = form.display.value + ".";
form.display.defaultValue = form.display.value;
decpoint = true;
startnum = false;
} // decimal point not already present
} else { // errorstate
alert('An error has occured. Please press the "AC" button');
}
}
//
// ClearAll - "AC" button was pressed, restart the calculator
//
function ClearAll(display) {
display.value = "0";
display.defaultValue = "0";
decpoint = false;
acc = 0;
oper = " ";
startnum = true;
errorstate = false;
}
//
// ClearNum - "C" button was pressed, clear only current number on display
//
function ClearNum(display) {
if (!errorstate) {
display.value = "0";
display.defaultValue = "0";
decpoint = false;
startnum = true;
} else { // errorstate
alert('An error has occured. Please press the "AC" button');
}
}
//
// RemoveZeros - remove leading zeros after a decimal point from a number string
//
function RemoveZeros(num) {
var idx;
if (ContainsChar(num, ".")) {
idx = num.length - 1;
ch = num.substring(idx, idx + 1);
while((idx > 0) && (ch == "0")) {
idx--;
ch = num.substring(idx, idx + 1);
}
num = num.substring(0, idx + 1);
// get rid of a trailing decimal point, if it remained hanging after the torture ...
if (num.substring(num.length - 1, num.length) == ".") {
num = num.substring(0, num.length - 1)
}
} // num contains a decimal point
return num;
}
//
// CalcDisplay - calculate the new display using the accumulator and the previous operator
//
function CalcDisplay(display) {
if (oper == "+") {
display.value = acc + eval(display.value);
} else if (oper == "-") {
display.value = acc - eval(display.value);
} else if (oper == "*") {
display.value = acc * eval(display.value);
} else if (oper == "/") {
if (display.value == "0") {
display.value = "ERROR !"
errorstate = true;
} else {
display.value = acc / eval(display.value);
}
}
if (!errorstate) {
if ((eval(display.value) >= eval("1e" + MAXLEN)) || (eval(display.value) <= eval("-1e" + (MAXLEN - 1)))) {
display.value = "ERROR !";
errorstate = true;
} else {
if (!ContainsChar(display.value, "e")) { // not exponential format
if (display.value.length > MAXLEN) {
// number is in permited range, so extra digits are after decimal point
// truncate extra digits
display.value = display.value.substring(0, MAXLEN);
// get rid of a hanging decimal point
if (display.value.substring(MAXLEN - 1, MAXLEN) == ".") {
display.value = display.value.substring(0, MAXLEN - 1);
} else {
// get rid of trailing zeros
display.value = RemoveZeros(display.value);
}
} // string too long
} else { // exponential format
// Numbers smaller than 0.00001 are represented in exponential notation by the browser.
// A piece of code to translate them to fix notation should be put here.
// This is getting *much* too boring for me, so I leave it as is.
// If anyone has the will power to write it, I'll be glad to include it ...
} // exponential format
} // not too high or low
} // no error yet (division by zero)
display.defaultValue = display.value;
}
//
// OperPressed - calculate the new display and move it to the accumulator
//
function OperPressed(form, newoper) {
if (!errorstate) {
CalcDisplay(form.display);
oper = newoper;
acc = eval(form.display.value);
startnum = true;
decpoint = false;
} else { // errorstate
alert('An error has occured. Please press the "AC" button');
}
}
//
// CalcResult - the "=" button was pressed, put result on display
//
function CalcResult(form) {
if (!errorstate) {
CalcDisplay(form.display);
oper = " ";
acc = 0;
startnum = true;
decpoint = false;
} else { // errorstate
alert('An error has occured. Please press the "AC" button');
}
}
// End of hiding script from browsers which do not support it. --></SCRIPT>
<P> </P>
<P><FORM ACTION="" METHOD=POST>
<P><TABLE BORDER=2>
<TR>
<TD>
<P><INPUT TYPE=text NAME=display VALUE="0" SIZE=15 onchange="DisplayChanged(this.form, this.form.display)"></P>
</TD>
</TR>
<TR>
<TD>
<P><TABLE BORDER=1>
<TR>
<TD>
<P><INPUT TYPE=radio NAME=radio VALUE=value338414 CHECKED onclick="history.go(-1)"></P>
</TD>
<TD>
<P> </P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" C " onclick="ClearNum(this.form.display)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE="AC" onclick="ClearAll(this.form.display)"></P>
</TD>
</TR>
<TR>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 1 " onclick="NumPressed(this.form, 1)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 2 " onclick="NumPressed(this.form, 2)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 3 " onclick="NumPressed(this.form, 3)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" + " onclick='OperPressed(this.form, "+")'></P>
</TD>
</TR>
<TR>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 4 " onclick="NumPressed(this.form, 4)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 5 " onclick="NumPressed(this.form, 5)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 6 " onclick="NumPressed(this.form, 6)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" - " onclick='OperPressed(this.form, "-")'></P>
</TD>
</TR>
<TR>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 7 " onclick="NumPressed(this.form, 7)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 8 " onclick="NumPressed(this.form, 8)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 9 " onclick="NumPressed(this.form, 9)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" X " onclick='OperPressed(this.form, "*")'></P>
</TD>
</TR>
<TR>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE="+/-" onclick="ChangeSign(this.form)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" 0 " onclick="NumPressed(this.form, 0)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" . " onclick="PointPressed(this.form)"></P>
</TD>
<TD>
<P><INPUT TYPE=button NAME=Button VALUE=" / " onclick='OperPressed(this.form, "/")'></P>
</TD>
</TR>
<TR>
<TD COLSPAN=4>
<P><INPUT TYPE=button NAME=Button VALUE=" = " onclick="CalcResult(this.form)">
<SCRIPT LANGUAGE=LiveScript><!-- Hide the script from browsers which do not support it.
document.forms[0].display.value = "0";
document.forms[0].display.value = document.forms[0].display.defaultValue;
// End of hiding script from browsers which do not support it. --></SCRIPT><SCRIPT LANGUAGE=LiveScript><!-- Hide the script from browsers which do not support it.
document.forms[0].display.value = "0";
document.forms[0].display.value = document.forms[0].display.defaultValue;
// End of hiding script from browsers which do not support it. --></SCRIPT></P>
------------------------------------
الة حاسبة وتتميز هذه الالة بامكانية حساب النسبة المئوية
حاسبة الحب
للضحك فقط .. لا تأخذ هذا الكود بمحمل الجدّ
كود:
<script LANGUAGE="JavaScript">
function calc() {
first = document.loveform.name1.value.toUpperCase();
firstlength = document.loveform.name1.value.length;
second = document.loveform.name2.value.toUpperCase();
secondlength = document.loveform.name2.value.length;
var LoveCount=0;
for (Count=0; Count < firstlength; Count++) {
letter1=first.substring(Count,Count+1);
if (letter1=='L') LoveCount+=2;
if (letter1=='O') LoveCount+=2;
if (letter1=='V') LoveCount+=2;
if (letter1=='E') LoveCount+=2;
if (letter1=='Y') LoveCount+=3;
if (letter1=='O') LoveCount+=1;
if (letter1=='U') LoveCount+=3;
}
for (Count=0; Count < secondlength; Count++) {
letter2=second.substring(Count,Count+1);
if (letter2=='L') LoveCount+=2;
if (letter2=='O') LoveCount+=2;
if (letter2=='V') LoveCount+=2;
if (letter2=='E') LoveCount+=2;
if (letter2=='Y') LoveCount+=3;
if (letter2=='O') LoveCount+=1;
if (letter2=='U') LoveCount+=3;
}
amount=0;
if (LoveCount> 0) amount= 5-((firstlength+secondlength)/2)
if (LoveCount> 2) amount= 10-((firstlength+secondlength)/2)
if (LoveCount> 4) amount= 20-((firstlength+secondlength)/2)
if (LoveCount> 6) amount= 30-((firstlength+secondlength)/2)
if (LoveCount> 8) amount= 40-((firstlength+secondlength)/2)
if (LoveCount>10) amount= 50-((firstlength+secondlength)/2)
if (LoveCount>12) amount= 60-((firstlength+secondlength)/2)
if (LoveCount>14) amount= 70-((firstlength+secondlength)/2)
if (LoveCount>16) amount= 80-((firstlength+secondlength)/2)
if (LoveCount>18) amount= 90-((firstlength+secondlength)/2)
if (LoveCount>20) amount=100-((firstlength+secondlength)/2)
if (LoveCount>22) amount=110-((firstlength+secondlength)/2)
if (firstlength==0 || secondlength==0) amount= "Err";
if (amount < 0) amount= 0;
if (amount >99) amount=99;
document.loveform.output.value=amount+"%";
}
</script>
<center><table width=600 cellpadding=1 cellspacing=0 border=0><tr>
<td align=center valign=top>
</TD>
</TR></TABLE>
</CENTER>
<DIV align="center"><CENTER>
<P><STRONG>The love Test</p>
Test the love between two people by entering their names below and then calculate their compatibility.
<FORM name="loveform">
<P><INPUT value="Dear Daniel" name="name1" type="text" size="20"> + <INPUT
value="Hello Kitty" name="name2" type="text" size="20"> = <INPUT value name="output" type="text" size="6"> <BR>
<BR>
<INPUT value="Calculate!" name="calculate" type="button" value="calculate"
onclick="calc()"> </P>
</FORM>
</CENTER></DIV>
-------------------------------------------------
محول الوحدات
كود لقياس نتائج الاوزان والاطوال ودرجات الحرارة
بهذا الشكل <body> توضع هذه الجملة بين تنصيصتي
<body onload="setD()">
<body> يوضع هذا الكود في
كود:
<td width="100%" align="center"><form name="menu">
<CENTER><table cellpadding=3 border=1 bgcolor=#D2F0FF>
<tr><td>
<font face="Tahoma">
<input type=text size=7 name=result1><input type=text size=10 name=m1></font></td><td><font face="Tahoma"><input type=text size=7 name=result5><input type=text size=10 name=m5></font></td></tr><tr><td>
<font face="Tahoma">
<input type=text size=7 name=result2><input type=text size=10 name=m2></font></td><td><font face="Tahoma"><input type=text size=7 name=result6><input type=text size=10 name=m6></font></td></tr><tr><td>
<font face="Tahoma">
<input type=text size=7 name=result3><input type=text size=10 name=m3></font></td><td><font face="Tahoma"><input type=text size=7 name=result7><input type=text size=10 name=m7></font></td></tr><tr><td>
<font face="Tahoma">
<input type=text size=7 name=result4><input type=text size=10 name=m4></font></td><td><font face="Tahoma"><input type=text size=7 name=result8><input type=text size=10 name=m8></font></td></tr><tr><td>
<p align="center">
<font face="Tahoma"><input type="button" value="إحسب" onclick="checkUnit(this.form)"></font></p>
</td><td>
<p align="center"><font face="Tahoma"><input type=button value="إمسح" onclick="clearNumbers(this.form)"></font></p>
</td></tr>
</table>
</CENTER>
<center><font face="Tahoma" color="#FF0000">اختر الوحدة
المطلوبة</font>
<table border=1 cellpadding=2 bgcolor=#D2F0FF><tr><td>
<font face="Tahoma">
<input type="button" size=13 value="المسافات" onclick="setD()"></font></td><td>
<font face="Tahoma">
<input type="button" size=13 value="حجم الماء" onclick="setV()"></font></td><td>
<font face="Tahoma">
<input type="button" size=13 value="الاوزان" onclick="setW()"></font></td><td>
<font face="Tahoma">
<input type="button" size=13 value="درجة الحرارة" onclick="setT()"></font></td></tr></table>
</center>
</form>
<script>
function checkKey(form){
if (keyHit=="13") checkUnit(form)
}
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
document.onkeypress = getKey;
function getKey(keyStroke) {
keyHit = (isNav) ? keyStroke.which : event.keyCode;
checkKey()
}
function checkUnit(form){
if (document.menu.m1.value=="inches") getDistance(form)
if (document.menu.m2.value=="quart") getVolume(form)
if (document.menu.m2.value=="pound") getWeight(form)
if (document.menu.m1.value=="celcius") getTemperature(form)
var box
}
function getDistance(form){
var b1 = document.menu.result1.value
var b2 = document.menu.result2.value
var b3 = document.menu.result3.value
var b4 = document.menu.result4.value
var b5 = document.menu.result5.value
var b6 = document.menu.result6.value
var b7 = document.menu.result7.value
var b8 = document.menu.result8.value
var c1=b1/2; if (c1>0) box=c1*2
var c2=b2/2; if (c2>0) box=(c2*2)*12
var c3=b3/2; if (c3>0) box=(c3*2)*36
var c4=b4/2; if (c4>0) box=(c4*2)*12*5280
var c5=b5/2; if (c5>0) box=(c5*2)*.393598656/10
var c6=b6/2; if (c6>0) box=(c6*2)*.393598656
var c7=b7/2; if (c7>0) box=((c7*2)*100*.393598656)
var c8=b8/2; if (c8>0) box=((c8*2)*100000*.393598656)
document.menu.result1.value=Math.round((box)*100)/100
document.menu.result2.value=Math.round((box/12)*100)/100
document.menu.result3.value=Math.round((box/36)*100)/100
document.menu.result4.value=Math.round((box/12/5280)*10000)/10000
document.menu.result5.value=Math.round((box*2.540659081925*10)*10)/10
document.menu.result6.value=Math.round((box*2.540659081925)*100)/100
document.menu.result7.value=Math.round((box*2.540659081925/100)*100)/100
document.menu.result8.value=Math.round((box*2.540659081925/100000)*10000)/10000
}
function getWeight(form){
var b1 = document.menu.result1.value
var b2 = document.menu.result2.value
var b3 = document.menu.result3.value
var b4 = document.menu.result4.value
var b5 = document.menu.result5.value
var b6 = document.menu.result6.value
var b7 = document.menu.result7.value
var b8 = document.menu.result8.value
var c1=b1/2; if (c1>0) box=c1*2
var c2=b2/2; if (c2>0) box=(c2*2)*16
var c3=b3/2; if (c3>0) box=(c3*2)*16*2000
//var c3=O3/2; if (c3>0) box=(c3*2)*16*2000
var c5=b5/2; if (c5>0) box=(c5*2)*.035274
var c6=b6/2; if (c6>0) box=((c6*2)*1000)*.035274
var c7=b7/2; if (c7>0) box=(c7*2)*1000*1000*.035274
//var c3=O3/2; if (c3>0) box=(c3*2)*16*2000
document.menu.result1.value=Math.round((box)*100)/100
document.menu.result2.value=Math.round((box/16)*100)/100
document.menu.result3.value=Math.round(((box/16)/2000)*100)/100
document.menu.result4.value=" "
document.menu.result5.value=Math.round((box/.035274)*100)/100
document.menu.result6.value=Math.round(((box/.035274)/1000)*1000)/1000
document.menu.result7.value=Math.round(((box/.035274)/1000/1000)*100)/100
document.menu.result8.value=" "
}
function getVolume(form){
var b1 = document.menu.result1.value
var b2 = document.menu.result2.value
var b3 = document.menu.result3.value
var b4 = document.menu.result4.value
var b5 = document.menu.result5.value
var b6 = document.menu.result6.value
var b7 = document.menu.result7.value
var b8 = document.menu.result8.value
var c1=b1/2; if (c1>0) box=b1
var c2=b2/2; if (c2>0) box=b2*32
var c3=b3/2; if (c3>0) box=b3*128
//var c3=b4/2; if (c4>0) box=
var c5=b5/2; if (c5>0) box=b5/29.57375932164
var c6=b6/2; if (c6>0) box=(b6*1000)/29.57375932164
var c7=b7/2; if (c7>0) box=(b7*1000*1000)/29.57375932164
//var c3=b8/2; if (c3>0) box=
document.menu.result1.value=Math.round((box)*100)/100
document.menu.result2.value=Math.round((box/32)*100)/100
document.menu.result3.value=Math.round((box/128)*1000)/1000
document.menu.result4.value="US gallons"
document.menu.result5.value=Math.round((box*29.57375932164)*100)/100
document.menu.result6.value=Math.round((box*29.57375932164)/1000*100)/100
document.menu.result7.value=Math.round((box*29.57375932164)/1000000*1000)/1000
document.menu.result8.value=""
}
function getTemperature(form){
var FF=document.menu.result5.value
var CC=document.menu.result1.value
if (FF=="") var FF =Math.round((CC/5*9+32)*10)/10
else if (CC=="") var CC =Math.round(((FF-32)/9*5)*10)/10
document.menu.result1.value=CC
document.menu.result5.value=FF
}
function clearData(){
document.menu.result1.value=""
document.menu.result2.value=""
document.menu.result3.value=""
document.menu.result4.value=""
document.menu.result5.value=""
document.menu.result6.value=""
document.menu.result7.value=""
document.menu.result8.value=""
}
function setD(){
clearData()
document.menu.m1.value="inches"
document.menu.m2.value="feet"
document.menu.m3.value="yards"
document.menu.m4.value="miles"
document.menu.m5.value="millimeter"
document.menu.m6.value="centimeter"
document.menu.m7.value="meter"
document.menu.m8.value="kilometer"
}
function setT(){
clearData()
document.menu.m1.value="celcius"
document.menu.m2.value=""
document.menu.m3.value=""
document.menu.m4.value=""
document.menu.m5.value="fahrenheit"
document.menu.m6.value=""
document.menu.m7.value=""
document.menu.m8.value=""
}
function setV(){
clearData()
document.menu.m1.value="ounze"
document.menu.m2.value="quart"
document.menu.m3.value="gallon"
document.menu.m4.value=" "
document.menu.m5.value="millilitre"
document.menu.m6.value="litre"
document.menu.m7.value="kilolitre"
document.menu.m8.value=" "
}
function setW(){
clearData()
document.menu.m1.value="ounze"
document.menu.m2.value="pound"
document.menu.m3.value="ton"
document.menu.m4.value=" "
document.menu.m5.value="gram"
document.menu.m6.value="kilogram"
document.menu.m7.value="tonnes"
document.menu.m8.value=" "
}
function clearNumbers(form) {
document.menu.result1.value=""
document.menu.result2.value=""
document.menu.result3.value=""
document.menu.result4.value=""
document.menu.result5.value=""
document.menu.result6.value=""
document.menu.result7.value=""
document.menu.result8.value=""
}
//-->
</script>
</td>
---------------------------------------------
تاريخ وساعة
بهذا الشكل <body>توضع هذه الجملة بين تنصيصتي
كود:
<script>
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else
document.write(cdate)
}
if (!document.all)
getthedate()
function goforit(){
if (document.all)
setInterval("getthedate()",1000)
}
</script>
<span id="clock"></span>
----------------------------------------------
تاريخ عربي
كود:
<table>
<td width="55%" align="right" valign="top" colspan="3" bgcolor="#008000">
<p align="center"> <font face="Monotype Koufi" color="#FFFFFF"><!--webbot bot="HTMLMarkup"
startspan --> <p align="center"><b> <script>
<!-- START HIDE
print1="";
print2="";
print3="";
today = new Date();
weekday = today.getDay();
if (weekday == 6) print1='السبت';
if (weekday == 0) print1='الأحد';
if (weekday == 1) print1='الاثنين';
if (weekday == 2) print1='الثلاثاء';
if (weekday == 3) print1='الاربعاء';
if (weekday == 4) print1='الخميس';
if (weekday == 5) print1='الجمعة';
month = today.getMonth();
if (month == 0) print2='يناير';
if (month == 1) print2='فبراير';
if (month == 2) print2='مارس';
if (month == 3) print2='إبريل';
if (month == 4) print2='مايو';
if (month == 5) print2='يونيو';
if (month == 6) print2='يوليو';
if (month == 7) print2='اغسطس';
if (month == 8) print2='سبتمبر';
if (month == 9) print2='اكتوبر';
if (month == 10) print2='نوفمبر';
if (month == 11) print2='ديسمبر';
date = today.getDate();
year=today.getYear();
document.write (print1,',', date, ' ',print2,', ',year);
// STOP HIDE -->
</script>
</font></p>
</td>
</tr>
------------------------------------------- سكان العالم في تزايد مستمر
كود جميل ومثير لموقعك
بهذا الشكل <body>توضع هذه الجملة بين تنصيصتي
<BODY onload=maind()>
<body> انسخ ما يلي في
كود:
<BODY onload=maind()>
<SCRIPT language=JavaScript>
function maind()
{
startdate = new Date()
now(startdate.getYear(),startdate.getMonth(),startdate.getDate(),startdate.getHours(),startdate.getMinutes(),startdate.getSeconds())
}
function ChangeValue(number,pv)
{
numberstring =""
var j=0
var i=0
while (number > 1)
{
numberstring = (Math.round(number-0.5) % 10) + numberstring
number= number / 10
j++
if (number > 1 && j==3) {
numberstring = "." + numberstring
j=0}
i++
}
numberstring= " " + numberstring+",00"
if (pv==1) { document.schuld.schuld.value = numberstring }
if (pv==2) {document.newnow.newnow.value = numberstring}
}
function now(year,month,date,hours,minutes,seconds)
{
startdatum = new Date(year,month,date,hours,minutes,seconds)
var now = 5700000000.0
var now2 = 5790000000.0
var groeipercentage = (now2 - now) / now *100
var groeiperseconde = (now * (groeipercentage/100))/365.0/24.0/60.0/60.0
nu = new Date ()
schuldstartdatum = new Date (96,1,1)
secondenoppagina = (nu.getTime() - startdatum.getTime())/1000
totaleschuld= (nu.getTime() - schuldstartdatum.getTime())/1000*groeiperseconde + now
ChangeValue(totaleschuld,1);
ChangeValue(secondenoppagina*groeiperseconde,2);
timerID = setTimeout("now(startdatum.getYear(),startdatum.getMonth(),startdatum.getDate(),startdatum.getHours(),startdatum.getMinutes(),startdatum.getSeconds())",200)
}
</SCRIPT><CENTER><font face="Tahoma" color="#0000FF">سكان العالم في
تزايد مستمر<BR>
</font>
<FORM name=schuld><font face="Tahoma"><INPUT name=schuld size=25> </font> </FORM><font face="Tahoma"><BR><font color="#0000FF">عدد
اللذين ابصروا الدنيا منذ فتحك لهذه الصفحة<BR>
</font></font>
<FORM name=newnow><INPUT name=newnow size=25>
</FORM></CENTER>
<HR>
--------------------------------------- متى الولادة؟
ادخل او ادخلى البيانات الصحيحة بدقة
<head> انسخ التالي في
كود:
<SCRIPT LANGUAGE="JavaScript">
<!-- 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("إدخالـــك للتاريـــخ غيـــر صحيـــح")
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("........... طول المدة التي ادخلتها إما طويلة جدا او قصيرة جدا \n"
+ "لدقة اكثر يجب ان تخل ارقاما صحيحة ومعقولة حسب التفاوت المعطى .. \n"
+ " سنعطيك الفرصة لوضع ارقاما مناسبة .. اعد المحاولة");
}
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("........... طول المدة التي ادخلتها إما طويلة جدا او قصيرة جدا \n"
+ "لدقة اكثر يجب ان تخل ارقاما صحيحة ومعقولة حسب التفاوت المعطى .. \n"
+ "سنعطيك الفرصة لوضع ارقاما مناسبة .. اعد المحاولة");
}
// 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>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkInt(str) {
if (!str) return 0;
var ok = "";
for (var i = 0; i < str.length; i++) {
var ch = str.substring(i, i+1);
if (ch < "0" || "9" < ch) {
alert("Only integer input is allowed!\n\n"
+ parseInt(ok) + " will be used because '"
+ str + "' is invalid.\nYou may correct "
+ "this entry and try again.");
return parseInt(ok);
}
else ok += ch;
}
return parseInt(str);
}
function checkDecimal(str) {
if (!str) return 0;
var ok = "";
for (var i = 0; i < str.length; i++) {
var ch = str.substring(i, i+1);
if ((ch < "0" || "9" < ch) && ch != '.') {
alert("Only numeric input is allowed!\n\n"
+ parseFloat(ok) + " will be used because '"
+ str + "' is invalid.\nYou may correct "
+ "this entry and try again.");
return parseFloat(ok);
}
else ok += ch;
}
return str;
}
function makeHours(form) {
hour = (checkInt(form.hour.value)); // validates input
min = (checkInt(form.min.value)); // sets invalid input to 0
sec = (checkInt(form.sec.value));
return (hour + min/60 + sec/3600);
}
function makeTime(form) {
num = (checkDecimal(form.hourtotal.value)); // validates input
if (num) {
form.hour.value = parseInt(num);
num -= parseInt(num); num *= 60;
form.min.value = parseInt(num);
num -= parseInt(num); num *= 60;
form.sec.value = parseInt(num);
}
}
// End -->
</script>
هذا العداد يحسب عدد الايام التي مضت من حدث معين انت تحدد تاريخه والعداد يحسب
وغير ما يلزم <body> انسخ ما يلي في
كود:
<script>
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countup(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var paststring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1)
difference+=" يوما"
document.write("مضى "+difference+" على تدشين الموقع في الانترنت")
}
//year/month/dayادخل التاريخ المطلوب بالطريقة التالية
countup(2000,07,12)
</script>
ادخل التاريخ وعبارة المناسبة في الكود كما هو موضح
-----------------------------------------------------------
<table>
<td width="100%" align="center"><font face="Tahoma"> <script language="JavaScript1.2">
//configure the below five variables to change the style of the scroller
var scrollerwidth=150
var scrollerheight=90
var scrollerbgcolor='lightyellow'
//set below to '' if you don't wish to use a background image
var scrollerbackground='scrollerback.gif'
//configure the below variable to change the contents of the scroller
var messages=new Array()
messages[0]="<font face='tahoma'><a href='http://ضع عنوان الرابطة 0'>ضع جملة هنا</a></font>"
messages[1]="<font face='tahoma'><a href='http://ضع عنوان الرابطة 1'>ضع جملة هنا1</a></font>"
messages[2]="<font face='tahoma'><a href='http://ضع عنوان الرابطة 2'>ضع جملةهنا2</a></font>"
messages[3]="<font face='tahoma'><a href='http://ضع عنوان الرابطة 3'>ضع جملة 3هنا</a></font>"
messages[4]="<font face='tahoma'><a href='http://ضع عنوان الرابطة 4'>ضع جملة هنا4</a></font>"
///////Do not edit pass this line///////////////////////
if (messages.length>1)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",3000)
setTimeout("move2(document.main.document.second)",3000)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",100)
}
else{
tlayer.top=scrollerheight
tlayer.document.write(messages[i])
tlayer.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",3000)
setTimeout("move1(document.main.document.first)",3000)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(messages[i])
tlayer2.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",3000)
setTimeout("move4(second2)",3000)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",3000)
setTimeout("move3(first2)",3000)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
second2.style.visibility='visible'
}
else if (document.layers){
document.main.visibility='show'
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+5
document.main.document.second.visibility='show'
}
}
window.onload=startscroll
</script>
<ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; bgColor=&{scrollerbgcolor}; background="&{scrollerbackground};" tppabs="http://www.addlinkat.com/java/java-virtua-machine/&{scrollerbackground};" visibility=hide>
<layer id="first" left=0 top=1 width=&{scrollerwidth};>
<script language="JavaScript1.2">
if (document.layers)
document.write(messages[0])
</script>
</layer>
<layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide>
<script language="JavaScript1.2">
if (document.layers)
document.write(messages[1])
</script>
</layer>
</ilayer>
<script language="JavaScript1.2">
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
document.write(messages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0;visibility:hidden">')
document.write(messages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}
</script></font></td>
---------------------------------------------
يفتح هذا الكود الصفحة بكامل مساحة الشاشة
كود:
<script language="Javascript">
<!--
function OpenFull(where2) {
if (document.all) window.open(where2,"Full_Screen_Window","fullscreen=yes");
else alert("Sorry, but you can only open to FullScreen with Internet Explorer.");
}
//-->
</script>
<p align="center">
<font face="Tahoma" size="2"><a href="javascript:OpenFull('عنوان الصفحة');">إفتح النافذة بكامل مساحة الشاشة</a><br>
</font>
<p align="center">
<a href="javascript:window.close();"><font face="Tahoma" size="2">أغلق هذه النافذة</font></a></p>