/**
JS function supporting Japan static code
*/

 

//Add a search box to the HTML files
(function() {
 //"function" is the div tag id where bread crumb is placed.
 var functionDiv = document.getElementById("function");
 var vap = document.domain;
 if(vap.indexOf('protiviti.jp')>-1)
  vap = 'www.protiviti.com';
    var searchHtml = '<span class="search" valign="top">'+
  '<form action="http://www.protiviti.com/portal/site/pro-jp/?pgTitle=Search" id="search" method="GET">'+
  '<input name="q" type="text" style="font-size: 11px; margin: 0 0 0 0; font-family: Arial, Helvetica, Verdana, sans-serif;" />&nbsp;'+
  '<input name="Search" type="submit" value="Search" style="font-size: 11px; margin: 0 0 0 0; font-family: Arial, Helvetica, Verdana, sans-serif;" />'+
  '</form>'+
     '</span>';
 if(functionDiv){
  var html = functionDiv.innerHTML;
  while(/\r/.test(html)||/\n/.test(html)||/\t/.test(html)){
   html=html.replace(/\r/g,";;").replace(/\n/,";;").replace(/\t/g,"");
  }
  
  var lines = html.split(";;");
  html="";
  var i = 0;
  for(;i<lines.length-1;i++){
   if(lines[i].indexOf("<br")>-1)
    break;
   html=html+lines[i] +"\n";
  }
  
  html = html + searchHtml+"\n";
  html = html + lines[i];
  functionDiv.innerHTML= html;
  //alert(html);
 }
})()