function swap_Layers(layer1,vis1) 
{
var obj1;
if (document.getElementById) { 
//NS6+MSIE5
obj1 = document.getElementById(layer1).style; 
} else if (document.all) { 
//MSIE4 
obj1 = document.all[layer1].style; 
} else if (document.layers) {
//NS4.x 
obj1 = document.layers[layer1]; 
}
obj1.visibility = vis1;
}



function Check()
{
if (document.all) { 
CheckIE();
} else { 
CheckNS(); 
}
}


function CheckNS()
{
var fn = document.info.First_Name.value;
var ln = document.info.Last_Name.value;
var em = document.info.EMAIL.value;
var co = document.info.COMMENTS.value;



var string1 = document.info.EMAIL.value;
if (string1.indexOf("@")==-1)
{
em = "";
} else {
}



var loopthru = new Array(fn, ln, em, co);
var trigger = "20";

var require = new Array("First Name", "Last Name", "Email", "Comments");
var result = "";

for (loop=0; loop < 4; loop++)
{
if (loopthru[loop] == "" || loopthru[loop] == " ")
{
trigger = loop;
result = result + require[loop] + "\n";
} else {
}
}

if (trigger == "20") {
InfoEmailPost(em,ln,fn);
} else {
window.alert("Please complete the following fields \nbefore submitting this form: \n\n" + result);
}
}


function CheckIE()
{
var fn = document.info.First_Name.value;
var ln = document.info.Last_Name.value;
var em = document.info.EMAIL.value;
var co = document.info.COMMENTS.value;


var string1=document.info.EMAIL.value;
if (string1.indexOf("@")==-1)
{
em = "";
} else {
}


var loopthru = new Array(fn, ln, em, co);
var trigger = "20";
var require = new Array("layer1", "layer2", "layer3", "layer4");


for (loop=0; loop < 4; loop++)
{

if (loopthru[loop] == "" || loopthru[loop] == " ")
{

trigger = loop;

swap_Layers(require[loop],'visible');
var showit = "document.all." + require[loop] + ".style.display = ''";
eval (showit);
} else {
swap_Layers(require[loop],'hidden');
var showit = "document.all." + require[loop] + ".style.display = 'none'";
eval (showit);
}

swap_Layers('layer_message','visible');
document.all.layer_message.style.display = '';
}

if (trigger == "20") {
swap_Layers('layer_message','hidden');
document.all.layer_message.style.display = 'none';


InfoEmailPost(em,ln,fn);
} else {
self.scrollTo(0,175);
}
}

function InfoEmailPost(em,ln,fn)
{
document.info.email.value = em;
document.info.first_name.value = fn;
document.info.last_name.value = ln;

document.info.NAME.value = fn + " " + ln;
document.info.First_Name.value = "";
document.info.Last_Name.value = "";

this.document.info.submit();
}

function Redirect_Test_Only()
{
window.location.href = "ethanks.htm";
}

