function Certify() {
popupWin = window.open('http://www.bbbonline.org/r2.cfm?ID=633000485', 'Participant','location,scrollbars,width=450,height=300')
window.name = 'opener';
}
function setCountry()
{
theForm = document.mainForm;
stateOBJ = theForm.state;
countryOBJ = theForm.country;
if(stateOBJ.selectedIndex > 53 && stateOBJ.selectedIndex < 66)
{
countryCode="CA";
}
else if(stateOBJ.selectedIndex > 66 && stateOBJ.selectedIndex < 76)
{
countryCode="AU";
}
else if(stateOBJ.selectedIndex > 0 && stateOBJ.selectedIndex < 53)
{
countryCode="US";
}
for(i=0;i<countryOBJ.options.length;i++)
{
if(countryOBJ.options[i].value == countryCode)
{
countryOBJ.options[i].selected = true;
}
}
}
function setState()
{
theForm = document.mainForm;
stateOBJ = theForm.state;
countryOBJ = theForm.country;
selectedCountry = countryOBJ.options[countryOBJ.selectedIndex].value;
if(selectedCountry == "US")
{
stateOBJ.options[0].selected = true;
}
else if(selectedCountry == "CA")
{
stateOBJ.options[53].selected = true;
}
else if(selectedCountry == "AU")
{
stateOBJ.options[66].selected = true;
}
else
{
stateOBJ.options[76].selected = true;
}
}
// 
// THIS IS THE DATABOX.js CODE
//
var today = new Date(new Date().valueOf());
function setDates()
{
// This will populate the date dropdowns with today and tomorrow's values.
theForm = document.mainForm;
var yearOffset = parseInt(theForm.inyear.options[0].value,10);
// getDate
var tomorrow = new Date(new Date().valueOf() + (24*60*60*1000));
var inMonth=tomorrow.getMonth();
var inDay=tomorrow.getDate();
var inYear=y2k(tomorrow.getYear());
if(isLeapYear(inYear)) { var days = new Array(31,29,31,30,31,30,31,31,30,31,30,31); }
else { var days = new Array(31,28,31,30,31,30,31,31,30,31,30,31); }
outMonth=inMonth;
outDay = inDay%days[inMonth];
outYear=inYear;
if(outDay == 0) { outMonth = (inMonth + 1) % 12; }
if(outDay == 0 && inMonth == 11) { outYear++; }
// Now set the select boxes to the appropriate dates:
theForm.inmonth.options[inMonth].selected=true;
theForm.inday.options[(inDay-1)].selected=true;
theForm.inyear.options[(inYear-yearOffset)].selected=true;
theForm.outmonth.options[outMonth].selected=true;
theForm.outday.options[outDay].selected=true;
theForm.outyear.options[(outYear-yearOffset)].selected=true;
}
// quadYear
function y2k(number){return (number < 1000) ? number + 1900 : number;}
function isLeapYear(yr)
{
if (((yr % 4 == 0) && (yr % 100 != 0)) || (yr % 400 == 0)) { return true; }
else { return false; } 
}
function changeDates()
{
theForm = document.mainForm;
var yearOffset = parseInt(theForm.inyear.options[0].value,10);
var inMonth=parseInt(theForm.inmonth.options[theForm.inmonth.selectedIndex].value,10)-1;
var inYear=parseInt(theForm.inyear.options[theForm.inyear.selectedIndex].value,10);
var baseMonth=today.getMonth();
var baseDay=today.getDate();
var baseYear=y2k(today.getYear());
if(isLeapYear(inYear)) { var days = new Array(31,29,31,30,31,30,31,31,30,31,30,31); }
else { var days = new Array(31,28,31,30,31,30,31,31,30,31,30,31); }
var inDay=parseInt(theForm.inday.options[theForm.inday.selectedIndex].value,10);
if(inDay >= days[inMonth]) { inDay = days[inMonth]; }
else { inDay = inDay%days[inMonth]; }
theForm.inday.options[inDay-1].selected=true;
/* This is causing problems with some people
if((inMonth < baseMonth) || (inMonth == baseMonth && inDay < baseDay))
{
theForm.inyear.options[((baseYear-yearOffset)+1)].selected=true;
inYear = baseYear+1;
}
*/
var currOutMonth = parseInt(theForm.outmonth.options[theForm.outmonth.selectedIndex].value,10)-1;
var currOutDay = parseInt(theForm.outday.options[theForm.outday.selectedIndex].value,10);
var currOutYear = parseInt(theForm.outyear.options[theForm.outyear.selectedIndex].value,10);
if((currOutYear < inYear) || (currOutYear == inYear && currOutMonth < inMonth) ||
(currOutYear == inYear && currOutMonth == inMonth && currOutDay <= inDay))
{
outMonth=inMonth;
outDay = inDay%days[inMonth];
outYear=inYear;
if(outDay == 0) { outMonth = (inMonth + 1) % 12; }
if(outDay == 0 && inMonth == 11) { outYear++; }
theForm.outmonth.options[outMonth].selected=true;
theForm.outday.options[outDay].selected=true;
theForm.outyear.options[(outYear-yearOffset)].selected=true;
}
}
function checkOutDate()
{
theForm = document.mainForm;
var yearOffset = parseInt(theForm.inyear.options[0].value,10);
var outMonth=parseInt(theForm.outmonth.options[theForm.outmonth.selectedIndex].value,10)-1;
var outYear=parseInt(theForm.outyear.options[theForm.outyear.selectedIndex].value,10);
if(isLeapYear(outYear)) { var days = new Array(31,29,31,30,31,30,31,31,30,31,30,31); }
else { var days = new Array(31,28,31,30,31,30,31,31,30,31,30,31); }
var outDay=parseInt(theForm.outday.options[theForm.outday.selectedIndex].value,10);
if(outDay >= days[outMonth]) { outDay = days[outMonth]; }
else { outDay = outDay%days[outMonth]; }
theForm.outday.options[outDay-1].selected=true;
}
// 
// THIS IS THE CALENDAR.js CODE
//
var isNav=false;if(parseInt(navigator.appVersion) >= 4) {if(navigator.appName == "Netscape"){isNav=true;}}else{isNav=true;}
var today = new Date(new Date().valueOf());var dateBoxPieceBlank = "    <td width=\"22\" height=\"18\" align=\"center\" valign=\"middle\" bgcolor=\"#FFFFFF\" class=\"calendar\">&nbsp;</td>";var dateBoxPiece = "    <td class=\"calendar\" width=\"22\" height=\"18\" align=\"center\" valign=\"middle\" onMouseOver=\"this.style.background = '#FFFF93';\" onMouseOut=\"this.style.background = '##BGCOLOR##';\" onClick=\"setDateBoxes('##DATESET##',##MONTH##,##DAY##,##YEAR##)\" bgcolor=\"##BGCOLOR##\">##DAY##</td>";
var baseDateBoxHeader = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"158\">\n";baseDateBoxHeader += "  <tr>\n";baseDateBoxHeader += "    <td colspan=\"7\" align=\"center\">\n";baseDateBoxHeader += "      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"158\">\n";baseDateBoxHeader += "        <tr>\n";baseDateBoxHeader += "          <td width=\"33%\" class=\"calendar\"><div name=\"back\" style=\"width: 15; border: 1 solid buttonface; border: 2 outset buttonhighlight; background-color: menu;\" align=\"center\" onMouseDown=\"this.style.border = '2 inset buttonhighlight'\" onMouseUp=\"this.style.border = '2 outset buttonhighlight'\" onClick=\"previousMonth('##DATESET##')\">&lt;</div></td>\n";baseDateBoxHeader += "          <td width=\"33%\" class=\"calendar\" nowrap><font face=\"Arial\" size=\"2\" color=\"#B92333\"><b>##MONTHNAME## ##YEAR##</b></font></td>\n";
baseDateBoxHeader += "          <td width=\"33%\" class=\"calendar\" align=\"right\"><div name=\"next\" style=\"width: 15; border: 1 solid buttonface; border: 2 outset buttonhighlight; background-color: menu;\" align=\"center\" onMouseDown=\"this.style.border = '2 inset buttonhighlight'\" onMouseUp=\"this.style.border = '2 outset buttonhighlight'\" onClick=\"nextMonth('##DATESET##')\">&gt;</div></td>\n";baseDateBoxHeader += "        </tr>\n";baseDateBoxHeader += "      </table>\n";baseDateBoxHeader += "    </td>\n";baseDateBoxHeader += "  </tr>\n";baseDateBoxHeader += "  <tr>\n";
baseDateBoxHeader += "    <td class=\"calendar\" bgcolor=\"#B92333\" align=\"center\"><font color=\"#FFFFFF\">S</font></td>\n";baseDateBoxHeader += "    <td class=\"calendar\" bgcolor=\"#B92333\" align=\"center\"><font color=\"#FFFFFF\">M</font></td>\n";baseDateBoxHeader += "    <td class=\"calendar\" bgcolor=\"#B92333\" align=\"center\"><font color=\"#FFFFFF\">T</font></td>\n";baseDateBoxHeader += "    <td class=\"calendar\" bgcolor=\"#B92333\" align=\"center\"><font color=\"#FFFFFF\">W</font></td>\n";baseDateBoxHeader += "    <td class=\"calendar\" bgcolor=\"#B92333\" align=\"center\"><font color=\"#FFFFFF\">T</font></td>\n";baseDateBoxHeader += "    <td class=\"calendar\" bgcolor=\"#B92333\" align=\"center\"><font color=\"#FFFFFF\">F</font></td>\n";
baseDateBoxHeader += "    <td class=\"calendar\" bgcolor=\"#B92333\" align=\"center\"><font color=\"#FFFFFF\">S</font></td>\n";baseDateBoxHeader += "  </tr>";
var dateBoxFooter = "  <tr>\n";dateBoxFooter += "    <td class=\"calendar\" colspan=\"7\" align=\"center\"><div name=\"close_btn\" style=\"width: 50; height: 15; border: 1 solid buttonface; border: 2 outset buttonhighlight; background-color: menu;\" align=\"center\" onMouseDown=\"this.style.border = '2 inset buttonhighlight'\" onMouseUp=\"this.style.border = '2 outset buttonhighlight'\" onClick=\"hideCalendar()\">Close</div></td>\n";dateBoxFooter += "  </tr>\n</table>\n";var calBuffer="";var caldays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
function isLeapYear(yr)
{  if (((yr % 4 == 0) && (yr % 100 != 0)) || (yr % 400 == 0)) { return true; }  else { return false; } }function GetDOW2(d,m,y){
var dt=new Date(y,m-1,d);  return(dt.getDay())%7;}var selectBoxFlag=false;var maxYear=0;var minYear=0;function displayCalendar(hideSelects,inDateSet){  selectBoxFlag=hideSelects;  if(isNav)  {    var calWinHndl = window.open("/auto/popup_calendar.cgi","calendar","scrollbars=yes,resizable=yes,width=500,height=275");    calWinHndl.focus();  }
else{theForm = document.mainForm; var inYear = theForm.inyear.options[theForm.inyear.selectedIndex].value;  theForm = document.mainForm;
var mon = parseInt(theForm.inmonth.options[theForm.inmonth.selectedIndex].value,10); var day = parseInt(theForm.inday.options[theForm.inday.selectedIndex].value,10);var year = parseInt(theForm.inyear.options[theForm.inyear.selectedIndex].value,10);currentMonth = mon;
currentYear = year;currentDay = day; maxYear = parseInt(theForm.inyear.options[(theForm.inyear.options.length-1)].value,10);minYear = parseInt(theForm.inyear.options[0].value,10);drawCalendarBody(inDateSet,mon,day,year);document.all.CAL.style.left = (event.x - event.offsetX);document.all.CAL.style.top = (event.y - event.offsetY);
document.all.CAL.style.visibility = "visible";if(hideSelects)
{if(document.all.mainForm.numrooms) { document.all.mainForm.numrooms.style.visibility = "hidden"; } if(document.all.mainForm.numadults) { document.all.mainForm.numadults.style.visibility = "hidden"; }     if(document.all.mainForm.bedpref) { document.all.mainForm.bedpref.style.visibility = "hidden"; } if(document.all.mainForm.smokingpref) { document.all.mainForm.smokingpref.style.visibility = "hidden"; }  if(document.all.mainForm.chainpref) {document.all.mainForm.chainpref.style.visibility = "hidden"; }if(inDateSet == "in"){
document.all.mainForm.outmonth.style.visibility = "hidden";document.all.mainForm.outday.style.visibility = "hidden";document.all.mainForm.outyear.style.visibility = "hidden";}}}}function hideCalendar(hideSelects)
{document.all.CAL.style.visibility = "hidden"; if(hideSelects || selectBoxFlag){    if(document.all.mainForm.numrooms) { document.all.mainForm.numrooms.style.visibility = "visible"; }    if(document.all.mainForm.numadults) { document.all.mainForm.numadults.style.visibility = "visible"; }    if(document.all.mainForm.bedpref) { document.all.mainForm.bedpref.style.visibility = "visible"; }
if(document.all.mainForm.smokingpref) { document.all.mainForm.smokingpref.style.visibility = "visible"; }    if(document.all.mainForm.chainpref) {document.all.mainForm.chainpref.style.visibility = "visible"; }  document.all.mainForm.outmonth.style.visibility = "visible";    document.all.mainForm.outday.style.visibility = "visible";    document.all.mainForm.outyear.style.visibility = "visible";    document.all.mainForm.inmonth.style.visibility = "visible";    document.all.mainForm.inday.style.visibility = "visible";    document.all.mainForm.inyear.style.visibility = "visible";}
}function nextMonth(inDateSet){currentMonth += 1;if(currentMonth > 12 && currentYear + 1 <= maxYear){currentMonth = 1;
currentYear++;}if(currentMonth > 12){currentMonth = 12;}if(currentMonth == (today.getMonth()+1) && currentYear == today.getYear()){drawCalendarBody(inDateSet,currentMonth,currentDay,currentYear);}
else{
drawCalendarBody(inDateSet,currentMonth,0,currentYear);}}function previousMonth(inDateSet){  if((currentMonth - 1) < (today.getMonth()+1) && currentYear <= today.getYear())  {
}else{currentMonth -= 1; if(currentMonth < 1 && currentYear - 1 >= minYear) {   currentMonth = 12;   currentYear -= 1;  }   if(currentMonth == (today.getMonth()+1) && currentYear == today.getYear())   { drawCalendarBody(inDateSet,currentMonth,currentDay,currentYear);  }  else
{drawCalendarBody(inDateSet,currentMonth,0,currentYear);}}}var currentMonth=1;var currentYear=2002;var currentDay=1;function drawCalendarBody(inDateSet,mon,day,year){
calObj = document.all.CAL_BODY;  theForm = document.mainForm;    var dowStartPos = GetDOW2(1,mon,year);  var finalDay = caldays[(mon-1)];  if(isLeapYear(year) && mon == 1) { finalDay += 1; }  re_MonthName = /##MONTHNAME##/g;  re_Year = /##YEAR##/g;  re_DateSet = /##DATESET##/g;
dateBoxHeader = baseDateBoxHeader;  dateBoxHeader = dateBoxHeader.replace(re_MonthName,months[(mon-1)]);  dateBoxHeader = dateBoxHeader.replace(re_Year,""+year);  dateBoxHeader = dateBoxHeader.replace(re_DateSet,""+inDateSet);  calBuffer = generateGrid(inDateSet,dowStartPos,finalDay, mon,day,year);  document.all.CAL_BODY.innerHTML = dateBoxHeader + calBuffer + dateBoxFooter;}function generateGrid(inDateSet,startPos,endPos, m,d,y){
var currentDay=1;  var gridCount=0;  var doBlanks=true;  var tmpBuffer="";  re_Month = /##MONTH##/g;  re_Day = /##DAY##/g;  re_Year = /##YEAR##/g;  re_BGColor = /##BGCOLOR##/g;  re_DateSet = /##DATESET##/g;  for(var i=0;i<6;i++)  {
tmpBuffer += "<tr>\n"; for(var j=0;j<7;j++)  {  if(gridCount < startPos || currentDay > endPos) { tmpBuffer += dateBoxPieceBlank + "\n";  }
else{pasrsedDBP = dateBoxPiece;   pasrsedDBP = pasrsedDBP.replace(re_Month,""+m);  pasrsedDBP = pasrsedDBP.replace(re_Day,""+currentDay);   pasrsedDBP = pasrsedDBP.replace(re_Year,""+y);   pasrsedDBP = pasrsedDBP.replace(re_DateSet,""+inDateSet);
if(currentDay == d) { pasrsedDBP = pasrsedDBP.replace(re_BGColor,"#BFC1FF"); } else { pasrsedDBP = pasrsedDBP.replace(re_BGColor,"#FFFFFF"); }tmpBuffer += pasrsedDBP + "\n";
currentDay++;}gridCount++;}tmpBuffer += "</tr>\n";} return tmpBuffer;}function setDateBoxes(whichDateSet,m,d,y){  theForm = document.mainForm;  eval("monthObj = theForm."+whichDateSet+"month;");  eval("dayObj = theForm."+whichDateSet+"day;");
eval("yearObj = theForm."+whichDateSet+"year;");  var yearOffset = parseInt(theForm.inyear.options[0].value,10);  monthObj.options[(m-1)].selected = true;  dayObj.options[(d-1)].selected = true;  yearObj.options[(y-yearOffset)].selected = true;changeDates();  hideCalendar();
}
