function search_google( query )
{
   query.q.value = query.qfront.value + " site:qcnmg.net";
}

function print_todays_date()
{
   var d = new Date();

   document.write(d.toLocaleDateString());
}

function print_current_time()
{
   var d = new Date();
   var meridiem = "";
   var hours = d.getHours();
   var minutes = d.getMinutes();
   var seconds = d.getSeconds();

   /* prepend single digit hours with a 0 */
   if ((hours % 10) == hours)
      hours = "0" + hours;

   /* convert military hours to regular hours */
   if (hours > 12)
   {
      hours %= 12;
      meridiem = '<acronym title = "Post Meridiem">PM<\/a>';
   }
   else
      meridiem = '<acronym title = "Ante Meridiem">AM<\/a>';

   document.write(hours);
   
   /* if the following is true, then minutes is only 1 digit */
   if ((minutes % 10) == minutes )
      document.write(":" + "0" + minutes + ":");
   else
      document.write(":" + minutes + ":");

   /* if the following is true, then seconds is only 1 digit */
   if ((seconds % 10) == seconds )
      document.write("0" + seconds + " " + meridiem);
   else
      document.write(seconds + " " + meridiem);
}

function print_last_modified()
{
   document.write(document.lastModified);
}

function clear_initial_value(content)
{
   if (content.value == content.defaultValue)
      content.value = ""
}

var ap_instances = new Array();

function ap_stopAll(playerID) {
	for(var i = 0;i<ap_instances.length;i++) {
		try {
			if(ap_instances[i] != playerID) document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 1);
			else document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 0);
		} catch( errorObject ) {
			// stop any errors
		}
	}
}

function ap_registerPlayers() {
	var objectID;
	var objectTags = document.getElementsByTagName("object");
	for(var i=0;i<objectTags.length;i++) {
		objectID = objectTags[i].id;
		if(objectID.indexOf("audioplayer") == 0) {
			ap_instances[i] = objectID.substring(11, objectID.length);
		}
	}
}

var ap_clearID = setInterval( ap_registerPlayers, 100 );

