// HTML Decode numerical and HTML entities back to original values
  function htmlDecode(s){

    var c,m,d = s;
    
    if(this.isEmpty(d)) return "";

    // convert HTML entites back to numerical entites first
    d = this.HTML2Numerical(d);
    
    // look for numerical entities &#34;
    arr=d.match(/&#[0-9]{1,5};/g);
    
    // if no matches found in string then skip
    if(arr!=null){
      for(var x=0;x<arr.length;x++){
        m = arr[x];
        c = m.substring(2,m.length-1); //get numeric part which is refernce to unicode character
        // if its a valid number we can decode
        if(c >= -32768 && c <= 65535){
          // decode every single match within string
          d = d.replace(m, String.fromCharCode(c));
        }else{
          d = d.replace(m, ""); //invalid so replace with nada
        }
      }     
    }

    return d;
  }
function getFuncs()
{
	initialize();
	init();
	return true;
}
function initialize()
  {
      /*
      The new 'validTags' setting is optional and allows
      you to specify other HTML elements that curvyCorners
      can attempt to round.

      The value is comma separated list of html elements
      in lowercase.

      validTags: [\"div\", \"form\"]

      The above example would enable curvyCorners on FORM elements.
      */
      settings = {
          tl: { radius: 10 },
          tr: { radius: 10 },
          bl: { radius: 10 },
          br: { radius: 10 },
          antiAlias: true,
          autoPad: true,
          validTags: ["div"]
      }

      /*
      Usage:

      newCornersObj = new curvyCorners(settingsObj, classNameStr);
      newCornersObj = new curvyCorners(settingsObj, divObj1[, divObj2[, divObj3[, . . . [, divObjN]]]]);
      */
      var myBoxObject = new curvyCorners(settings, "contentBox");
      myBoxObject.applyCornersToAll();
  }
  function isArray(item) {
	return (item.constructor == Array);
  }

  function formSubmit(f)
  {
	if(f == 'members'){
		document.forms[f].action = '/register/login';
	}else{
	    document.forms[f].action = '/committee/login';
	}
	document.forms[f].submit();
  }
  
  function newWindow(l, n, h, w)
  {
    var win = window.open(l,n,'menubar=no,status=no,toolbar=no,location=no,scrollbars=no,resizable=no,width='+w+',height='+h+',left=320,top=100');w.focus();return false;
  }
  
  function loadJPIE()
  {
    return void(0);
  }
  function init()
  {
	loadJPIE('default.jpg');
  GetMap('myMap');
  load();
  }
  function duplicateRow(row)
  {
    var line_1 = [];
    var line_2 = [];
    
    line_1[0] = 'rfq_'+row+'_single_double';
    line_2[0] = 'rfq_'+(row+1)+'_single_double';
    
    line_1[1] = 'rfq_'+row+'_single_queen';
    line_2[1] = 'rfq_'+(row+1)+'_single_queen';
    
    line_1[2] = 'rfq_'+row+'_single_king';
    line_2[2] = 'rfq_'+(row+1)+'_single_king';
    
    line_1[3] = 'rfq_'+row+'_double_twin';
    line_2[3] = 'rfq_'+(row+1)+'_double_twin';
 
    line_1[4] = 'rfq_'+row+'_double_twin_plus';
    line_2[4] = 'rfq_'+(row+1)+'_double_twin_plus';
    
    line_1[5] = 'rfq_'+row+'_double_double';
    line_2[5] = 'rfq_'+(row+1)+'_double_double';
    
    line_1[6] = 'rfq_'+row+'_double_queen';
    line_2[6] = 'rfq_'+(row+1)+'_double_queen';
    
    line_1[7] = 'rfq_'+row+'_double_king';
    line_2[7] = 'rfq_'+(row+1)+'_double_king';
 
    line_1[8] = 'rfq_'+row+'_rooms_wheelchair';
    line_2[8] = 'rfq_'+(row+1)+'_rooms_wheelchair';
 
    line_1[9] = 'rfq_'+row+'_children';
    line_2[9] = 'rfq_'+(row+1)+'_children'; 
    
    line_1[10] = 'rfq_'+row+'_adults';
    line_2[10] = 'rfq_'+(row+1)+'_adults'; 
    
    line_1[11] = 'rfq_'+row+'_seniors';
    line_2[11] = 'rfq_'+(row+1)+'_seniors'; 
     
    line_1[12] = 'rfq_'+row+'_requirements';
    line_2[12] = 'rfq_'+(row+1)+'_requirements';
    
    for (var i=0; i<line_1.length; i++) 
    {
       var field_1 = document.getElementById(line_1[i]);
       var field_2 = document.getElementById(line_2[i]);
       field_2.value = field_1.value;
    } 
  }
  function duplicateGeneric(row)
  {
    var line_1 = [];
    var line_2 = [];
    
    line_1[0] = 'rfq_'+row+'_arrival_time_hour';
    line_2[0] = 'rfq_'+(row+1)+'_arrival_time_hour';
    
    line_1[1] = 'rfq_'+row+'_arrival_time_minute';
    line_2[1] = 'rfq_'+(row+1)+'_arrival_time_minute';
    
    line_1[2] = 'rfq_'+row+'_arrival_time_ampm';
    line_2[2] = 'rfq_'+(row+1)+'_arrival_time_ampm';
    
    line_1[3] = 'rfq_'+row+'_departure_time_hour';
    line_2[3] = 'rfq_'+(row+1)+'_departure_time_hour';
    
    line_1[4] = 'rfq_'+row+'_departure_time_minute';
    line_2[4] = 'rfq_'+(row+1)+'_departure_time_minute';
    
    line_1[5] = 'rfq_'+row+'_departure_time_ampm';
    line_2[5] = 'rfq_'+(row+1)+'_departure_time_ampm';
    
    line_1[6] = 'rfq_'+row+'_children';
    line_2[6] = 'rfq_'+(row+1)+'_children'; 
    
    line_1[7] = 'rfq_'+row+'_adults';
    line_2[7] = 'rfq_'+(row+1)+'_adults'; 
    
    line_1[8] = 'rfq_'+row+'_seniors';
    line_2[8] = 'rfq_'+(row+1)+'_seniors'; 
     
    line_1[9] = 'rfq_'+row+'_requirements';
    line_2[9] = 'rfq_'+(row+1)+'_requirements';
    
    for (var i=0; i<line_1.length; i++) 
    {
       var field_1 = document.getElementById(line_1[i]);
       var field_2 = document.getElementById(line_2[i]);
       field_2.value = field_1.value;
    } 
}
  function duplicateAccommodation(row)
  {
    var line_1 = [];
    var line_2 = [];
    
    line_1[0] = 'entity_'+row+'_single_rate';
    line_2[0] = 'entity_'+(row+1)+'_single_rate';
    
    line_1[1] = 'entity_'+row+'_twin_rate';
    line_2[1] = 'entity_'+(row+1)+'_twin_rate';
    
    line_1[2] = 'entity_'+row+'_double_rate';
    line_2[2] = 'entity_'+(row+1)+'_double_rate';
    
    line_1[3] = 'entity_'+row+'_triple_rate';
    line_2[3] = 'entity_'+(row+1)+'_triple_rate';
    
    line_1[4] = 'entity_'+row+'_quad_rate';
    line_2[4] = 'entity_'+(row+1)+'_quad_rate';
    
    line_1[5] = 'entity_'+row+'_additional_notes';
    line_2[5] = 'entity_'+(row+1)+'_additional_notes';
    
    for (var i=0; i<line_1.length; i++) 
    {
       var field_1 = document.getElementById(line_1[i]);
       var field_2 = document.getElementById(line_2[i]);
       field_2.value = field_1.value;
    } 
  }
function duplicatePricing(row)
  {
    var line_1 = [];
    var line_2 = [];
    
    line_1[0] = 'entity_'+row+'_children_rate';
    line_2[0] = 'entity_'+(row+1)+'_children_rate';
    
    line_1[1] = 'entity_'+row+'_adult_rate';
    line_2[1] = 'entity_'+(row+1)+'_adult_rate';
    
    line_1[2] = 'entity_'+row+'_senior_rate';
    line_2[2] = 'entity_'+(row+1)+'_senior_rate';
    
    for (var i=0; i<line_1.length; i++) 
    {
       var field_1 = document.getElementById(line_1[i]);
       var field_2 = document.getElementById(line_2[i]);
       field_2.value = field_1.value;
    } 
  }


