Autor: Thalleo | Publicado: 2011-10-09T06:20:00-07:00


<!------COMEÇA AQUI---------->

  
  
    
      
<!--

setCal()

function getTime() {
	// inicialização do relógio
	var now = new Date()
	var hour = now.getHours()
	var minute = now.getMinutes()
	now = null
	var ampm = "" 

	// valor das horas em AM e PM
	if (hour >= 12) {
		hour -= 12
		ampm = "PM"
	} else
		ampm = "AM"
	hour = (hour == 0) ? 12 : hour


	if (minute < 10)
		minute = "0" + minute 


	return hour + ":" + minute + " " + ampm
}

function leapYear(year) {
	if (year % 4 == 0) 
		return true

}

function getDays(month, year) {

	var ar = new Array(12)
	ar[0] = 31 // Janeiro
	ar[1] = (leapYear(year)) ? 29 : 28 // Fevereiro
	ar[2] = 31 // Março
	ar[3] = 30 // Abril
	ar[4] = 31 // Maio
	ar[5] = 30 // Junho
	ar[6] = 31 // Julho
	ar[7] = 31 // Agosto
	ar[8] = 30 // Setembro
	ar[9] = 31 // Outubro
	ar[10] = 30 // Novembro
	ar[11] = 31 // Dezembro


	return ar[month]
}

function getMonthName(month) {

	var ar = new Array(12)
	ar[0] = "Janeiro"
	ar[1] = "Fevereiro"
	ar[2] = "Março"
	ar[3] = "Abril"
	ar[4] = "Maio"
	ar[5] = "Junho"
	ar[6] = "Julho"
	ar[7] = "Agosto"
	ar[8] = "Setembro"
	ar[9] = "Outubro"
	ar[10] = "Novembro"
	ar[11] = "Dezembro"


	return ar[month]
}

function setCal() {

	var now = new Date()
	var year = now.getYear()
	var month = now.getMonth()
	var monthName = getMonthName(month)
	var date = now.getDate()
	now = null


	var firstDayInstance = new Date(year, month, 1)
	var firstDay = firstDayInstance.getDay()
	firstDayInstance = null


	var days = getDays(month, year)


      if (year <= 99) {
	drawCal(firstDay + 1, days, date, monthName, 1900 + year) }
      else { 
      drawCal(firstDay + 1, days, date, monthName, year) }
}

function drawCal(firstDay, lastDate, date, monthName, year) {

	var headerHeight = 0 
	var border = 0 
	var cellspacing = 1 
	var headerColor = "#1e90ff"
	var headerSize = "2" 
	var colWidth = 0 
	var dayCellHeight = 0 
	var dayColor = "#3366cc" 
	var cellHeight = 0 
	var todayCellColor = "#ffffff"  
	var todayColor = "#3366cc" 
	var timeColor = "#1e90ff" 


	var text = "" 
	text += ''
	text += '' 
	text += 	''
	text += 		''
	text += 			monthName + ' ' + year 
	text += 		''
	text += 	'' 


	var openCol = ''
	openCol += ''
	var closeCol = ''


	var weekDay = new Array(7)
	weekDay[0] = "Dom"
	weekDay[1] = "Seg"
	weekDay[2] = "Ter"
	weekDay[3] = "Qua"
	weekDay[4] = "Qui"
	weekDay[5] = "Sex"
	weekDay[6] = "Sab"
	

	text += ''
	for (var dayNum = 0; dayNum < 7; ++dayNum) {
		text += openCol + weekDay[dayNum] + closeCol 
	}
	text += ''
	

	var digit = 1
	var curCell = 1
	
	for (var row = 1; row <= Math.ceil((lastDate + firstDay - 1) / 7); ++row) {
		text += ''
		for (var col = 1; col <= 7; ++col) {
			if (digit > lastDate)
				break
			if (curCell < firstDay) {
				text += '';
				curCell++
			} else {
				if (digit == date) { 
					text += ''
					text += ''
					text += ''

					text += digit
					text += ''
					text += ''
					text += '' + getTime() + ''
					text += ''
					text += ''
				} else
					text += '' + digit + ''
				digit++
			}
		}
		text += ''
	}
	

	text += ''
	text += ''


	document.write(text) 
}

// -->
      
    
<!------TERMINA AQUI---------->



