/*aws script*/

function AWSrsw(x)
{
  var marker = x.firstChild;
  var dd_array = x.parentNode.parentNode.getElementsByTagName('dd');

  for (var i = 0; i < dd_array.length; i++){
    var dd = dd_array.item(i);

    if(marker.data == '-'){
      dd.style.display = 'none';
    }else{
      dd.style.display = 'block';
    }
  }

  if(marker.data == '-'){
    marker.data = '+';
  }else{
    marker.data = '-';
  }
}

function AWS_encode_query(f)
{
  q = f.searchWord.value;
  f.KeywordSearch.value = AWS_encodeURL(q);
  f.searchWord.value='';
  return true;
}

function AWS_encodeURL(str)
{
  var res, i, c;

  res = '';

  for(i = 0; i < str.length; i++){
    c = str.charCodeAt(i);
    if ((c >= 0x0001) && (c <= 0x007F)) {
      res += str.charAt(i);
    }else if(c > 0x07FF){
      res += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
      res += String.fromCharCode(0x80 | ((c >>  6) & 0x3F));
      res += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
    }else{
      res += String.fromCharCode(0xC0 | ((c >>  6) & 0x1F));
      res += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
    }
  }
  return AWS_escape(res);
}

function AWS_hex(n, len)
{
  var res, i;
  res = '';

  for(i = 0; i < len; i++) {
    res = "0123456789abcdef".charAt(n & 0xf) + res;
    n = n >> 4;
  }
  return res;
}

function AWS_escape(str)
{
  var res, i, c;

  if(navigator.appName != 'Microsoft Internet Explorer'){
    return str.replace(/[^.0-9A-Z_a-z-]/g, function(s) {
      c = s.charCodeAt(0);
      if(c < 256)
        return '%' + AWS_hex(c, 2);
      return '%u' + AWS_hex(c, 4);
    });
  }

  res = '';
  for(i = 0; i < str.length; i++){
    c = str.charAt(i);
    if(c.match(/[^.0-9A-Z_a-z-]/)) {
      c = str.charCodeAt(i);
      if(c < 256){
        res += '%' + AWS_hex(c, 2);
      }else{
        res += '%u' + AWS_hex(c, 4);
      }
    }else{
      res += c;
    }
  }
  return res;
}