//counterref = "http://www.kenda.co.uk/cgi-bin/counter.pl?" + location.href;
//window.open(counterref,'counter','width=1,height=1,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');

function topdfcount(){
	page = "http://www.kendata.com/topdfcounter.html";
	window.open(page,'topdfcounter','width=400,height=60,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
}

//Script to make Info form only open once a day.
//Set the page to open
var page = "mform.html";
//Set the variables for the size of the marketing window
var windowprops = "width=240,height=280,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no";


//This function gets called by every page
function market() {									
	
	//check if cookie exists
	
	if (document.cookie =='') {

		//if the does not exist run the write cookie function
	
		writeCookie();

		//then open the marketing form
		
//		window.open(page, "", windowprops);
		}
}

//This function is called by the market() function
function writeCookie() {

		//set the number of days ahead you wish the cookie to expire

		var expDays = 1

		//set a date expression as todays date
		
		var exp = new Date(); 

		//Set a Date the number of days set in expDays ahead of todays date (which you have set above)
		//you are setting the time of exp to be the number of miliseconds since 1970 plus the number of days set above

		exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

		//Convert the drivel which was returned above to a GMT date string
	
		var exp_date = exp.toGMTString();
	
		//Write the cookie string to expire
		
		var the_cookie = "my_cookie=kenda;expires=" + exp_date;


		//write the cookie
		
		document.cookie = the_cookie;

}
//  End of Cookie check



function formHandler(form){
	var URL = document.form.site.options[document.form.site.selectedIndex].value;
	if (URL =="") return false;
	window.location.href = URL;
}


function validemail() {

	var foundAt = document.zine.email.value.indexOf("@",0)
	var founddot = document.zine.email.value.indexOf(".",foundAt)
	if (foundAt < 1 || founddot < (foundAt+2)) {
		alert("You have not entered a valid Email address");
		document.zine.email.select();
		return false;
	}
}

function setfocus(name)
{
   var e = document.getElementById(name);

   if (e)
	   e.focus();
}
