var flashVer = 8;
var _uacct = 'UA-129049-9';
function initWakeyz(server, version, jump, refer) {
	urchinTracker();
	var nf = getElement('noflash');
	var userVer = deconcept.SWFObjectUtil.getPlayerVersion().major;
	if (userVer<flashVer) {
		urchinTracker('Flash upgrade from: v'+userVer);
		nf.style.visibility = 'visible';
	}
	var so = new SWFObject(version+'.swf', 'wakeyz', '100%', '100%', flashVer, '#ffff00');
	so.addParam('quality', 'best');
	if (server.indexOf('wakeyz.com')>-1) {
		so.addVariable('production', 'true');
	}
	if (jump) {
		so.addVariable('jump', jump)
	}
	if (refer) {
		urchinTracker('User referred from email');
	}
	//so.useExpressInstall('support/swf/expressinstall.swf');
	so.write('flash');
}
var popWin;
function legalWin() {
	if (!popWin || popWin.closed) {
		popWin = window.open('legal.html', 'popup', 'width=300,height=150,resizable=0,scrollbars=1,toolbar=0,menubar=0,location=0,status=0,directories=0');
	}
	if (window.focus) {
		popWin.focus();
	}
}
var delWin;
function deliciousWin() {
	if (!delWin || delWin.closed) {
		delWin = window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious', 'width=700,height=400,resizable=0,scrollbars=1,toolbar=0,menubar=0,location=0,status=0,directories=0');
	}
	if (window.focus) {
		delWin.focus();
	}
}
function divWrite(div, html) {
	var div = getElement(div);
	if (document.getElementById) {
		div.innerHTML = '';
		div.innerHTML = html;
	} else if (document.all) {
		div.innerHTML = html;
	} else if (document.layers) {
		div.document.open();
		div.document.write(html);
		div.document.close();
	}
}
function getElement(id) {
	var elem;
	if (document.getElementById) {
		elem = document.getElementById(id);
	} else if (document.all) {
		elem = document.all[id];
	} else if (document.layers) {
		elem = document.layers[id];
	}
	return elem;
}

/* ATLAS TRACKING */
var TrackTag = 'http://switch.atdmt.com/action/';
function GetActionTag(URL){ 
	document.action_tag.src = TrackTag + URL;
}