pdfreader = false;

try { /* None-IE Detection */
	for (i=0;i<navigator.mimeTypes.length;i++) {
		if (navigator.mimeTypes[i].suffixes == "pdf") { pdfreader = true; }
	}
} catch(e) { }
	
try { /* IE Detection */
	adobePdfObject = new ActiveXObject("AcroPDF.PDF.1")
if (adobePdfObject) { pdfreader = true; }
} catch(e) { }
	

if (pdfreader) {
	document.write('<div id="iframepop" style=\"visibility: hidden; filter: alpha(opacity=0)\"></div>');
}
function dispPdf(filename) {
	if (pdfreader ) {
		htmld = "<embed src=\"" + filename + "\" width=\"700\" height=\"" + window.innerHeight + "\"></embed><br /><br /><a href=\"" + filename + "\" class=\"pdflink floatright\">Download this document as a PDF</a><br /><br />";     	
		htmld = "<p><span class=\"rb\">This document is presented in Adobe PDF format.</span><br /><br />You appear to have a recent version of Adobe Reader installed, so you may view this document below</p>\n";
		htmld+= "<a href=\"" + filename + "\" onclick=\"spdf(this.href);return false\" class=\"linkpdfv\">View this PDF document online</a>"
		htmld+= "<a href=\"documents/dl.php?f=" + filename + "\" class=\"linkpdfd\">Download and save this PDF document</a>"
	} else {
		htmld = "You do not appear to have the latest version of Adobe Acrobat Reader installed.<br />To view these documents, you will require Adobe Acrobat Reader.<br /><br />\n<a href=\"http://get.adobe.com/uk/reader/\" class=\"arrlink rb\">Click here to download Adobe Acrobat Reader</a><br /><br />\nAlternatively, if you are using a third-party reader, you may download this PDF below:<br /><br />\n<a href=\"" + filename + "\" class=\"pdflink\" style=\"display:inline-block;\">Download this document as a PDF</a><br />";
	}
	document.write(htmld);
		
}
	 				
function spdf(u) {
	document.body.style.overflow = "hidden";
	ihtml = '<div style="width: 1000px; height: 100%; position: relative; margin: 0 auto; background-color: #FFFFFF">'
	//ihtml+= "<embed src=\"" + u + "\" style=\"width: 1000px; height: 95%; top: 5%; position: absolute;\"></embed><div style=\"position: absolute; top: 0px;  width: 980px; height: 5%;  background-color: #FFFFFF; padding: 10px;\"><a class=\"arrlink rb\" href=\"#\" onclick=\"hsframe();return false\">Click here to return to the previous page</a></div>"
	ihtml+= "<iframe src=\"" + u + "\" style=\"width: 1000px; height: 95%; top: 5%; position: absolute; border:0px;\"></iframe><div style=\"position: absolute; top: 0px;  width: 980px; height: 15px;  background-color: #FFFFFF; padding: 10px;\"><a class=\"arrlink rb\" href=\"#\" onclick=\"hsframe();return false\">Click here to return to the previous page</a></div>"
	ihtml+= "</div>"
	document.getElementById("iframepop").innerHTML = ihtml;
	//document.getElementById("ifif").location = "if.php"
	fadein(document.getElementById("iframepop"))
}
	 		
function hsframe() {
	document.body.style.overflow = "";
	//document.getElementById("iframepop").innerHTML = ""
	fadeout(document.getElementById("iframepop"))
}
