function preparePrintURL(url,language) {
var vUrl = url;

if (document.all.DiceResultPrint) {      

  v_start_row           =  'p_start_row='           + document.all.DiceResultPrint.p_start_row.value;
  v_end_row              = 'p_end_row='             + document.all.DiceResultPrint.p_end_row.value;
  v_max_rows            =  'p_max_rows='            + document.all.DiceResultPrint.p_max_rows.value;
  v_text_cond           =  'p_text_cond='           + document.all.DiceResultPrint.p_text_cond.value;
  v_title               =  'p_title='               + document.all.DiceResultPrint.p_title.value;
  v_jelcode             =  'p_jelcode='             + document.all.DiceResultPrint.p_jelcode.value;
  v_last_refyear_from   =  'p_last_refyear_from='   + document.all.DiceResultPrint.p_last_refyear_from.value;
  v_last_refyear_to     =  'p_last_refyear_to='     + document.all.DiceResultPrint.p_last_refyear_to.value;
  v_doctype             =  'p_doctype='             + document.all.DiceResultPrint.p_doctype.value;
  v_countries           =  'p_countries='           + document.all.DiceResultPrint.p_countries.value;
  v_institutions        =  'p_institutions='        + document.all.DiceResultPrint.p_institutions.value;
  v_checkbox_active     =  'p_checkbox_active='     + document.all.DiceResultPrint.p_checkbox_active.value;
  v_checkbox_archived   =  'p_checkbox_archived='   + document.all.DiceResultPrint.p_checkbox_archived.value;
  v_checkbox_TimeSeries =  'p_checkbox_TimeSeries=' + document.all.DiceResultPrint.p_checkbox_TimeSeries.value;

  vUrl = 'http://www.cesifo-group.de/portal/page/portal/ifoHome/a-winfo/d3iiv/_DICE_Results_Print';   
  vUrl = vUrl + '?'+v_start_row+'&'+v_end_row+'&'+v_max_rows+'&'+v_text_cond+'&'+v_title+'&'+v_jelcode+'&'
                   +v_last_refyear_from+'&'+v_last_refyear_to+'&'+v_doctype+'&'+v_countries+'&'+v_institutions+'&'
                   +v_checkbox_active+'&'+v_checkbox_archived+'&'+v_checkbox_TimeSeries;
}

vUrl = vUrl.replace(/\%/g, "%25");
// Reihenfolge nicht ändern!!!
vUrl = vUrl.replace(/:/g, "%3A");
vUrl = vUrl.replace(/\//g, "%2F");
vUrl = vUrl.replace(/&/g, "%26");
vUrl = vUrl.replace(/\=/g, "%3D");
vUrl = vUrl.replace(/,/g, "%2C");
vUrl = vUrl.replace(/\?/g, "%3F");
vUrl = vUrl.replace(/ /g, "%20");
vUrl = '/ifotools/print?_language='+language+'&_link='+vUrl;
//alert(vUrl);
//location.href = vUrl;
PRINT = window.open(vUrl,"PRINT","width=750, height=600, scrollbars=yes, menubar=yes");
PRINT.focus();
}

function noLink() {
var content = document.cookie;
if (content.search(/de-de/) != -1)
 { document.write('<a href="#" title="Druckversion ohne Verlinkung!">'); }
else
 { document.write('<a href="#" title="Print version without linking!">'); }
}

function header() {
var content = document.cookie;
if (content.search(/de-de/) != -1) 
 { var druck = 'Seite drucken '; var ende = 'Fenster schließen'; }
else
 { var druck = 'Print this page '; var ende = 'Close Window'; }
var table = '<body margin="5" bgcolor="#FFFFFF" onLoad="Text.decryptDocument();">';
table = table + '<table width="100%" cellspacing="0" cellpadding="0"><tr>';
table = table + '<td background="/print/printHeader.jpg" width="100%" height="70" align="right" valign="top">';
table = table + '<img src="/print/printCESifoLogo.jpg" vspace="5">';
table = table + '<p><span style="color:#777777;" class="nichtdrucken"><a href="javascript:window.print();" style="text-decoration:none; color:#777777;">' + druck + '</a>';
table = table + ' | <a href="javascript:window.close();" style="text-decoration:none; color:#777777;">' + ende + '</a>&nbsp;</span></p>';
table = table + '</td></tr></table><br>';
document.write(table);
}

function footer() {
var beginTab = '<br><table width="100%" cellspacing="0" cellpadding="0"><tr><td background="/print/printFooter.jpg" width="100%" height="45" align="right" valign="bottom">';
var endTab = '&nbsp;&nbsp;</td><td>&nbsp;&nbsp;</td></tr></table>';
var content = document.cookie;
var xx = content.search(/de-de/);
if (xx != -1)
document.write(beginTab + '© 1999-2010 ifo Institut für Wirtschaftsforschung e.V., München' + endTab);
else
document.write(beginTab + '© 1999-2010 Ifo Institute for Economic Research, Munich' + endTab)
}
