//---- Set this variable only! ----
var buildDir = "js/";
//---------------------------------

var ie4 = false, ie5_mac = false, ie55 = false;
var nn4 = false, dom = false, opera = false, safari = false;
var agent = navigator.userAgent.toLowerCase();

if (agent.indexOf("opera") != -1)
	opera = true;
else if (agent.indexOf("safari") != -1)
	safari = true;
else if (document.all)
{
	var version = parseFloat(agent.substr(agent.indexOf("msie")+5, 3));
	if (agent.indexOf("mac") != -1 && version >= 5)
		ie5_mac = true;
	else
	{
		if (version >= 5.5)
			ie55 = true;
		else if (version >= 4)
			ie4 = true;
	}
}
//else if (document.layers)
else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4 && 
	parseInt(navigator.appVersion) < 5)
	nn4 = true;
else if (document.getElementById)
	dom = true;

var blank = new Image();
blank.src = buildDir + "blank.gif";

if (ie4)
	document.write('<script type="text/javascript" src="' + buildDir + 'ie4-build.js"></script>');
else if (ie5_mac)
	document.write('<script type="text/javascript" src="' + buildDir + 'ie5m-build.js"></script>');
else if (ie55)
	document.write('<script type="text/javascript" src="' + buildDir + 'ie55-build.js"></script>');
else if (nn4)
	document.write('<script type="text/javascript" src="' + buildDir + 'ns4-build.js"></script>');
else if (dom)
	document.write('<script type="text/javascript" src="' + buildDir + 'dom-build.js"></script>');
else if (opera)
	document.write('<script type="text/javascript" src="' + buildDir + 'op7-build.js"></script>');
else if (safari)
	document.write('<script type="text/javascript" src="' + buildDir + 'saf-build.js"></script>');
else
{
	alert("Your browser doesn't support this script.");
	location.href = buildDir + "upgrade.php";
	document.write('<script type="text/javascript" src="' + buildDir + 'no-build.js"></script>');
}


<!-- //Print function
var gAutoPrint = true;

function printSpecial()
{
var printReadyElem = null;
if (document.getElementById != null)
{
	var szNav = $('.txt_indicate').html();
	if(szNav==null) szNav = 'National Transplant Resource Centre';
var html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n"+
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n"+
"<head>\r\n"+
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\r\n"+
"<title>National Transplant Resource Centre</title>\r\n"+
"<link href=\"css/ntrc.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n"+
"<!--[if lt IE 7]><script src=\"js/IE7.js\" type=\"text/javascript\"></script><![endif]-->\r\n"+
"</head>\r\n"+
"<body>\r\n"+
"<div id=\"popup\">\r\n"+
"	<div class=\"header\"><img src=\"i/pop-logo-trans.png\" /></div>\r\n"+
"	<div class=\"content\">\r\n"+
"	  <div class=\"maintitle\">"+szNav+"</div>\r\n"+
"	  								<div class=\"alltext\">\r\n";

printReadyElem = $(".txt").html();
if (printReadyElem == null) {
	alert("Could not find the printReady section in the HTML");
	return;
}
html += printReadyElem;

	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);

	html += "</div>  </div>\r\n"+
"	<div class=\"bottom\"><img src=\"i/pop-round2-trans.gif\" /></div>\r\n"+
"	<div class=\"footer\">For more information on <a href=\"policies.html\" class=\"green\" target=\"blank\">Policy, Guidelines and Production</a><br />\r\n"+
"    Copyright 2009 @ National Transplant Resource Centre, Ministry of Health Malaysia.<br />\r\n"+
"This website is developed by Transplantation Services Unit, Medical Development Unit and National Transplant Resource Centre.<br />\r\n"+
"Ministry of Health Malaysia will not be responsible of any loss or damage caused by the use of information taken from this portal.</div>\r\n"+
"</div>\r\n"+
"</body>\r\n"+
"</html>";

var printWin = window.open("","printSpecial","left=20,top=20,width=700,height=500,scrollbars=yes,resizable=yes,location=no,address=no,toolbars=no");
	printWin.document.open();
	printWin.document.write(html);
	printWin.document.close();
	//printWin.location.reload();
var headID = printWin.document.getElementsByTagName("head")[0];         
var cssNode = printWin.document.createElement('link');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.href = 'css/ntrc.css';
cssNode.media = 'screen,print';
headID.appendChild(cssNode);
if (gAutoPrint)
	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);
	setTimeout(function() {printWin.print();}, 2000);
}else {
alert("Sorry, the print ready feature is only available in modern browsers.");
}
}
//-->