<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Thank You</title>
</head>
<body bgcolor = "#d6cbd3">
	<h2>Response Entered by you:</h2>
	<form method="post">
		URL entered: <strong>{{ URL }}</strong><br><br>
		<script type="text/javascript">
			var word_list_display  = {{ word_list_display|safe }}
			var word_count_display  = {{ word_count_display|safe }}
            		var most_occur_file_map  = {{ most_occur_file_map|safe }}
            		var pdf_name_list  = {{ pdf_name_list|safe }}
            		var pdf_url_list  = {{ pdf_url_list|safe }}
            		var most_occur_file_map_len = {{ most_occur_file_map_len|safe }}
            		function links(word, size, file, len, pdfname, urls,i) {
            			var a = document.createElement('a');  
            			var b = document.createElement('br');
            			// Create the text node for anchor element. 
            			var link = document.createTextNode(word); 
            			// Append the text node to anchor element. 
            			a.appendChild(link);  
            			// Set the title. 
            			a.title = word;
            			// Set the href property. 
            			a.href = "javascript:func('"+file+"','"+len+"', '"+pdfname+"','"+urls+"');";  
	    			// Append the anchor element to the body. 
				a.style.fontSize = "1.0em";
				var size1 = (0.002 * size);
				//document.write(size1)
				a.style.marginLeft = "100px";
                		a.style.fontSize = parseFloat(a.style.fontSize) + size1 + "em";
                		document.body.appendChild(a);
                		if(i%5==0)
                			document.body.appendChild(b);
                	}
                	function func(file, len, pdfname, urls) {
                		document.write("<center><b><u>");
                		document.write("List of PDFs  <br />");
                		document.write("</u></b></center>");
                		document.body.style.backgroundColor = "#daebe8";
                		var file1 = file.split(',');
                		var pdfname1 = pdfname.split(',');
                		var urls1 = urls.split(',');
                		for(i=0; i<len; i++)
                		{
                			var a = document.createElement('a');  
                			var b = document.createElement('br');
                			// Create the text node for anchor element.
                			var x =  parseInt(file1[i]);
                			//document.write(x);
                			var link = document.createTextNode(pdfname1[x]); 
                			// Append the text node to anchor element. 
                			a.appendChild(link);
                			a.target= "_blank";  
                			// Set the title. 
                			a.title = pdfname1[x]; 
                			// Set the href property. 
                			a.href = urls1[x];  
					// Append the anchor element to the body. 
                			document.body.appendChild(a);
                			document.body.appendChild(b);
                		}
                	
                	}
              
			for (i=0;i<{{ x }};i++)
			{
				links(word_list_display[i],word_count_display[i], most_occur_file_map[word_list_display[i]], most_occur_file_map_len[word_list_display[i]], pdf_name_list, pdf_url_list,i );
			}
	    </script>
	    </form>
</body>
</html>