<!--



var your_message="Bem vindo"



var textfont="Verdana"



var textsize=12



var textcolor="000080"



var textboldness=7



var tempo=150



var stepx=18



var stepy=18



your_message=your_message+" "+prompt("Qual é o seu nome?", "seu nome")



var msg=new Array()



var msg=your_message



var message=msg.split("")



var numberofletters=msg.length-1



var x,y



var marginbottom



var marginleft=0



var margintop=0



var marginright



textboldness=textboldness*100



var timer



var xpos=new Array()



var ypos=new Array()



var spancontent=new Array()



&nbsp;



for (i=0;i<=numberofletters;i++) {



spancontent[i]=""+message[i]+""



}



&nbsp;



function setValues() {



if (document.all) {



marginbottom = document.body.clientHeight-5



marginright = document.body.clientWidth-5



for (i=0;i<=numberofletters;i++) {



xpos[i]=marginright-3



ypos[i]=marginbottom-3



var thisspan = eval("document.all.span"+i)



thisspan.innerHTML=spancontent[i]



var thisspan = eval("document.all.span"+(i)+".style")



thisspan.posLeft=marginright-3



thisspan.posTop=marginbottom-3



thisspan.visibility="visible"



}



moveball()



}



&nbsp;



if (document.layers) {



marginbottom = window.innerHeight-10



marginright = window.innerWidth-10



for (i=0;i<=numberofletters;i++) {



xpos[i]=marginright-3



ypos[i]=marginbottom-3



var thisspan=eval("document.span"+i+".document")



thisspan.write(spancontent[i])



thisspan.close()



var thisspan=eval("document.span"+i)



thisspan.left=marginright-3



thisspan.top=marginbottom-3



thisspan.visibility="visible"



}



moveball()



}



}



function randommaker(range) {



rand=Math.floor(range*Math.random())



return rand



}



function moveball() {



if (document.all) {



checkposition()



makesnake()



document.all.span0.style.posTop+=stepy



timer=setTimeout("moveball()",tempo)



}



if (document.layers) {



checkposition()



makesnake()



document.span0.top+=stepy



timer=setTimeout("moveball()",tempo)



}



}



function makesnake() {



for (i=numberofletters; i>=1; i--) {



xpos[i]=xpos[i-1]



ypos[i]=ypos[i-1]



}



if (document.all) {



xpos[0]=document.all.span0.style.posLeft+stepx



ypos[0]=document.all.span0.style.posTop+stepy



for (i=0;i<=numberofletters;i++) {



var thisspan=eval("document.all.span"+(i)+".style")



thisspan.posLeft=xpos[i]



thisspan.posTop=ypos[i]



&nbsp;



}



}



if (document.layers) {



xpos[0]=document.span0.left+stepx



ypos[0]=document.span0.top+stepy



for (i=0;i<=numberofletters;i++) {



var thisspan = eval("document.span"+i)



thisspan.left=xpos[i]



thisspan.top=ypos[i]



}



}



}



function checkposition() {



if (document.all) {



if (document.all.span0.style.posLeft>marginright) {



stepx=(stepx+randommaker(2))*-1



document.all.span0.style.posLeft-=1



}



if (document.all.span0.style.posLeft



stepx=(stepx+randommaker(2))*-1



document.all.span0.style.posLeft+=1



}



if (document.all.span0.style.posTop>marginbottom) {



stepy=(stepy+randommaker(2))*-1



document.all.span0.style.posTop-=1



}



if (document.all.span0.style.posTop



stepy=(stepy+randommaker(2))*-1



document.all.span0.style.posTop+=1



}



}



if (document.layers) {



if (document.span0.left>=marginright) {



stepx=(stepx+randommaker(2))*-1



document.span0.left-=10



}



if (document.span0.left<=marginleft) {



stepx=(stepx+randommaker(2))*-1



document.span0.left+=10



}



if (document.span0.top>=marginbottom) {



stepy=(stepy+randommaker(2))*-1



document.span0.top-=10



}



if (document.span0.top<=margintop) {



stepy=(stepy+randommaker(2))*-1



document.span0.top+=10



}



}



}



// -->










<!--&nbsp;



for (i=0;i<=numberofletters;i++) {



document.write("")



document.close()



}



// -->