// JavaScript Document
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

function show(id)
{
	document.getElementById(id).style.display='';
}

function hide(id)
{
	document.getElementById(id).style.display='none';
}


function startclock()
{
  var thetime = new Date();
  
  var nhours=thetime.getHours();
  var nmins=thetime.getMinutes();
	var nday=thetime.getDay();
	var nmonth=thetime.getMonth();
	var ntoday=thetime.getDate();
  var AorP=" ";
  
  if (nhours>=12)
      AorP="pm";
  else
      AorP="am";
  
  if (nhours>=13)
      nhours-=12;
  
  if (nhours==0)
   nhours=12;
  
  if (nmins<10)
   nmins="0"+nmins;
	 
	if (nday==0)
    nday="Sun";
  if (nday==1)
    nday="Mon";
  if (nday==2)
    nday="Tue";
  if (nday==3)
    nday="Wed";
  if (nday==4)
    nday="Thu";
  if (nday==5)
    nday="Fri";
  if (nday==6)
    nday="Sat";

	nmonth+=1;
	
	if (nmonth==1)
    nmonth="Jan";
  if (nmonth==2)
    nmonth="Feb";
  if (nmonth==3)
    nmonth="Mar";
  if (nmonth==4)
    nmonth="Apr";
  if (nmonth==5)
    nmonth="May";
  if (nmonth==6)
    nmonth="Jun";
  if (nmonth==7)
    nmonth="Jul";
	if (nmonth==8)
    nmonth="Aug";
	if (nmonth==9)
    nmonth="Sep";
	if (nmonth==10)
    nmonth="Oct";
	if (nmonth==11)
    nmonth="Nov";
	if (nmonth==12)
    nmonth="Dec";
  
	if (document.getElementById('currenttime')) {
    document.getElementById('currenttime').innerHTML = nday+", "+nmonth+" "+ntoday+", "+nhours+":"+nmins+AorP;
    setTimeout('startclock()',10000);
	}
} 



function popUpAny(URL, w, h) {
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=1,resizable, location=0, toolbar=0';
  eval("page = window.open(URL, 'any', settings)");
}

function highlight_topnav(on, elem) {
	button = document.getElementById(elem);
	if (on) {
		button.style.backgroundImage = "url(/images/button_on.gif)";
	} else {
		button.style.backgroundImage = "url(/images/button_off.gif)";
	}
}

function removeLeadingAndTrailingChar(inputString, removeChar) 
{
	var returnString = inputString;
	if (removeChar.length)
	{
		while(''+returnString.charAt(0)==removeChar)
		{
		  returnString=returnString.substring(1,returnString.length);
		}
		while(''+returnString.charAt(returnString.length-1)==removeChar)
		{
			returnString=returnString.substring(0,returnString.length-1);
		}
	}
	return returnString;
}

function removeExtraSpaces(string, delimiter)
{

	var returnString = "";
	splitstring = string.split(delimiter);
	for(i = 0; i < splitstring.length; i++)
	{
		if (splitstring[i]!="") returnString += splitstring[i] + delimiter;
	}
	return returnString;
}

function replaceCharacters(conversionString,inChar,outChar)
{
  var convertedString = conversionString.split(inChar);
  convertedString = convertedString.join(outChar);
  return convertedString;
}

function go_next(obj,len,nid)
{
  objlength=document.all?parseInt(obj.value.length):(parseInt(obj.value.length)+1)
  if(objlength==len)
  {
	eval("document.frmaddemp."+nid+".focus()");   
  } 
  return true;
}

function go_next1(obj,len,nid)
{
  objlength=document.all?parseInt(obj.value.length):(parseInt(obj.value.length)+1)
  if(objlength==len)
  {
	eval("document.frmeditemp."+nid+".focus()");   
  } 
  return true;
}

function go_nextR(obj,len,nid)
{ 
  objlength=document.all?parseInt(obj.value.length):(parseInt(obj.value.length)+1)
  if(objlength==len)
  {
	eval("document.frmregistration."+nid+".focus()");   
  } 
  return true;
}
function go_next21(obj,len,nid)
{
  objlength=document.all?parseInt(obj.value.length):(parseInt(obj.value.length)+1)
  if(objlength==len)
  {
	eval("document.addmultipleemp."+nid+".focus()");   
  } 
  return true;
}
