// JavaScript Document :: Macromedia & squaremackerel functions

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function popper(theURL) {
theWindow = window.open(theURL, "theWindow", "height=560, width=420, left=100, top=100, scrollbars=yes, resizable=yes, toolbar=no")
}

function closeWindow() {
window.close(this)
}

function changeParent(URL) {
opener.location = URL;
}

function goBack() {
history.back();
}

function getURL(URL) {
//alert(URL);
if (URL == "http://www.adobe.com/products/acrobat/readstep.html") {
	window.open(URL, "newWindow");
} else if (URL == "dictionary/dict_a.php") {
popper("dictionary/dict_a.php");
} else if (URL == "callMe.php") {
popper("callMe.php");
}
else if (URL == "complain.php") {
popper("complain.php");
}
else if (URL == "hancock.php") {
popper("hancock.php");
}
else if (URL == "archive.php") {
popper("archive.php");
}
else if (URL == "map_of_ipswich.php") {
theWindow = window.open("map_of_ipswich.php", "theWindow", "height=500, width=520, left=100, top=100, scrollbars=yes, resizable=yes, toolbar=no")
}
 else if (URL == "enquiry_form.php") {
popper("enquiry_form.php");
}
 else if (URL == "sipps.php") {
popper("sipps.php");
}else if (URL == "faq.php") {
popper("faq.php");
}else if (URL == "savingsCustInfo.php") {
popper("savingsCustInfo.php");
}else if (URL == "privacy.php") {
popper("privacy.php");
} else if (URL == "Please Select ..." || URL == "........................................") {
alert("Invalid Quick Links selection");
} else { window.location = URL; }
}
function draw_contact_menu()
{
	document.write('<ul id="sub_nav">');
	document.write('<li><a href="mailto:enquiries@ipswichbuildingsociety.co.uk?subject=Website%20Enquiry">Email Us</a></li>');
	document.write('<li><a href="javascript:getURL(\'enquiry_form.php\');">Enquiry Form</a></li>');
	document.write('<li><a href="branches.php?sub_area=agencies">Branches &amp; Agencies</a></li>');
	document.write('<li><a href="javascript:getURL(\'callMe.php.php\');">Call Me!</a></li>');			
	document.write('</ul>');
}


function show() {
	var content = document.getElementById('rates_table'); 
	content.className = 'rates_table_on';
	var button = document.getElementById('previous_rates');
	button.innerHTML = '<span onClick=\"javascript:hide();\">Hide Previous Rates</span>';
}
function hide() {
	var content = document.getElementById('rates_table'); 
	content.className = 'rates_table_off';
	var button = document.getElementById('previous_rates');
	button.innerHTML = '<span onClick=\"javascript:show();\">View Previous Rates</span>';
}

