
function StartScrolling(){
    // Make sure the clock is stopped
    StopTheClock()

    // Pick the first message at random
    PickRandomMessage()

    // Off we go...
    DoTheScroll()
}

function StopTheClock(){
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function DoTheScroll(){
    if (pos <= msg.length)
        self.status = msg.substring(pos, msg.length);
    else{
        PickRandomMessage()
        pos=-1
    }
    ++pos
    timerRunning = true
    timerID = self.setTimeout("DoTheScroll()", delay)
}

function PickRandomMessage(){
    // Use the time (i.e., seconds) to get a random number
    var d = new Date()
    var secs = d.getSeconds()
    var rnd = (secs % messages.length) + 1
    msg = messages[rnd]

    // Pad the message with spaces to get the "start" position
    for (var i = 0; i < startPos; i++) msg = " " + msg
}

function BuildArray(size){
    this.length = size
    for (var i = 1; i <= size; i++){
        this[i] = null}
    return this
}


// *********************************************************************
// ajax
function loadurl(dest) {
 
 try {
  
   // Moz supports XMLHttpRequest. IE uses ActiveX. 
   // browser detction is bad. object detection works for any browser
   xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
  new ActiveXObject("Microsoft.XMLHTTP");
  
 }
 catch (e) {
   // browser doesn't support ajax. handle however you want
 }
 
 // the xmlhttp object triggers an event everytime the status changes
 // triggered() function handles the events
 xmlhttp.onreadystatechange = triggered;
 
 // open takes in the HTTP method and url.
 xmlhttp.open("GET", dest);
 
 // send the request. if this is a POST request we would have
 // sent post variables: send("name=aleem&gender=male)
 // Moz is fine with just send(); but
 // IE expects a value here, hence we do send(null);
 xmlhttp.send(null);
 
}

function triggered() {
 
  // if the readyState code is 4 (Completed)
  // and http status is 200 (OK) we go ahead and get the responseText
  // other readyState codes:
  // 0=Uninitialised 1=Loading 2=Loaded 3=Interactive
  if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
  
      // xmlhttp.responseText object contains the response.
      document.getElementById("Dic").innerHTML =
  xmlhttp.responseText;
   }

}

function execd()
{
	a = document.getElementById("word").value
	loadurl('/Dictionery?Lan=EN&w=' + a);
}
// ********************************************************************
var clear=0;
function clearfirst()
{
	if (clear==0)
	{
		clear=1;
		document.all['BeforSchoolid'].value='';
	}
	
}