var counterx=1;
var counterxx=1;
var timerx;
var timer_is_on=0;
 
function timedCount()
{
	swapEm(counterx,counterxx)
	counterx=counterx+1;
	counterxx=counterxx+1;
	if (counterx == 4) {
		counterx = 1;
	}
	if (counterxx == 4) {
		counterxx = 1;
	}
	timerx=setTimeout("timedCount()",4000);
}
 
function doTimer()
{
if (!timer_is_on)
  {
  timer_is_on=1;
  timedCount();
  }
}
 
function swapEm(i,ii) {
//	swapdiv('homebasewrapper',i)
	swapnews('recitem',ii)
}


function swaplayer(img_name,div_id,countt) {
for(looper = 1; looper < countt; looper++) {
if (looper == div_id)
{ 
document.getElementById(img_name+looper).style.display = 'block'; 
}
else
{
document.getElementById(img_name+looper).style.display = 'none';
}
}}


function CheckContactForm()
{errorfound = false;
	if (document.xantus_contact_us.firstname.value == "")
	{document.getElementById('firstname').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('firstname').style.background = '#fff';}
	if (document.xantus_contact_us.mobile.value == "")
	{document.getElementById('mobile').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('mobile').style.background = '#fff';}
	if (document.xantus_contact_us.postcode.value == "")
	{document.getElementById('postcode').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('postcode').style.background = '#fff';}
	if (document.xantus_contact_us.email.value.indexOf ('@',0) == -1 || document.xantus_contact_us.email.value.indexOf ('.',0) == -1)
    {document.getElementById('email').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('email').style.background = '#fff';}
  if (errorfound) 
    return false;
	   else
		  return true;
}


function swapdiv(div_name,div_id) {
        for(looper = 1; looper < 4; looper++) {
			if( document.getElementById(div_name + looper)){
				if (looper == div_id ) {
				 document.getElementById(div_name + looper).style.display = 'block';
					
				}
				else {
				 document.getElementById(div_name + looper).style.display = 'none';
					 
				}
            }
        }
}


function swapnews(div_name,div_id) {
        for(looper = 1; looper < 4; looper++) {
			if( document.getElementById(div_name + looper)){
				if (looper == div_id ) {
				 document.getElementById(div_name + looper).style.display = 'block';
					
				}
				else {
				 document.getElementById(div_name + looper).style.display = 'none';
					 
				}
            }
        }
}

