/* i'n'stein solar Java<script> */

// window.onload = postload_init;

function writemail(mb,dm,tld,css) { 
document.write("<a class='mailto "+css+"' href='mai"+"lto:"+mb+"@"+dm+"."+tld+"'>"+mb+"@"+dm+"."+tld+"<\/a>");
}

String.prototype.splitCSV = function(sep) {
  for (var csvSplit = this.split(sep = sep || ","), x = csvSplit.length - 1, tl; x >= 0; x--) {
    if (csvSplit[x].replace(/"\s+$/, '"').charAt(csvSplit[x].length - 1) == '"') {
      if ((tl = csvSplit[x].replace(/^\s+"/, '"')).length > 1 && tl.charAt(0) == '"') {
        csvSplit[x] = csvSplit[x].replace(/^\s*"|"\s*$/g, '').replace(/""/g, '"');
      } else if (x) {
        csvSplit.splice(x - 1, 2, [csvSplit[x - 1], csvSplit[x]].join(sep));
      } else csvSplit = csvSplit.shift().split(sep).concat(csvSplit);
    } else csvSplit[x].replace(/""/g, '"');
  } return csvSplit;
}; // nice one from www.greywyvern.com, thanks!


Number.prototype.formatMoney = function(c, d, t){
var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
   return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
 };

 
function checkCookie() {
document.cookie = "ctest=ok";
if (document.cookie.length==0) { return false; }
else { document.cookie = "ctest=ok; expires=Thu, 01-Jan-70 00:00:01 GMT"; return true; }
}
