function mask(end,middle,start,subject){
var one ='mai';
var two='lto:';
var three='?Subject=';
//start,middle,end,subject;
var putogether= one+two+start+middle+end+three+subject;
document.location.href=eval('"'+putogether+'"');
window.status=putogether;
}

function cm()
{
	q = 0;
	if(navigator.appName == "Microsoft Internet Explorer")
	{ 
		q = q + 1;
	}
  	if(navigator.appVersion.substring(0,1) > 3)
	{ 
		q = q + 1;
	}
	if(navigator.platform == 'Win32')
	{ 
		q = q + 1;
	}
	if (q == 3)	
	{
		messagearea.className = 'msg';
		IE4msg.className = 'hidden'
		hide4.className = 'hidden'
	}
}

function checkarea(me)
{
	if (me.value != 'none')	document.areamust.src = 'maydo.gif';
	else document.areamust.src = 'mustdo.gif';
	
	if (me.value == 'Other') 
		{
		message.areaother.className = 'None';
		checkareaother();
		}
	else 
		{
		message.areaother.className = 'hidden';
		document.atm.src = 'maydo.gif';
		}
	if (me.value == 'main') checkmain();
}

function checkmain()
{
	
	if(document.message.area.value == 'giveninmessage')
	{
		if (document.message.main.value.length > 0) 
		{
			document.mmx.src = 'maydo.gif';
		}
		else 
		{
			document.mmx.src = 'mustdo.gif';
		}
	}
	else
	{
		document.mmx.src = 'maydo.gif';
	}
}

function checkareaother()
{
	if (document.message.areaother.value.length > 0) document.atm.src = 'maydo.gif';
	else document.atm.src = 'mustdo.gif';
}
	
function checktitle(me)
{
	if (me.value != 'none')	document.titlemust.src = 'maydo.gif';
	else document.titlemust.src = 'mustdo.gif';
	
	if (me.value == 'Other') 
		{
		message.titleother.className = 'None';
		checktitleother();
		}
	else 
		{
		message.titleother.className = 'hidden';
		document.xxm.src = 'maydo.gif';
		}
}

function checktitleother()
{
	if (document.message.titleother.value.length > 0) document.xxm.src = 'maydo.gif';
	else 
	{
	document.xxm.src = 'mustdo.gif';
	}
}

function checkfirst(me)
{
	if (me.value.length > 0) document.fnx.src = 'maydo.gif';
	else 
	{
	document.fnx.src = 'mustdo.gif';
	}
}

function checklast(me)
{
	if (me.value.length > 0) document.lnx.src = 'maydo.gif';
	else 
	{
	document.lnx.src = 'mustdo.gif';
	}
}

function checkemail(act)
{
	document.all.eml.className = 'txt hidden';
	document.all.emc.className = 'txt hidden';
	if (document.message.email.value.length > 0)
		if (checkmailaddress(act)) 
		{
			document.emx.src = 'maydo.gif';
		}
		else
		{
			document.emx.src = 'mustdo.gif';
		}
	else 
	{
		if (document.message.usetelephone.value == 'no') document.emx.src = 'mustdo.gif';
		else document.emx.src = 'maydo.gif';
	}
}

function checkmailaddress(kx)
{
	var emailFilter = /^.+@.+\..{2,4}$/;
	
	if (!(emailFilter.test(message.email.value))) 
	{
		if (kx == 1)

		{
			document.all.eml.className = 'txt red';
			document.all.emc.className = 'txt hidden';
		}

		/*alert("The e-mail address you have given is not in the normal form. Please give a normal e-mail address(e.g. user@domain.com).");
		*/	
		vm();		
		return false;
	} 
	else 
	{
		var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
		if (message.email.value.match(illegalChars)) 
		{
			document.all.eml.className = 'txt hidden';
			document.all.emc.className = 'txt red';
			/*alert("The e-mail address you have given contains illegal characters. Please enter a valid e-mail address (e.g. user@domain.com).");
			*/
			vm();			
			return false;
		}
	}
	/*document.all.eml.className = 'txt hidden';
	document.all.emc.className = 'txt hidden';*/
	vm();
	return true;	

}


function checktelephone()
{
	
	showbox='no';
	if (document.message.usetelephone.value == 'yes')
	{
		/*alert(document.message.phone.value.length);*/
		if(document.message.icode.value == 'none') showbox = 'yes';
		if(document.message.phone.value.length < 1) showbox = 'yes';
	}
	if (showbox == 'yes')
	{
		document.tnx.src = 'mustdo.gif';
	}
	else
	{
		document.tnx.src = 'maydo.gif';
	}
	checktnumber();
}
	
function checktnumber()
{
	var dored=0;
	strTest = document.message.phone.value;
	if (strTest.length > 0)
	{
		for (i=0; i<strTest.length;i++)
		{
			tChar = strTest.charAt(i);
			/*alert(i + ": " + tChar );*/
			switch (tChar)
			{
			case " ":
			break;
			
			case "0":
			break;
			
			case "1":
			break;
			
			case "2":
			break;
			
			case "3":
			break;
			
			case "4":
			break;
			
			case "5":
			break;
			
			case "6":
			break;
			
			case "7":
			break;
			
			case "8":
			break;
			
			case "9":
			break;
			
			default:
				dored=1;
			break;
			}
		}
	}
	if (dored==1)
	{ 
		document.all.nsdo.className = 'txt red';
		document.btx.src = 'mustdo.gif';
	}
	else
	{
		document.all.nsdo.className = 'txt hidden';
		document.btx.src = 'maydo.gif';
	}
	
}


function docheckbox(me)
{
	if (me.value == 'no') me.value = 'yes';
	else me.value = 'no';
}
 
function vm()
{
/*
document.all.nsdo.className = 'txt red'
document.all.emc.className = 'txt red'
document.areamust.src = 'mustdo.gif'
document.atm.src = 'mustdo.gif'
document.mmx.src = 'mustdo.gif'
document.titlemust.src = 'mustdo.gif'
document.xxm.src = 'mustdo.gif'
document.fnx.src = 'mustdo.gif';
document.lnx.src = 'mustdo.gif';
document.emx.src = 'maydo.gif'
document.tnx.src = 'mustdo.gif'
document.btx.src = 'mustdo.gif'
*/
	var valid = 0;

	smp = document.all.sample.src;
	if (document.all.nsdo.className == "txt red")valid = valid + 1;
	if (document.all.emc.className == "txt red")valid = valid + 1;
	if (document.areamust.src == smp)valid = valid + 1;
	if (document.atm.src == smp) valid = valid + 1;
	
	if (document.mmx.src == smp) valid = valid + 1;
	if (document.titlemust.src == smp) valid = valid + 1;
	if (document.xxm.src == smp) valid = valid + 1;
	if (document.fnx.src == smp) valid = valid + 1;
	if (document.lnx.src == smp) valid = valid + 1;
	if (document.emx.src == smp) valid = valid + 1;
	if (document.tnx.src == smp) valid = valid + 1;
	if (document.btx.src == smp) valid = valid + 1;	
	if(valid>0)
	{
		message.submit.className = 'txt hidden'
		
	}
	else
	{
		message.submit.className = 'txt'
	}

}