function popUpCalculators() {
  if (!document.getElementsByTagName) return false;
  if (!document.getElementById) return false;
  if (!document.getElementById("calclist")) return false;
  var calclist = document.getElementById("calclist");
  //var gallery = document.getElementById("motioncontainer");
  var links = calclist.getElementsByTagName("a");
  for ( var i=0; i < links.length; i++) {
    var linkPath = links[i].getAttribute("href");
	//var calcMonthlypayment=linkPath.indexOf('calc-monthlypayment');
	if (linkPath.indexOf('calc-monthlypayment')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-monthlypayment.php", "monthlypayment", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	} else if (linkPath.indexOf('calc-additionalpayment')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-additionalpayment.php", "additionalpayment", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	} else if (linkPath.indexOf('calc-earnhome')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-earnhome.php", "earnhome", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	} else if (linkPath.indexOf('calc-affordborrow')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-affordborrow.php", "affordborrow", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	} else if (linkPath.indexOf('calc-discount')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-discount.php", "discount", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	} else if (linkPath.indexOf('calc-recoup')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-recoup.php", "recoup", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	} else if (linkPath.indexOf('calc-deduct')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-deduct.php", "deduct", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	} else if (linkPath.indexOf('calc-biweeklypayment')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-biweeklypayment.php", "biweeklypayment", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	} else if (linkPath.indexOf('calc-apr')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-apr.php", "apr", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	} else if (linkPath.indexOf('calc-interestonly')>0){
		links[i].onclick = function() {
     	 window.open("/calculators/calc-interestonly.php", "interestonly", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=530,left = 376,top = 282");
		 return false;
    	}
	}
  }
}

addLoadEvent(popUpCalculators);