function clearout() {
  document.submitform.search.value='';
  document.submitform.search.style.color = "#000";
  document.submitform.search.style.fontSize = "10pt";
}

function takeYear(theDate) {
	x = theDate.getYear();
	var y = x % 100;
	y += (y < 38) ? 2000 : 1900;
	return y;
}



function SetDateRange(chrTime) {
   var thisdate = new Date();
   var toMonth = thisdate.getMonth()+1;
   var toDay = thisdate.getDate();
   var toYear = takeYear(thisdate);
   var thisTime = thisdate.getTime();
   
   if( chrTime == 'A' ) {
       thisTime = thisTime - 126144000000;  //  4 years ago
   }
   if( chrTime == 'H' ) {
       thisTime = thisTime - 15552000000;  //  6 months ago
   }
   if( chrTime == 'M' ) {
       thisTime = thisTime - 2592000000;  //  1 month ago
   }
   if( chrTime == 'W' ) {
       thisTime = thisTime - 604800000;  //  1 week ago
   }
   if( chrTime == 'D' ) {
       thisTime = thisTime - 86400000;  //  i day ago
   }
   
   thisdate.setTime(thisTime);
   var frMonth = thisdate.getMonth()+1;
   var frDay = thisdate.getDate();
   var frYear = takeYear(thisdate);
   
   window.document.tagcontrol.frommonth.options[0].text = frMonth;
   window.document.tagcontrol.frommonth.options[0].value = frMonth;
   window.document.tagcontrol.fromday.options[0].text = frDay;
   window.document.tagcontrol.fromday.options[0].value = frDay;
   window.document.tagcontrol.fromyear.options[0].text = frYear;
   window.document.tagcontrol.fromyear.options[0].value = frYear;

   window.document.tagcontrol.submit();

}

