// JavaScript Document;
/*
the scope of the variables is very important
*/
window.setInterval(settime, 100);
function settime() 
{
var time1=new Date();
var hours;
var minute;
var seconds;
var ampm;
if (time1.getHours() >12) {
hours= time1.getHours() -12;
ampm="pm"
}
else {

hours=time1.getHours();
ampm="am"
}
if (time1.getSeconds() <10) {
seconds= "0" + time1.getSeconds() ;
}
else {
seconds=time1.getSeconds();	
}
if (time1.getMinutes() <10) {
minutes= "0" + time1.getMinutes() ;
}
else {
minutes= time1.getMinutes();	
}
document.getElementById("timer").innerHTML=   hours + " " + minutes + "  " +    seconds + ampm ;
}
// the following lines for intialize window;
window.onload=copyright;
/* 
This two functions were used to appear and disapeear submenu
*/
function display(id, idd) {
	
		var par=id; var par2=idd;
		var hw1=document.getElementById(par);
	    var hw2=document.getElementById(par2);
	// this is a single line comment;
	/* This is multiple line comment
	note the double equal sings
	 */
		hw1.style.display="block";
		hw2.style.backgroundColor="saddlebrown";
		
			}
function disappear(id, idd) {
	    var par=id; var par2=idd;
		var hw1=document.getElementById(par);
	    var hw2=document.getElementById(par2);
	// this is a single line comment;
	/* This is multiple line comment
	note the double equal sings
	 */
		hw1.style.display="none";
		hw2.style.backgroundColor="saddlebrown";
		
	}
	function study() {
		var search1=document.getElementById("search0");
	alert(search1.value);
	}
	
// This function was used to compute the date;
function copyright(){
	
	  var d2= new Date();
	  var thisday=new Array("Sunday", "Monday", "Tuesday",
							"Wednesday", "Thursday", "Friday", "Saturday");
	  var thismonth=new Array("January", "Faburay", "March",
							"Aperal", "May", "June" , "July" , "August", "Septemper", 
							"October", "November", "December");
	  var copy=document.getElementById("copyright");
	  copy.innerHTML= "&copy" + "Dr. Mohamed Habashy Hussein" +" <br> " + thisday[d2.getDay()] + " " + d2.getUTCDate() + " " +  thismonth[d2.getMonth()] + " " + d2.getFullYear();
	    
	}
 

function bgcolor(id) {
	var par=id;
	var hw1=document.getElementById(par);
	hw1.style.backgroundColor="saddlebrown";
	
}
function removebgcolor(id) {
	var par=id;
	var hw1=document.getElementById(par);
	hw1.style.backgroundColor="";
	
}

