<!--

function salesrep()
{
return ("Marian now on +27 (0)72 4198 601 ");
}

function salestel()
{
return ("+27 (0)72 4198 601 ");
}


function unMangle() {
	var at = / at /;
	var dot = / dot /g;
	var address = this.getAttribute("title");
	var subject = document.title;

	address = address.replace(at, "@");
	address = address.replace(dot, ".");
	address = address.replace(" " , "");

	this.innerHTML = address;
	this.setAttribute("href", "mailto:"+address+"?subject="+subject);
	this.setAttribute("title", address);
	this.onmouseover = null;
}
function fixLinks() {
	if (!document.getElementsByTagName && !document.createElement &&
		!document.createTextNode) return;
	var nodes = document.getElementsByTagName("*");
	for(var i=nodes.length-1;i>=0;i--) {
		if (nodes[i].className.search("change")>=0) {
			var node = document.createElement("a");
			node.setAttribute("href", "mailto:");
			node.setAttribute("title", nodes[i].innerHTML);
			node.innerHTML = nodes[i].innerHTML;
			node.onmouseover = unMangle;
			/* node.onclick = unMangle; */

			var prnt = nodes[i].parentNode;
			for(var j=0;j<prnt.childNodes.length;j++)
				if (prnt.childNodes[j] == nodes[i]) {
					if (!prnt.replaceChild) return;
					prnt.replaceChild(node, prnt.childNodes[j]);
					break;
				}
		}
	}
}

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}
/* addLoadEvent(function() {
	document.body.style.backgroundColor = 'yellow';
	document.body.appendChild(document.createTextNode('A Great'));  
	document.body.appendChild(document.createTextNode(' Body OnLoad Example!'));
}) */
addLoadEvent(function() {
  fixLinks();
});



Date.prototype.getWeek = function() {
    var determinedate = new Date();
    determinedate.setFullYear(this.getFullYear(), this.getMonth(), this.getDate());
    var D = determinedate.getDay();
    if(D == 0) D = 7;
    determinedate.setDate(determinedate.getDate() + (4 - D));
    var YN = determinedate.getFullYear();
    var ZBDoCY = Math.floor((determinedate.getTime() - new Date(YN, 0, 1, -6)) / 86400000);
    var WN = 1 + Math.floor(ZBDoCY / 7);
    return WN;
}



function dolink(part1, part2 ){

//* ---- Change first part to Title Text ----- *//

var fName = part1.charAt(0).toUpperCase()+ part1.substr(1, part1.length-1);
var fName = (fName.split(".",1));
var eDept = (part1.split("."));
var eDept = (eDept[1]);

var eDom = 'replenishnaturally.co.za';
var wPage = (document.title);
var wLocat = (document.location);
datetoday = new Date();
	timenow=datetoday.getTime();
	datetoday.setTime(timenow);
	thehour = datetoday.getHours();
	theday = datetoday.getMonth();
	if (thehour >= 18) gtod = "evening";
	else if (thehour >= 12) gtod = "afternoon";
	else gtod = "morning";
	var greeting = ("Good " + gtod + " ");

var weekno = datetoday.getWeek();
	if (weekno <= 9) weekno = "0"+weekno;
	else weekno = weekno;
var month=new Array(12);
	month[0]="A";
	month[1]="B";
	month[2]="C";
	month[3]="D";
	month[4]="E";
	month[5]="F";
	month[6]="G";
	month[7]="H";
	month[8]="I";
	month[9]="J";
	month[10]="K";
	month[11]="L";
var mnth = month[datetoday.getMonth()];
var day = datetoday.getDate();
	if (day <= 9) day = "0"+day;
	else day = day;
var min = datetoday.getHours()*60+(datetoday.getMinutes());
	if (min <= 999) min = "0"+min;
	else min = min;

var weekno = datetoday.getWeek();
	if (weekno <= 9) weekno = "0"+weekno;
	else weekno = weekno;

var orderNo = mnth + (day + min);

var wPage = document.title;
var wLocat = document.location;

link = 'ma'+'ilto'+':"'+fName+' at ' +eDom+'"\<' + eDept + '@' +eDom+'\>?subject=Replenish-Q'+ orderNo +' - Web Query&body='+greeting+fName+',%0A%0A %0A%0A';
var ans = confirm ('You are about to email '+fName+' on \<'+ eDept + '@' +eDom+'\>')

    if(ans) {
	return link;
	} else {
		alert('Please telephone +27 (0)72 4198 601 and '+fName+' will help you!');
		/* window.location = 'http://www.replenishnaturally.co.za/about'; */
		/* return showForm();*/
		return wLocat;
    }
}
/*  <p><strong>Email:</strong> <a title="replenishnaturally.co.za" onclick="location.href = dolink(this.name, this.title ); return false;" name="Marian.shop" href="?page_id=2">Replenish</a></p> */
-->
