/* Copyright (c) 2011, Absolute Futurity.  All rights reserved. http://www.absolutefuturity.com */
/* Authorized use for Vopnet mobile */

var bretest=false;
var bdisabled=true;


function validatetest()
{
	if (!(window.document.getElementById('isp').value=='') || (!(window.document.getElementById('otherisptext').value=='') && window.document.getElementById('otherisp').checked)){
		pvdr=window.document.getElementById('isp').value;
		if (!(window.document.getElementById('otherisptext').value=='') && window.document.getElementById('otherisp').checked) pvdr=window.document.getElementById('form1').otherisptext.value;
		if (testrunning){
			buttonpress('test','disable');
//			window.document.getElementById('test').disabled=true;
		} else {
			buttonpress('test','enable');
//			window.document.getElementById('test').disabled=false;
		}
	} else {
		buttonpress('test','disable');
//		window.document.getElementById('test').disabled=true;
	}
}


function buttonpress(bid,bcondition)
{
	if (bdisabled && bcondition != "enable") {
		if (bcondition == "test") bretest=false;
		if (bcondition == "retest") bretest=true;
		if (bretest) {window.document.getElementById(bid).src="images/rstrttest-disabled.png"} else {window.document.getElementById(bid).src="images/strttest-disabled.png"}
	} else {
		switch (bcondition){
			case "normal":
				if (bretest) {window.document.getElementById(bid).src="images/rstrttest-normal.png"} else {window.document.getElementById(bid).src="images/strttest-normal.png"}
				break;
			case "pressed":
				if (bretest) {window.document.getElementById(bid).src="images/rstrttest-pressed.png"} else {window.document.getElementById(bid).src="images/strttest-pressed.png"}
				break;
			case "highlight":
				if (bretest) {window.document.getElementById(bid).src="images/rstrttest-highlight.png"} else {window.document.getElementById(bid).src="images/strttest-highlight.png"}
				break;
			case "disable":
				bdisabled=true;
				if (bretest) {window.document.getElementById(bid).src="images/rstrttest-disabled.png"} else {window.document.getElementById(bid).src="images/strttest-disabled.png"}
				break;
			case "enable":
				bdisabled=false;
				if (bretest) {window.document.getElementById(bid).src="images/rstrttest-normal.png"} else {window.document.getElementById(bid).src="images/strttest-normal.png"}
				break;
			case "retest":
				bretest=true;
				if (bretest) {window.document.getElementById(bid).src="images/rstrttest-normal.png"} else {window.document.getElementById(bid).src="images/strttest-normal.png"}
				break;
			case "test":
				bretest=false;
				if (bretest) {window.document.getElementById(bid).src="images/rstrttest-normal.png"} else {window.document.getElementById(bid).src="images/strttest-normal.png"}
				break;
		}
	}
}

