function WriteString(str) {
	document.write(str);
	return;
}

function WriteContactUsLink() {
	var use_string = '<a href="mailto:contactbutdontspammedealstalkersthereprobablyshouldbeadotherecomputer">contactbutdontspammedealstalkersthereprobablyshouldbeadotherecomputer</a>';
	use_string = use_string.replace('butdontspamme', '@');
	use_string = use_string.replace('butdontspamme', '@');
	use_string = use_string.replace('thereprobablyshouldbeadothere', '.');
	use_string = use_string.replace('thereprobablyshouldbeadothere', '.');
	use_string = use_string.replace('computer', 'com');
	use_string = use_string.replace('computer', 'com');
	WriteString(use_string);
	
	return;
}



/***** FADING TEXT FUNCTIONS *****/
var colors = new Array('FFFFFF','EEEEEE','DDDDDD','CCCCCC','BBBBBB','AAAAAA','999999','888888','777777','666666','555555','444444','333333','222222','111111','000000');

var messages = new Array();
messages.push('We know where the deals are... at all times!');
messages.push('We\'re watching the deals, 24/7!');
messages.push('Following the deals, wherever they go!');
messages.push('Stalking... in a good way!');
messages.push('We\'re Deal Stalkers, and proud of it!');
messages.push('Deal Stalking season is open!');
messages.push('We\'re obsessed... with shopping!');
messages.push('Stalk before you shop!');
messages.push('We know what your deal is!');

function rand (n) {
  return Math.floor ((Math.random () *  n) + 1);
}

function GetColor(num) {
	return colors[num];
}

function GetMessage(num) {
	return messages[num];
}

function FadeIn(num) {
	var newnum = num;

	// do fade in 
	document.getElementById('fading_text').style.color = GetColor(num);
	
	// check for end of in fade, start fade out if necessary
	if (num == (colors.length - 1)) {
		newnum--;
		setTimeout('FadeOut(' + newnum + ')', 5000);
	} else {
		newnum++;
		setTimeout('FadeIn(' + newnum + ')', 50);
	}
	return;
}

function FadeOut(num) {
	var newnum = num;
	
	// do fade out
	document.getElementById('fading_text').style.color = GetColor(num);
	
	// check for end of out fade, change if necessary
	if (num == 0) {
		SelectMessage();
		setTimeout('FadeIn(0)', 50);
	} else {
		newnum--;
		setTimeout('FadeOut(' + newnum + ')', 50);
	}
	return;
}

function SelectMessage() {
	document.getElementById('fading_text').innerHTML = GetMessage(rand(messages.length - 1));
	return;
}

function StartFading() {
	SelectMessage();
	FadeIn(0);
	return;
}



