function _pm_sa(r,v){ r = r.length ? '#pm_c ' + r : '#pm_c'; v = 'min-height:1%;' + v; if (document.styleSheets){if (document.styleSheets[0].addRule){document.styleSheets[0].addRule(r,v,0);}else{document.styleSheets[0].insertRule(r+'{'+v+'}',0);}}}

function _pm_st(){
 var ie6  = (typeof document.body.style.maxHeight == "undefined");
 var ie7p = (document.all && !window.opera && window.XMLHttpRequest);
 _pm_sa('','font-family:sans-serif !important; width:170px!important;height:130px!important; border:solid 1px #000; font-size:12px;color:#000000;background: #ffffff;');
 _pm_sa('.h1','background-color:#b04e16; color:#fff;margin:0px');
 _pm_sa('h1#hd','background-color:#b04e16; color:#fff; font-size:13px; padding:3px 0px 3px 3px; margin-top:0; margin-bottom:0');
 _pm_sa('h1#hd a','font-family:sans-serif !important; font-weight:bold; text-decoration: none;color:#fff');
 _pm_sa('#nav img','border:0;right:5px; margin-top:10px');
 _pm_sa('ul','display:inline !important; padding: 0; margin: 0 !important;');
 _pm_sa('#nav','padding: 0; margin: 0; list-style: none; position:relative; float:right;');
 _pm_sa('#nav ul','padding: 0; margin: 0; list-style: none; position:relative; float:right;');
 _pm_sa('#nav a','text-decoration:none; padding:30px 5px 30px 15px');
 _pm_sa('#nav li','list-style: none; display:inline; color:#ffffff; width:30px;');
 _pm_sa('#nav li ul','list-style: none; position: absolute; top:21px; background: #efefef;  width: 140px; left: -999em;');
 _pm_sa('#nav li:hover ul','background: #efefef; color:#000 ;left:-109px; padding-right:0px');
 _pm_sa('#nav li.over ul','background: #efefef; color:#000 ;left:-109px; padding-right:0px');
 _pm_sa('#nav li.sfhover ul','background: #efefef; left:-108px;');
 _pm_sa('#nav li ul li','list-style: none;  list-style-image:none !important; width:140px; line-height:1.5em; border-bottom: solid 1px #ccc !important;');
 _pm_sa('#nav li ul li','list-style-image:none !important; margin-left:0 !important; padding:0');
 _pm_sa('#nav ul li:hover','background: #b04e16;');
 _pm_sa('#nav li ul li.over','background: #b04e16;');
 _pm_sa('#nav li:hover ul li a','text-decoration: none; padding:0; display:inline-block; width:140px!important; color:#000000!important');
 _pm_sa('#nav li:hover ul li a:hover','background: #b04e16;  color:#ffffff !important;');
 _pm_sa('#nav li.over ul li a.over','background: #b04e16;  color:#ffffff !important;');
 _pm_sa('#nav li.sfhover ul li','background: #efefef;');
 _pm_sa('#nav li.over ul li a.over','background: #b04e16;  color:#ffffff !important;');
 _pm_sa('#nav li:hover ul li a:hover','background: #b04e16;  color:#ffffff !important;');
 if (ie6){   
  _pm_sa('','height:130px!important;padding-bottom: 0px!important;overflow:hidden');
  _pm_sa('#master','padding-bottom:0px!important;margin-bottom:0px!important;');
  _pm_sa('#nav li ul','top:18px;');
  _pm_sa('#nav li ul li','margin-left:-2px !important;');
  _pm_sa('#nav li ul li a','padding:2px 5px;');
 }
 if (ie7p || ie6){
  _pm_sa('#nav li ul li','margin-left:-2px !important; padding-left:5px');
  _pm_sa('#nav li ul','top:15px;');
  _pm_sa('#nav li ul li a','text-decoration: none;  padding:2px 5px;color:#000000;');
  _pm_sa('#nav li.sfhover ul','background: #efefef !important; left:-110px !important;');
 }
 if (ie6 || ie7p){
  _pm_sa('#submit','margin-top:4px!important;');
 }
}
function _pm_fr(act){
 return '<div id="master" style="padding:5px; margin-top:0;"><form action="'+act+'#loan-calculator" method="post" target="_blank" style="margin-top:10px;"><fieldset style="margin:0; padding:0; border:0;"><input type="text" id="amount" name="amount" size="6" value="10000" style="float:right;"/><label for="amount" id="amount_label">Amount (&pound;)</label><br style="clear:right;"/><input type="text" id="apr" name="apr" size="6" value="8" style="float:right;"/><label for="apr" id="apr_label">APR (%)</label><br style="clear:right;"/><input type="text" id="term" name="term" size="4" value="60" style="float:right;"/><label for="term" id="term_label">Term (months)</label><div style="clear:both; text-align:center;" id="subdiv"><input id="submit" type="submit" name="submit" value="Calculate" style="margin-top:7px; font-size:smaller;"/></div></fieldset></form></div>';
}
function _pm_ce(e) { return document.createElement(e); }
function _pm_ge(e) { return document.getElementByID ? document.getElementByID(i) : (document.all ? document.all(i) : null); }
function _pm_cc(p) { var l ='<ul>';for(i in p) { l += '<li this.className+=\' sfhover\';" onmouseout="this.className=this.className.replace(new RegExp(\' sfhover\'), \' \');"><a href="'+ p[i]+'" target="_blank">'+i+'</a><br /></li>';}l += '</ul>';return l;}
function _pm_init(){
 var d=_pm_ce('div');
 if (_pm_sc){
  _pm_st();
  d.innerHTML = '<div id="pm_c"><div class="h1"><ul id="nav"><li>'+ _pmM + _pm_cc(_pmCalc) +  '</li></ul><h1 id="hd">'+_pmC+'</h1></div>'+_pm_fr(_pmH) + '</div>';
  _pm_sc.parentNode.insertBefore(d.cloneNode(true),_pm_sc);
 }
}

