Тема: Скрипт
Показать сообщение отдельно

  #7  
Старый 25.07.2008, 20:27
InfernoNet
Banned
Регистрация: 07.11.2007
Сообщений: 301
С нами: 9741926

Репутация: 595
По умолчанию

Код:
<html>
<head>
<title>WOweb.ru - Scripts - JavaScript - Until...</title>
<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
 <Style>
   A:Link{ Color: #000000; Text-decoration: underline}
   A:Visited{ Color: #000000; Text-decoration: underline}
   A:Hover{ Color: #000000; Text-decoration: none}
 td, body {font-family: verdana, arial, helvetica; font-size:11px;}  
 </Style>

<!-- HEAD START HERE -->



<!-- HEAD END HERE -->




</head>
<body bgcolor="#EDEDED" text="#000000" link="#000000" topmargin="0" leftmargin="0">
<center>

<!-- BODY START HERE -->

 <script language="JavaScript"> 
 
 <!-- 
 function myFunction1(){ 
 if (date<=myDate) month1=12-(month-myMonth); 
 else month1=11-(month-myMonth); 
 } 
 function myFunction2(){ 
 if (date>myDate) month1=(myMonth-month-1); 
 else month1=(myMonth-month); 
 } 
 function myFunction3(){ 
 if (date<=myDate) month1=0; 
 else month1=11; 
 } 
 
 function myFunction4(){ 
 if (month==2) date1=(28-date+myDate); 
 if (month==4) date1=(30-date+myDate); 
 if (month==6) date1=(30-date+myDate); 
 if (month==9) date1=(30-date+myDate); 
 if (month==11) date1=(30-date+myDate); 
 if (month==1) date1=(31-date+myDate); 
 if (month==3) date1=(31-date+myDate); 
 if (month==5) date1=(31-date+myDate); 
 if (month==7) date1=(31-date+myDate); 
 if (month==8) date1=(31-date+myDate); 
 if (month==10) date1=(31-date+myDate); 
 if (month==12) date1=(31-date+myDate); 
 } 
 
 var date=(new Date()).getDate(); 
 var month=(new Date()).getMonth()+1; 
 
 //Set Yuor Date. 
 var myDate=1 
 var myMonth=1 
 if (month>myMonth) myFunction1(); 
 if (month<myMonth) myFunction2(); 
 if (month==myMonth) myFunction3(); 
 
 if (date<=myDate) date1=(myDate-date); 
 if (date>myDate) myFunction4(); 
 
 if (month1==1) monthtxt=("month"); 
 if (month1>1 && month1<5) monthtxt=("months"); 
 if (month1>4) monthtxt=("monthes"); 
 
 if (date1==1, 21) datetxt=("day"); 
 if (date1>1 && date1<5) datetxt=("days"); 
 if (date1>21 && date1<25) datetxt=("days"); 
 if (date1>4 && date1<21) datetxt=("days"); 
 if (date1>24 && date1<31) datetxt=("days"); 
 
 var txt=("Осталось до 01.01.09"); 
 if (month1==0 && date1==0) txt=("My Birthday Today"); 
 
 document.write('<font color="black" size="2">'+txt+'</font><br>'); 
 
 if (month1>0) document.write('<font color="black" size="2">'+month1+" "+monthtxt+'</font>'); 
 else document.write(""); 
 
 if (date1>0) document.write('<font color="black" size="2"> '+date1+" "+datetxt+'</font>'); 
 else document.write(""); 
 
 // --> 
 </script> 
 

<!-- BODY END HERE -->



</body>
</html>
Параметры:
Код:
 var myDate=1 
 var myMonth=1
 
Ответить с цитированием