<html>
<head>
<title>Data Loss Prevention - Import Template</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--base href="$$BASE_URL$$"-->
<link href="css/trend-style-new.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="javascripts/localization.js"></script>
<script language="JavaScript" src="javascripts/trend-ui-new.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
var strParentPage = "$$LAST_PAGE$$";
var iErrorCode = "$$ERROR_CODE$$";
function jsInitPage() {
	// Init Page
	var allcookie = unescape(document.cookie);
    var ImportStatus = null;
	if(allcookie.indexOf("TemplateImportInit=") != -1){
	    var CookiePair = allcookie.split(";");
        for(i=0;i<CookiePair.length;i++){
            if(CookiePair[i].indexOf("TemplateImportInit=") != -1){
                ImportStatus = CookiePair[i].substring(CookiePair[i].indexOf("=")+1,CookiePair[i].length);
            }
        }
	}
	if(ImportStatus=="imported")
	{
	    document.cookie = "TemplateImportInit=" + escape("initial");
		if(iErrorCode!="0")
		    alert(STR_WARN_TEMPLATE_INVALID_CONTENT);
		if(strParentPage=="Template_List")
		  window.opener.jsImportRefresh();
		else if(strParentPage=="RuleAddEdit")
		{
		  var newAvailTemplate = document.fmMain.lstTemplate;
		  var newAvailTemplateDesc = document.fmMain.lstTemplateDesc;
		  window.opener.jsImportCGI(newAvailTemplate,newAvailTemplateDesc);
		}
        window.close();		   
	}
}
function jsSubmit()
{
	if(!confirm(STR_ALR_OVERWRITE_SETTING))
		return;
    document.cookie = "TemplateImportInit=" + escape("imported");
    var strAction = document.fmMain.action;
    if (strAction.length > 1 && '&' != strAction.charAt(strAction.length - 1))
        strAction += '&';
    document.fmMain.action = strAction +"LastPage="+strParentPage;
    jsAddCSRFToken(document.fmMain);
    document.fmMain.submit();
    document.fmMain.btnSubmit.disabled = true;
    document.fmMain.btnCancel.disabled = true;
}
//-->
</script>
<body style="margin:0" onLoad="jsInitPage();">
<form id="fmMain" name="fmMain" action="$$FORM_ACTION$$" method="POST" enctype="multipart/form-data">
<!--Hidden Field--><!--/Hidden Field-->
<select name="lstTemplate" id="lstTemplate" multiple style="display:none">$$AVAILABLE_COMPLIANCE_TEMPLATE_LIST$$</select>
<select name="lstTemplateDesc" id="lstTemplateDesc" multiple style="display:none">$$TEMPALTE_DESC$$</select>
<!--Page Title-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td background="images/barbk2.gif" class="popup-title"><font size="2">Data Loss Prevention Import Template</font></td>
    <td background="images/barbk2.gif" class="popup-title" align="right"></td></tr>
<tr><td colspan="2" height="1" background="images/dot.gif"></td></tr>
</table>
<!--/Page Title-->
<!--Page Content-->
<table width="98%" border="0" cellpadding="0" cellspacing="10">
<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
		<tr><td class="tableheadergreyS" colspan="2">Import File</td></tr>
		<tr><td class="data1">File directory:</td>
			<td class="data1"><input type="file" class="text" id="txtFile" name="txtFile" size="40"></td></tr>
		</table></td></tr>
        <tr><td>Note:If a template with the same name already exists, PortalProtect will overwrite the existing template. If you do not want to overwrite an existing PortalProtect template, re-name the template before importing the template file.</td></tr>
<tr><td><input name="btnSubmit" type="button"  onClick="jsSubmit()" class="text" value="Import">
		<input name="btnCancel" type="button" class="text" value="Cancel" onClick="window.returnValue='';window.close();"></td></tr>
</table>
<!--/Page Content-->

</form>
</body>
</html>
