

 function getSvgsrate( x ) {
  if ( x == 0 ) { tx = "SAVINGS.RATES.";}  
  if ( x == 1 ) { tx = "JUMBO/SAVINGS.RATES.JUMBO."; }
var now = new Date();
var offset = now.getDay();
if( offset > 4 ) offset-= 7;
if( offset < 4 ) offset+= 3;
else offset=0;
 now.setTime(now.getTime() - offset * 24 * 60 * 60 * 1000);
 var date = now.getDate();
 var month = now.getMonth();
 var year = now.getYear(); year += (year < 1900) ? 1900 : 0;
var months = new Array(); 
months[0] = "01"; 
months[1] = "02"; 
months[2] = "03"; 
months[3] = "04"; 
months[4] = "05"; 
months[5] = "06"; 
months[6] = "07"; 
months[7] = "08"; 
months[8] = "09"; 
months[9] = "10"; 
months[10] = "11"; 
months[11] = "12"; 
year= year-2000;
if (year<10) {year= "0"+year;}
if (date<10) {date= "0"+date;}
document.location="savingsrate/"+tx+months[month]+date+year+".pdf";
  }
