#!/usr/bin/perl

use strict;
use CGI;
use HTML::Template;
use Opals::Locale qw(
    loc_getMsgFile
    loc_write
);


my($dbh,$rid)=@_;
my $rootDir   = Opals::Context->config('rootDir');
my $template = HTML::Template->new(   
            filename            => "viewRecordPan.tmpl",
            path                => "$rootDir/htdocs/theme/opals/ajax/search/",
            die_on_bad_params   => 0,
            cache               => 1,
            shared_cache        => 0,
            loop_context_vars   => 1);

my $cgi = CGI->new;
my $defaultLang='en';
my $lang = $cgi->cookie('language');
if($lang !~ m/en|fr/i){
    $lang =$defaultLang;
}
$ENV{'curLang'}= $lang;

my $fieldMsgMap  =loc_getMsgFile('record/bib_info.msg');
loc_write($template,$fieldMsgMap);
print $cgi->header(
    -type    => 'text/javascript',
    -expires => 'now',
    -charset => 'utf-8',
), $template->output;


