 var milisec=0;
 var seconds=0;
 var minutes=0;
 
 
function swaplayer(div_id,div_name,tab_name,notabs) {
if (notabs == 6) {
backon = '#40b5c9';
backoff = '#327884';
}
else
{
backon = '#40b5c9';
backoff = '#327884';
}
	for (looper = 1; looper < notabs; looper++) {
		if (looper == div_id) {
			document.getElementById(div_name + looper).style.display = 'block';
			document.getElementById(tab_name + looper).style.background = backon;
		}
		else {
			document.getElementById(div_name + looper).style.display = 'none';
			document.getElementById(tab_name + looper).style.background = backoff;
		}
	}
}

function countupper(){ 
 if (milisec>=9){ 
    milisec=0;
    seconds+=1;
 } 
 if (seconds>=59){ 
    milisec=0;
    seconds=0;
    minutes+=1;
 }
    milisec+=1;
    document.counter.d2.value=minutes+"."+seconds+"."+milisec;
    setTimeout("countupper()",100);
}



function singleSubmit(trgForm)
{
    trgForm.submitButton.disabled = true;
    trgForm.resetButton.disabled = true;
}

function resetDynamicFields()
{
	document.cpiForm.TimeStamp.value=new Date().valueOf();
}

function CheckSupportForm()
{errorfound = false;
	if (document.supportcalc.name.value == "")
	{document.getElementById('supportname').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('supportname').style.background = '#fff';}
	if (document.supportcalc.email.value.indexOf ('@',0) == -1 || document.supportcalc.email.value.indexOf ('.',0) == -1)
    {document.getElementById('supportemail').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('supportemail').style.background = '#fff';}
  if (errorfound) 
    return false;
	   else
		  return true;
}


function CheckContactForm()
{errorfound = false;
	if (document.signup.name.value == "")
	{document.getElementById('contactname').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('contactname').style.background = '#fff';}
	if (document.signup.companyrequires.value == "")
	{document.getElementById('contactrequire').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('contactrequire').style.background = '#fff';}
	if (document.signup.email.value.indexOf ('@',0) == -1 || document.signup.email.value.indexOf ('.',0) == -1)
    {document.getElementById('contactemail').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('contactemail').style.background = '#fff';}
  if (errorfound) 
    return false;
	   else
		  return true;
}


function CheckIPForm()
{errorfound = false;
	if (document.ipcheckx.myname.value == "")
	{document.getElementById('ipnamex').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('ipnamex').style.background = '#fff';}
	if (document.ipcheckx.email.value.indexOf ('@',0) == -1 || document.ipcheck.email.value.indexOf ('.',0) == -1)
    {document.getElementById('ipemailx').style.background = '#d4ffd4';
		errorfound = true}
		else
			{document.getElementById('ipemailx').style.background = '#fff';}
  if (errorfound) 
    return false;
	   else
		  return true;
}

