// js functions - byron rode
// pop in - 15 second offer
function InitiateCounter(secs, thePopin) {
	
	var seconds = secs;
	var pause = 1000;
	var container = document.getElementById('seconds');
	
	container.count = function(seconds){
		container.innerHTML = seconds
		
		// show double digit format for seconds
		if(seconds < 10) { container.innerHTML = '0' + seconds; }
		if(seconds == 0) {
			container.innerHTML = '0' + seconds;
			closePopin(thePopin);
			closeBox = 'true';
			return;
		}
		
		// set countdown and add a 1 second pause between counts
		setTimeout(
			function(){
				container.count(seconds - 1);
			}, pause);
	}
	container.count(seconds);
}

function closePopin(theDiv){
	var divToClose = theDiv;
	var theCookie = Cookie.write('show_Window', 'false', { duration: 10});
	var myFx = divToClose.fade('out', {duration: 1});
}

function trackClick(url, aid, atxt) {
	if(document.images){
        (new Image()).src="js/clicktracker-br.asp?atxt=" + atxt;
    }
    return true;
}