
function writeEmail(name, domain, ext) {
	var a='to:'; 
	var b='@'; 
	var c='.'; 
	document.write("<A HR" + "EF=mail" + a + name + b + domain + c + ext +">"+ name + b + domain + c + ext + "</A>"); 
	}

	
var detect = navigator.userAgent.toLowerCase();
var OS,browser,total,thestring;
var version = 0;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

// alert(navigator.userAgent + " - " + browser) 

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;

}


// popup functions

function launchPopup(target,width,height) {
	window.open(target,"Astragy","resizeable=no,toolbar=0,location=0,menubar=0,directories=0,status=0,scrollbars=auto,WIDTH=800,HEIGHT=600");
	}
	
function launchPopupDef(target,width,height) {
	window.open(target,"Astragy","resizeable=no,toolbar=0,location=0,menubar=0,directories=0,status=0,scrollbars=auto,WIDTH=" + width + ",HEIGHT=" + height);
	}
	
function launchPopup250() {
	window.open("noci2005.html","Astragy","resizeable=no,toolbar=0,location=0,menubar=0,directories=0,status=0,scrollbars=auto,WIDTH=250,HEIGHT=150");
	}

	
// form validation

function validate_email(field,alerttxt) {
	with (field) {
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) {
			alert(alerttxt);return false
			} else {
			return true
		}
	}
}

function validate_checkbox(field,alerttxt){
	with (field){
		if (field.checked == false){
			alert(alerttxt);return false
			} else {
			return true
		}
	}
}

function validate_required(field,alerttxt){
	with (field){
		if (value==null||value==""){
			alert(alerttxt);return false
			} else {
			return true
		}
	}
}
	
function validate_form(thisform){
	with (thisform) {
		if (validate_checkbox(Agree_to_GTC,"Please agree to the general terms and conditions")==false){
			Agree_to_GTC.style.background = 'FF0000';
			Agree_to_GTC.focus();return false
			}
		if (validate_required(naam,"Please enter your name")==false){
			naam.style.background = 'FFF7BF';
			naam.focus();return false
			}
		if (validate_required(client,"Please enter the client name of your Free Trial subscription")==false){
			client.style.background = 'FFF7BF';
			client.focus();return false
			}
		if (validate_required(user,"Please enter the user name of your Free Trial subscription")==false){
			user.style.background = 'FFF7BF';
			user.focus();return false
			}
		if (validate_required(email,"Please enter your e-mail address")==false){
			naam.style.background = 'FFFFFF';
			email.style.background = 'FFF7BF';
			email.focus();return false
			}
		if (validate_email(email,"The e-mail address you have typed is not valid")==false){
			naam.style.background = 'FFFFFF';
			email.style.background = 'FFF7BF';
			email.focus();return false
		}
	}
}


