
function loadPage(list) 
{
    var url;
    url = list.options[list.selectedIndex].value;
    window.open(url, name);
}


/****** Scrolling Status Bar *******/

var scrlStr = "Welcome to Complaint Monitoring Tool at Lokayukta Office, Haryana !"
var width=100;
var strLen=scrlStr.length;
var pos=1-width;                

function type()
{
    var type = "";                
    pos++;                          
    if(pos==strLen)              

       pos=1-width;            

    if(pos<0)
      {                   
       for(var i=1;i<=Math.abs(pos);i++)
       type=type+"";  
       type=type+scrlStr.substring(0,width-i+1);
      }
    else
       type=type+scrlStr.substring(pos,pos+width);
       window.status=type;         
      setTimeout("type()",15);
 }


/******** Date and Digital Clock ********/

function displayDate()  
{ 
	                var today = new Date()
			var weekday = today.getDay()
			
			if (weekday == 0){weekday = "Sunday"}
			if (weekday == 1){weekday = "Monday"}
			if (weekday == 2){weekday = "Tuesday"}
			if (weekday == 3){weekday = "Wednesday"}
			if (weekday == 4){weekday = "Thursday"}
			if (weekday == 5){weekday = "Friday"}
			if (weekday == 6){weekday = "Saturday"}
			var month = today.getMonth()
			if (month == 0){month = "January"}
			if (month == 1){month = "February"}
			if (month == 2){month = "March"}
			if (month == 3){month = "April"}
			if (month == 4){month = "May"}
			if (month == 5){month = "June"}
			if (month == 6){month = "July"}
			if (month == 7){month = "August"}
			if (month == 8){month = "September"}
			if (month == 9){month = "October"}
			if (month == 10){month = "November"}
			if (month == 11){month = "December"}
			year = today.getYear()
			numweekday = today.getDate()
			document.write(weekday + ", " + numweekday + " " + month + " " + year)

}

  var timerID = null;
  var timerRunning = false;


  function stopclock ()
  {
    if(timerRunning)
      clearTimeout(timerID);
    timerRunning = false;
  }

  function showtime () 
  {
    var now = new Date();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();

    var timeValue = "" + ((hours >12) ? hours -12 :hours);
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
    timeValue += (hours >= 12) ? " P.M." : " A.M.";
    document.clock.face.value =timeValue


    timerID = setTimeout("showtime()",1000);
    timerRunning = true;
  }

  function startclock () 
  {
    // Make sure the clock is stopped
    stopclock();
    showtime();
  }