// functions to help display div based on select choices
function wordwrap(str,len) {
   var counter=0;
   var val = "";
   for(z=0;z<str.length;z++) {     
      val = val + str.charAt(z);
      if(str.charAt(z) == " ") counter = 0;
      else if(counter++ >= len) {
         counter = 0;
         val = val + " ";
      }
   }
   return val;         
}

function getNewCountry() {
   var governingLawCountry = "USA";
   var index = getObject('countrysel').selectedIndex;
   if(getObject('countrysel').options[index].text == "Canada")
      governingLawCountry = "Canada";
   return governingLawCountry;
}

function getCountry() {
   var governingLawCountry = "USA";
   for(i=0;i<getObject('countrysel').length;i++) {
      if(getObject('countrysel').options[i].text.toUpperCase() == "USA")
         governingLawCountry = "Canada";
   }
   return governingLawCountry;
}


function displayHintDiv() {
   setVisDisp("hintDiv", getFormObject("assigninterest","hintDisplay").checked);   
}

function checkVars() {
   var checkVarsReturn = true;
   return checkVarsReturn;
}

       
function divdisplay() {
   displayHintDiv();
   setVisDisp('governingLawWarning',getFormObject('assigninterest','governingLawState').value == 'LA' || getFormObject('assigninterest','governingLawState').value == 'QC');

   for(i=1;i<=10;i++)
      setVisDisp('partner'+i+'Box', i<=getObject('numberOfPartners').value);

   for(i=1;i<=5;i++)
      setVisDisp('additionalClause'+i+'Box',i<=getObject('numberOfClauses').value);

   setVisDisp('specificDateBox',getObject('executionDate').value == "specifyDate");
   setVisDisp('remainingParntersBox',getObject('fullPartnerTrue').checked);
}

function setCurrency() {
   getFormObject('assigninterest','governingLawState').selectedIndex = 0;
   getObject('currencyNation').value = 0;
   if(getNewCountry() == "Canada")
      getObject('currencyNation').value = 1;
}
