function popup(url,wname,w,h){
	newwin = window.open(url,wname,'width=' + w + ',height=' + h);
}


// LAUNCH SAVINGS PRODUCT COMPARISON APPLICATION
$(function(){	

	// if javascript is turned off, make sure the Savings Account Tool doesn't show
	$("#scrollableSavingsComparison").css('display','block');
	$(".savingsCompareBanner").css('display','block');

	// LAUNCH
	$('#launchApplication').click(function() {
		window.open('/savings/comparison/index.html', '', 'location=no,width=1024,height=768,resizable=yes,scrollbars=yes,toolbar=no,status=no');
	});
	
});



// to make the search box text dissapear onFocus of cursor
var active_color = '#000'; // Colour of user provided text
var inactive_color = '#999'; // Colour of default text
 
$(document).ready(function() {
  $("input#searchtext").css("color", inactive_color);
  var searchtext = new Array();
  $("input#searchtext").focus(function() {
    if (!searchtext[this.id]) {
      searchtext[this.id] = this.value;
    }
    if (this.value == searchtext[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    $(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = searchtext[this.id];
      }
    });
  });
});



$(document).ready(function() {
  $("input#searchtext2").css("color", inactive_color);
  var searchtext2 = new Array();
  $("input#searchtext2").focus(function() {
    if (!searchtext2[this.id]) {
      searchtext2[this.id] = this.value;
    }
    if (this.value == searchtext2[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    $(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = searchtext2[this.id];
      }
    });
  });
});