<!-- Javascript related to eval form -->

var _evalLink = '';

<!-- This is to insert eval number to the form automatically and saved the eval link (.exe link)-->
function insertEvalNum(evaln, evallink)
{
   var evnum = document.getElementById("evalnumber");
   evnum.value = evaln;
   var evnumcopy = document.getElementById("copyevalnumber");
   evnumcopy.value = evaln;
   
 	_evalLink = evallink;
	
   return true;
}

<!-- This function open the eval download dialog box-->
function openDownload()
{ 
	if(window.open(_evalLink,'mywindow','width=10,height=10'))
	{
		return true;
	}
	else return false;
		
} 


cookie_name = "smxrtos";
var YouEntered;

function putCookie() {

if(document.cookie != document.cookie) 
{index = document.cookie.indexOf(cookie_name);}
else 
{ index = -1;}

if (index == -1)
{
YouEntered = "mdismxrtos";
document.cookie=cookie_name+"="+YouEntered+"; expires=Monday, 04-Apr-2010 05:00:00 GMT";
}

}


var ph = "0123456789()-+ ";
var numb = "0123456789";
var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .-";
var alphanum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.-";
var mail = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.-_@";
var comment = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.-()_@#,";
function res(t,v){
var w = "";
for (i=0; i < t.value.length; i++) {
x = t.value.charAt(i);
if (v.indexOf(x,0) != -1)
w += x;
}
t.value = w;
}


function checkFields() {
//backdoor for @smxrtos.com user -- no need to fill up fields except email
email = document.contact_long.email.value;
domain = email.split('@');
if(domain[1] != null && domain[1].toLowerCase() == "smxrtos.com")
{
	return true;
}
											  
missinginfo = "";
if (document.contact_long.first_name.value == "") {
missinginfo += "\n     -  First Name";
}
if (document.contact_long.last_name.value == "") {
missinginfo += "\n     -  Last Name";
}
if (document.contact_long.company.value == "") {
missinginfo += "\n     -  Company";
}
if (document.contact_long.address.value == "") {
missinginfo += "\n     -  Address";
}
if (document.contact_long.city.value == "") {
missinginfo += "\n     -  City";
}
if (document.contact_long.state.value == "") {
missinginfo += "\n     -  State";
}
if (document.contact_long.zip.value == "") {
missinginfo += "\n     -  Zip Code";
}
if (document.contact_long.country.value == "") {
missinginfo += "\n     -  Country";
}
if (document.contact_long.email.value == "") {
missinginfo += "\n     -  Email";
}
if (document.contact_long.phone.value == "") {
missinginfo += "\n     -  Phone Number";
}
/* Uncomment this if evaluation period is submitted by user
if (document.contact_long.period.value == "") {
missinginfo += "\n     -  Evaluation Period";
}
*/

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"The following fields were left blank:\n" +
missinginfo + "\n_____________________________" +
"\nPlease complete the form and submit again!";
alert(missinginfo);
return false;
}
else return true;
}

<!-- This functions checks to make sure the user ticks the agreement checkbox-->
function checkAgreement() {
//backdoor for @smxrtos.com user -- no need to check the agreement box
email = document.contact_long.email.value;
domain = email.split('@');
if(domain[1] != null && domain[1].toLowerCase() == "smxrtos.com")
{
	return true;
}

if (document.contact_long.iagree.checked == false)
{
alert ('You must agree with the terms and conditions.');
return false;
}
else return true;
}