// ----- CMO Header ------

// Module: cmohdr.js	Version 1.8

// Date 26.4.2001

// Author Rod Fletcher

// This script is Copyright ©1999 - 2008 Rod and Sue Fletcher.

/* Maintenance ----------------
	
   Version 1.0 to 1.1 - 15.8.2001 Allow for IE6
   
   Version 1.1 to 1.2 - 28.8.2001 To block NN6.1
   
   Version 1.2 to 1.3 - 24.4.2002 Allow for Mozilla 1.0
   
   Version 1.3 to 1.4 - 28.6.2002 Updated domType determination
   
   Version 1.4 to 1.5 - 15.11.2005 Block NN4
   
   Version 1.5 to 1.6 - 17.02.2006 Allow IE7

   Version 1.6 to 1.7 - 29.12.2007 Allow Mac & clean-up browser checking
   
   Version 1.7 to 1.8 - 08.09.2008 Allow IE8
------------------------------- */

var domType = '0DOM0';

var now = new Date();
var timeNow = now.getTime();
var cookies = document.cookie;

if (cookies.indexOf('checkCookie=cmonline') != -1) {		 // if user has already been to home page this complies with Google Adwords, i.e. the back button allows user to go back to Google
	document.cookie = "checkCookie=gone; path=/";	
	history.back();
}

function mainline () {

	determineDom();
	counter();
}






function determineDom() {

	
	var NN61 = /Netscape6\/6.1/; 				//regexp for Netscape 6.1 - finds 'Netscape6/6.1'.
	
	var gecko = /Gecko/;							//regexp for Gecko based browsers - finds 'Gecko'.
	
	var IE5678 = /MSIE [5678](.d+)?/;			//regexp for IE5, 6, 7 and 8 - finds 'MSIE5.x' or 'MSIE6.x' or 'MSIE7.x' or 'MSIE8.x'

	var opera = /Opera/;							//regexp for Opera browser - finds 'Opera'.





	
	// re-directs NN6.1

	if (NN61.test(navigator.userAgent)) {
		
		return;
	}




	// Test for Gecko

	if (gecko.test(navigator.userAgent)) {

		domType = '1NN6+';
	}




	// Test for IE5/6/7/8
	
	if ((IE5678.test(navigator.userAgent)) && (opera.test(navigator.userAgent) == false)) {
	
		 domType = '1IE5+';	
	}
	

}






function counter() {
	
	switch(domType) {
	


		case '1NN6+':

			location = 'http://www.cmonline.co.uk/cgi-bin-local/cmocounter.pl?cmohomedom1.html' + domType + timeNow;
			break;
			
			
		case '1IE5+':

			location = 'http://www.cmonline.co.uk/cgi-bin-local/cmocounter.pl?cmohomedom1.html' + domType + timeNow;
			break;
			
		case '0DOM0':

			location = 'http://www.cmonline.co.uk/cgi-bin-local/cmocounter.pl'; 
			break;
	}
}


// END
