// JavaScript Document
var remote = null;
function remotePop(url, width, height) {
	remote = window.open(url, "Reference", "width="+width+",height="+height+",resizable,scrollbars=no,status=no"); 
	if (remote != null) {
		if (remote.opener == null) {
			remote.opener = self;
			};
	}
}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1]+".src");
		}
	}
}

var preloadFlag = false;
var consumer;
var consumer_over;
var news;
var news_over;
var community;
var community_over;
var research;
var research_over;
var education;
var education_over;
var publications;
var publications_over;
var financial;
var financial_over;
var about;
var about_over;
var banking;
var banking_over;
var econresearch;
var econresearch_over;
var pubsanded;
var pubsanded_over;
var paysys;
var paysys_over;
var search_submit;
var search_submit_over;

	if (document.images) {
		//masthead
		consumer = newImage("/images/consumer.gif");
		consumer_over = newImage("/images/consumer-over.gif");
		publications = newImage("/images/publications.gif");
		publications_over = newImage("/images/publications-over.gif");
		education = newImage("/images/education.gif");
		education_over = newImage("/images/education-over.gif");
		news = newImage("/images/news.gif");
		news_over = newImage("/images/news-over.gif");
		research = newImage("/images/research.gif");
		research_over = newImage("/images/research-over.gif");
		econresearch = newImage("/images/econresearch.gif");
		econresearch_over = newImage("/images/econresearch-over.gif");
		about = newImage("/images/about.gif");
		about_over = newImage("/images/about-over.gif");
		banking = newImage("/images/banking.gif");
		banking_over = newImage("/images/banking-over.gif");
		community = newImage("/images/community.gif");
		community_over = newImage("/images/community-over.gif");
		financial = newImage("/images/financial.gif");
		financial_over = newImage("/images/financial-over.gif");
		paysys = newImage("/images/paysys.gif");
		paysys_over = newImage("/images/paysys-over.gif");
		pubsanded = newImage("/images/pubsanded.gif");
		pubsanded_over = newImage("/images/pubsanded-over.gif");
		search_submit = newImage("/images/search_submit.gif");
		search_submit_over = newImage("/images/search_submit-over.gif");
		
		
		preloadFlag = true;
	}
	
	function printable(){ 
		var top = '<html><head><title>Printable Version - Federal Reserve Bank of New York</title><link rel="stylesheet" href="/css/v2/basic_printable.css" type="text/css"/><style type="text/css"> @import url(/css/v2/printable.css); /*IE and NN6x styles*/</style></head><body leftmargin="10" topmargin="10" marginwidth="10" marginheight="10"><img src="/images/v2/seal_06.jpg" alt="Federal Reserve Bank of New York"/>';
		var bottom = '</body></html>';
		getthis=document.all?document.all['printthis']:document.getElementById('printthis'); 
		var popurl="/printable.html";
		winpops=window.open(popurl,"","width=625,height=480,status,scrollbars,menubar,resizable,");
		winpops.document.write(top+getthis.innerHTML+bottom);
	}
	
	function writepopcharts(){

if (document.layers){
	document.write('<p align="left">[please upgrade browser to view charts]</p>');
	}
else{
	document.write('<div style="position:relative;height:165px">');
	document.write('<div id="discountChart" style="position:absolute; visibility: hidden; left: 0px; top: 0px; width: 206">');
 	document.write('<table border="0" cellspacing="0" cellpadding="0" width="206"><tr><td class="tdTabOff"> <table border="0" cellspacing="0" cellpadding="0" width="206">');
  	document.write('<tr height="3"><td><img src="/images/spacer.gif" width="1" height="2" alt=""/></td><td class="tabOnTop"><img src="/images/spacer.gif" width="1" height="2" alt=""/></td></tr>');
   	document.write('<tr><td class="tabOffLeft" align="center"><div style="padding-top:1px;padding-bottom:1px"><a href="javascript:layerVis(\'discountChart\',\'off\');layerVis(\'fedFundsChart\',\'on\')">Fed Funds</a></div></td>');
	document.write('<td class="tabOn" align="center"><div style="padding-top:1px;padding-bottom:1px"><a href="/banking/discountwindow.html">Discount</a></div></td></tr></table></td></tr></table>');
  	document.write('<table border="0" cellspacing="0" cellpadding="0" width="206">');
    document.write('<tr><td bgcolor="#FFFFFF" class="greyborderLeft" width="17">&nbsp;</td><td bgcolor="#FFFFFF" class="greyborderRight" height="113" valign="bottom"><img src="images/Discount1YEAR.png" alt="Discount rate chart - please call 212-720-6130 for more information." name="discount" width="172" height="95"/>');
	document.write('<br /><img src="/images/spacer.gif" width="1" height="5" alt=""/></td></tr>');
    document.write('<tr bgcolor="#FFFFFF"> <td colspan="2" class="greyborderTop"><img src="/images/spacer.gif" width="1" height="1" alt=""/></td></tr>');
    document.write('<tr><td class="greyborderLeft" bgcolor="#FFFFFF">&nbsp;</td><td class="greyborderRight" bgcolor="#FFFFFF"> <table border="0" cellspacing="0" cellpadding="0">');
    document.write('<tr><form><td width="10"><input type="radio" name="radiobutton" checked onclick="discount.src=\'/images/Discount1YEAR.png\'" value="radiobutton"/></td><td><img src="/images/spacer.gif" width="3" height="1" alt=""/></td><td>12 months</td>');
	document.write('<td width="10"><img src="images/spacer.gif" width="10" height="8" alt=""/></td><td width="10"> <input type="radio" name="radiobutton" onclick="discount.src=\'/images/Discount1WEEK.png\'" value="radiobutton"/></td>');
	document.write('<td><img src="images/spacer.gif" width="3" height="1" alt=""/></td><td height="25">1 week</td></form></tr></table></td></tr>');
    document.write('<tr><td colspan="2" class="greyborderTop"><img src="images/spacer.gif" width="1" height="1" alt=""/></td></tr></table><img src="/images/spacer.gif" width="1" height="10" alt=""/><br /></div>');

	document.write('<div id="fedFundsChart" style="position:absolute; visibility: visible; left: 0px; top: 0px; width: 206"><table border="0" cellspacing="0" cellpadding="0" width="206">');

    document.write('<tr><td class="tdTabOff"> <table border="0" cellspacing="0" cellpadding="0" width="206"><tr height="3"><td class="tabOnTop"><img src="/images/spacer.gif" width="1" height="2" alt=""/></td>');
	document.write('<td><img src="/images/spacer.gif" width="1" height="2" alt=""/></td></tr><tr><td class="tabOn" align="center"> <div style="padding-top:1px;padding-bottom:1px"><a href="/markets/omo/dmm/fedfundsdata.cfm">Fed Funds</a></div></td>');
    document.write('<td class="tabOff" align="center"> <div style="padding-top:1px;padding-bottom:1px"><a href="javascript:layerVis(\'discountChart\',\'on\');layerVis(\'fedFundsChart\',\'off\')">Discount</a></div></td></tr></table></td></tr></table>');
  	document.write('<table border="0" cellspacing="0" cellpadding="0" width="206"><tr> <td bgcolor="#FFFFFF" class="greyborderLeft" width="17">&nbsp;</td>');
	document.write('<td bgcolor="#FFFFFF" class="greyborderRight" height="113" valign="bottom"><img src="/images/v2/home/FF1YEAR.png" alt="Federal Funds chart - please call 212-720-6130 for more information." name="fedfunds" width="172" height="95"/><br /><img src="/images/spacer.gif" width="1" height="5" alt=""/></td></tr>');
	document.write('<tr bgcolor="#FFFFFF"><td colspan="2" class="greyborderTop"><img src="/images/spacer.gif" width="1" height="1" alt=""/></td></tr><tr><td class="greyborderLeft" bgcolor="#FFFFFF">&nbsp;</td>');
	document.write('<td class="greyborderRight" bgcolor="#FFFFFF"><table border="0" cellspacing="0" cellpadding="0"><tr><form><td width="10"><input type="radio" checked name="radiobutton" onclick="fedfunds.src=\'/images/v2/home/FF1YEAR.png\'" value="radiobutton"/></td>');
	document.write('<td><img src="/images/spacer.gif" width="3" height="1" alt=""/></td><td>12 months</td><td width="10"><img src="/images/spacer.gif" width="10" height="8" alt=""/></td><td width="10"><input type="radio" name="radiobutton" onclick="fedfunds.src=\'/images/v2/home/FF1WEEK.png\'" value="radiobutton"/></td>');
	document.write('<td><img src="/images/spacer.gif" width="3" height="1" alt=""/></td><td height="25">1 week</td></form></tr></table></td></tr><tr><td colspan="2" class="greyborderTop"><img src="/images/spacer.gif" width="1" height="1" alt=""/></td></tr>');
	document.write('</table><img src="/images/spacer.gif" width="1" height="10" alt=""/><br /></div>');
	document.write('</div>');
	}
}
