function openExcel(sExcel) { 
	var sPath = "/site/media/xls/abf/";
	var d=new Date()
	var day = d.getDay();
	// var newExcel = convertName(sExcel);
	var newExcel = sExcel;
	window.open(sPath + newExcel,'','scrollbars,resizable,menubar,HEIGHT=600,WIDTH=800,TOP=10,LEFT=10')
}

function padZero(inVal) {
	if (inVal < 10) {
		return "0" + inVal;
	} else {
		return "" + inVal;
	}
}
function getNow() {
	var date = new Date();
	var hh = date.getHours();
	var mm = padZero(date.getMinutes());
	var ss = padZero(date.getSeconds());
	var hhmmss = hh + "" + mm + "" + ss;
	var num_hhmmss = hhmmss * 1;
	var binary = num_hhmmss.toString(2);	
	return binary;
}
function convertName(xls) {
	var binary = getNow();
	var output = "";
	for (i=0; i<=binary.length; i++) {
		if (binary.charAt(i) == "1") {
			output = output + xls.charAt(i).toUpperCase();	
		} else {
			output = output + xls.charAt(i);			
		}		
	}
	output = output + xls.substring(binary.length+1, xls.length);
	return output;
}
function hide(id) {
	var obj=document.getElementById(id);
	if (obj) {
		document.getElementById(id).style.visibility = "hidden";
		document.getElementById(id).style.display = "none";
	}
}
function show(id) {
	var obj=document.getElementById(id);
	if (obj) {
		document.getElementById(id).style.visibility = "visible";
		document.getElementById(id).style.display = "";
	}
}
function tidyArea(divName) {
	if (document.getElementById(divName)) {
		var txtHTML = document.getElementById(divName).innerHTML;
		txtHTML = txtHTML.replace(/&amp;/g,"&");		
		txtHTML = txtHTML.replace(/&lt;/g,"<");
		txtHTML = txtHTML.replace(/&gt;/g,">");		
		document.getElementById(divName).innerHTML = txtHTML;
		// document.write(txtHTML);
	}
}

	function drawFlash(flash, width, height, id) {
		var output = "";
		output = output + '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + width + '" height="' + height + '" id="ABF_index_03" align="middle">';
		output = output + '<param name="allowScriptAccess" value="sameDomain" />';
		output = output + '<param name="movie" value="' + flash + '" />';
		output = output + '<param name="loop" value="false" />';
		output = output + '<param name="menu" value="false" />';
		output = output + '<param name="quality" value="high" />';
		output = output + '<param name="bgcolor" value="#ffffff" />';
		output = output + '<embed src="' + flash + '" loop="false" menu="false" quality="high" bgcolor="#ffffff" width="' + width + '" height="' + height + '" name="ABF_index_03" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		output = output + '</object>';		
		var obj=document.getElementById(id);
		if (obj && id) {
			obj.innerHTML = output;
		} else {
			return output;	
		}	
	}
	
	function drawImage(img, width, height, alt, id) {
		var output = '<img src="' + img + '" width="' + width + '" height="' + height + '" border="0" alt="' + alt + '">';
		var obj=document.getElementById(id);
		if (obj && id) {
			obj.innerHTML = output;
		} else {
			return output;	
		}	
	}
	
	var requiredVersion = 6;
	var useRedirect = true; 
	var flashPage = ""		
	var noFlashPage = ""	
	var upgradePage = ""	
	var flash2Installed = false;		
	var flash3Installed = false;		
	var flash4Installed = false;		
	var flash5Installed = false;	
	var flash6Installed = false;	
	var maxVersion = 6;					
	var actualVersion = 0;				
	var hasRightVersion = false;		
	var jsVersion = 1.0;				


	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; 
	jsVersion = 1.1;
	if(isIE && isWin)
	{ 
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
		document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
		document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
		document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
		document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');	
		document.write('<'+'/SCR' + 'IPT\> \n');  
	}

	function detectFlash()
	{	
		if (navigator.plugins)
		{
			if (navigator.plugins["Shockwave Flash 2.0"]
			|| navigator.plugins["Shockwave Flash"])
			{		
				var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
				var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
				var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
				flash2Installed = flashVersion == 2;		
				flash3Installed = flashVersion == 3;
				flash4Installed = flashVersion == 4;
				flash5Installed = flashVersion == 5;
				flash6Installed = flashVersion >= 6;
			}
		}
		for (var i = 2; i <= maxVersion; i++) 
		{	
			if (eval("flash" + i + "Installed") == true) actualVersion = i;
		}
		if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;	
		if (actualVersion >= requiredVersion) 
		{
			hasRightVersion = true;						
			if (useRedirect) 
			{
				if(jsVersion > 1.0) 
				{
					TestPass=true;	
				} 
				else 
				{
					TestPass=true;		
				}
			}
		} 
		else 
		{	
			if (useRedirect) 
			{
				if(jsVersion > 1.0) 
				{
					TestPass=false;
				} 
				else 
				{
					TestPass=false;
				}
			}
		}
	return TestPass;
	}

	function gotoExternalFactsheet(sIn)
	{
	      window.open(sIn,"", "width=480,height=520, resizable=yes,scrollbars=yes"); 
	}

document.write('<link type="text/css" href="/site/stylesheets/abf_style.css" rel="stylesheet">');
document.write('<link type="text/css" href="/site/stylesheets/print_abf.css" rel="stylesheet" media="print">');

