<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->

<!--
var expires = 180;
var today = new Date();
var expr = new Date(today.getTime() + (expires * 86400000));
var affidstr = window.location.search.substring(1,6);

if (affidstr == "affid") {
   var idnum = window.location.search.substring(7);
   if (idnum) {
      var name = 'affiliate';
      var value = idnum;
      var path = '/';
      document.cookie = name + "=" +escape(value) +
      ( (expires) ? ";expires=" + expr.toGMTString() : "") +
      ( (path) ? ";path=" + path : "");
   }
}
// -->

<!--
function procString(name) {
    return unescape(name);
}

function setupForm() {
	if (HWsaver) getValues(HWsaver);
	if (document.jForm.amount.value>0){
		value_change();
	}
}

//----change this function-----------------------------------------------------
function getValues(string) {
    // getValue(string, "username", document.jForm.username,  "text");
    getValue(string, "amount", document.jForm.amount,  "text");
    getValue(string, "comm",   document.jForm.comm, "text");
    getValue(string, "saving",   document.jForm.saving, "text");

}
//-----------------------------------------------------------------------------

function replace(string,text,by) {
// Replaces text with by in string
    var i = string.indexOf(text);
    var newstr = '';
    if ((!i) || (i == -1)) return string;
    newstr += string.substring(0,i) + by;

    if (i+text.length < string.length)
        newstr += replace(string.substring(i+text.length,string.length),text,by);

    return newstr;
}

function getValue(string,elementName,object,elementType) {
// gets value of elementName from string and populates object of elementType

    var startPos = string.indexOf(elementName + "=")

    if (startPos > -1) {
        startPos = startPos + elementName.length + 1;
        var endPos = string.indexOf("&",startPos);
        if (endPos == -1) endPos = string.length;

        var elementValue = unescape(string.substring(startPos,endPos));

        if (elementType == "text")     object.value = elementValue;
        if (elementType == "password") object.value = elementValue;
        if (elementType == "select")   object.selectedIndex = elementValue;
        if (elementType == "checkbox") object.checked = onCheck(elementValue);
        if (elementType == "radio")    object[elementValue].checked = true;
    }
}

function amountify(amount)
{
        // remove all commas
        // remove pound symbols
        amount = replace(amount,",","");
        amount = replace(amount,"?","");
        // if a K is present replace with a . then x by 1000
        // if there are still dots present round down.
        amount = replace(amount,"K","k");
        var i = amount.indexOf("k");
        amount = replace(amount,"k",".");
        if (i != -1) amount = amount * 1000;

		if (!amount>0) amount=0;
		return amount;
}
//-->

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->