<%@ include file="/includes.jsp" %>
<script type="text/javascript">
function showPleaseWait1(){
	var xmlfile;
	var csvfile;
	if(document.getElementById("document")!=null){
		xmlfile= document.getElementById("document").value;
	}
	if(document.getElementById("file")!=null){
		csvfile= document.getElementById("file").value;
	}
	if(isEmpty(xmlfile)&& isEmpty(csvfile)){
		alert("Please choose a file to import."); 
		return false;
	}
	if(!isEmpty(xmlfile)){
		var lPosition =xmlfile.indexOf(".");
		var lString=xmlfile.substring(lPosition,xmlfile.length);
		if('.xml'!= lString){
			alert("Please select .xml file.");
			return false;
		}
	}
	if(!isEmpty(csvfile)){
		var lPosition =csvfile.indexOf(".");
		var lString=csvfile.substring(lPosition,csvfile.length);
		if('.csv'!= lString){
			alert("Please select .csv file.");
			return false;
		}
	}
	document.getElementById("waitframe").style.visibility = "visible";
	document.getElementById("waitframe").src = document.getElementById("waitframe").src;
	return true;
}

function isEmpty(str) {
    return (!str || 0 === str.length);
}

</script>
<tiles:insertTemplate template="/tiles/template.jsp" flush="true">
	<tiles:putAttribute name="windowTitle" value="Import Users"/>
	<tiles:putAttribute name="content" value="/admin/tiles/layout.jsp"/>
	<tiles:putAttribute name="innerContent" value="/admin/tiles/importUsersLayout.jsp"/>
</tiles:insertTemplate>