var print = false;
var crystal_postback =
        "<input type=\"hidden\" name=\"reportsource\" id=\"reportsource\"/>" +
        "<input type=\"hidden\" name=\"viewstate\" id=\"viewstate\"/>";
function getPageTitle() {
    if (print) {
        return L_PrintPageTitle;
    }
    else {
        return L_ExportPageTitle;
    }
}
function getOptionsTitle() {
    if (print) {
        return L_PrintOptions;
    }
    else {
        return L_ExportOptions;
    }
}
function getFormatDropdownList() {
    if (print) {
        return "<input type=\"hidden\" name=\"exportformat\" id=\"exportformat\" value=\"PDF\"/>";
    }
    else {
        var list =
		"<table width=\"100%\">" +
		"<td align=\"center\"><span class=\"exportMessage\"><label for=\"exportFormatList\">" + L_ExportFormat + "</label></span></td>" +
		"<tr>" +
		"<td class=\"exportSelect\" align=\"center\">" +
		"<select id=\"exportFormatList\" class=\"exportSelect\" name=\"exportformat\" onchange=\"checkDisableRange()\">" +
		"<option selected value=\"\">" + L_Formats + "</option>";
        if (rpt) {
            list += "<option value=\"CrystalReports\">" + L_CrystalRptFormat + "</option>";
        }
        if (pdf) {
            list += "<option value=\"PDF\">" + L_AcrobatFormat + "</option>";
        }
        if (word) {
            list += "<option value=\"MSWord\">" + L_WordFormat + "</option>";
        }
        if (xls) {
            list += "<option value=\"MSExcel\">" + L_ExcelFormat + "</option>";
        }
        if (recXls) {
            list += "<option value=\"RecordToMSExcel\">" + L_ExcelRecordFormat + "</option>";
        }
        if (rtf) {
            list += "<option value=\"RTF\">" + L_RTFFormat + "</option>";
        }

        list += "</select>" +
		"</td>" +
		"</tr>" +
		"</table>";
        return list;
    }
}
function getSelectPageRangeSentence() {
    if (print) {
        return L_PrintPageRange;
    }
    else {
        return L_ExportPageRange;
    }
}
function getPrintSteps() {
    if (print) {
        var steps =
		"<tr height=40 valign=\"bottom\">" +
		"<td><span class=\"exportMessage\">" + L_PrintStep0 + "</span></td>" +
		"</tr>" +
		"<tr valign=\"top\">" +
		"<td><span class=\"exportMessage\">" + L_PrintStep1 + "</td>" +
		"</tr>" +
		"<tr height=40 valign=\"top\">" +
		"<td><span class=\"exportMessage\">" + L_PrintStep2 + "</span></td>" +
		"</tr>";
        return steps;
    }
    else {
        return "";
    }
}
function getExportDialog() {
    var exportDialog =
		"<html>" +
		"<head>" +
		"<style>" +
		"span.exportMessage {" +
		"   font-size: 12pt; font-family: Arial, Helvetica, sans-serif" +
		"}" +
		"span.exportSelect {" +
		"   font-size: 10pt; font-family: Arial, Helvetica, sans-serif" +
		"}" +
		"</style>" +
		"<title>" + getPageTitle() + "</title>" +
		"</head>" +
		"<body bottomMargin=0 topMargin=5 onload=\"init()\">" +
		"<form name=\"Export\" method=\"POST\">" +
		crystal_postback +
		"<table cellSpacing=\"0\" cellPadding=\"3\" width=\"97%\" align=\"center\" border=\"0\">" +
		"<tr bgColor=#008080><td>&nbsp;</td></tr>" +
		"<tr bgColor=#000000><td>&nbsp;</td></tr>" +
		"<fieldset style=\"border-style:none\">" +
		"<tr><td><legend align=\"center\"><span class=\"exportMessage\">" + getOptionsTitle() + "</span></legend></td></tr>" +
		"<tr>" +
		"<td align=\"center\">" +
		getFormatDropdownList() +
		"</td></tr>" +
		"<tr><td><span class=\"exportMessage\">&nbsp;&nbsp;&nbsp;" + getSelectPageRangeSentence() +
		"</span></td>" +
		"</tr>" +
		"<tr>" +
		"<td>" +
		"<table>" +
		"<tr>" +
		"<td><input type=\"radio\" id=\"radio1\" checked name=\"isRange\" value=\"all\" onclick=\"return toggleRangeFields(this);\"/></td>" +
		"<td><span class=\"exportMessage\"><label for=radio1>" + L_All + "</label></span></td>" +
		"</tr>" +
		"</table>" +
		"</td>" +
		"</tr>" +
		"<tr>" +
		"<td>" +
		"<table>" +
		"<tr>" +
		"<td><input type=\"radio\" id=\"radio2\" name=\"isRange\" value=\"selection\" onclick=\"return toggleRangeFields(this);\"/></td>" +
		"<td><span class=\"exportMessage\"><label for=radio2>" + L_Pages + "</label></span></td>" +
		"</tr>" +
		"</table>" +
		"</td>" +
		"</tr>" +
		"<tr>" +
		"<td>" +
		"<table>" +
		"<tr>" +
		"<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>" +
		"<td><span class=\"exportMessage\"><label for=from>" + L_From + "</label></span></td>" +
		"<td><input type=\"text\" width=\"20\" size=\"6\" maxLength=\"6\" name=\"from\" id=\"from\" value=\"1\" disabled></td>" +
		"<td><span class=\"exportMessage\"><label for=to>" + L_To + "</label></span></td>" +
		"<td><input type=\"text\" width=\"20\" size=\"6\" maxLength=\"6\" name=\"to\" id=\"to\" value=\"1\" disabled></td>" +
		"</tr>" +
		"</table>" +
		"</td>" +
		"</tr>" +
		"</FIELDSET>" +
		getPrintSteps() +
		"<tr>" +
		"<td align=\"center\" colspan=6><BR><input type=\"button\" id=\"submitexport\" width=\"30\" title=\"" + getPageTitle() + "\" value=\"&nbsp;&nbsp;&nbsp;" + L_OK + "&nbsp;&nbsp;&nbsp;\" onclick=\"checkValuesAndSubmit();\"/></td>" +
		"</tr>" +
		"</table>" +
		"</form>" +
		"</body>" +
		"</html>";
    return exportDialog;
}