function goPrev(){

  var re = /([^\|]+)/g;
  pathForms = ssData.path.match(re);

  if (ssData.pathIdx != 0)
	ssData.pathIdx--;
  
  prevForm = pathForms[ssData.pathIdx]

  document.forms.VCForm.action = prevForm;
  upDate();
  document.forms.VCForm.submit();
}


function goNext(){

  if (fieldsValid(document.VCForm)){
    var re = /([^\|]+)/g;
    pathForms = ssData.path.match(re);
  
    ssData.pathIdx++;
 
    nextForm = pathForms[ssData.pathIdx]
    document.forms.VCForm.action = nextForm;

    upDate();
    //SetHidden();
    document.forms.VCForm.submit();
  }
}


function HTMLEncode(text){
  text = text +"";
  text = text.replace(/&/g ,"&amp;" );
  text = text.replace(/"/g ,"&#34;" );
  text = text.replace(/>/g ,"&#62;" );
  text = text.replace(/</g ,"&#60;" );
  text = text.replace(/\\/g ,"&#92;" );
  return text;
}

function upDate(){
  lastChance();
  ssOut ="";

  for (prop in ssData){
	//alert("ssData : " + ssData[prop]);
    ssOut = ssOut + prop + ': "' + ssData[prop] + '" , ';
  }
  ssOut =ssOut.substring(0, ssOut.length -3);

   //alert("ssOut = " + ssOut);

  document.forms.VCForm.ssData.value = ssOut;

}