
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_required(field,alerttxt){
	with (field){
		if (value==null||value==""){
			alert(alerttxt);return false
			} else {
			return true
		}
	}
}
	
function validate_form(thisform){
	with (thisform) {
		if (validate_required(naam,"Please enter your name")==false){
			naam.style.background = 'FFF7BF';
			naam.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
		}
	}
}


//DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
//For full source code, documentation, and terms of usage,
//Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px";
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px";
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px";
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px";
}
}

function initializedrag(e){
offsetx=ie5? event.clientX : e.clientX;
offsety=ie5? event.clientY : e.clientY;
// document.getElementById("dwindowcontent").style.display="none" //extra
tempx=parseInt(document.getElementById("dwindow").style.left);
tempy=parseInt(document.getElementById("dwindow").style.top);

dragapproved=true;
document.getElementById("dwindow").onmousemove=drag_drop;
}

function loadwindow(url,width,height){
var postop = document.body.clientHeight - 320;
var posleft = document.body.clientWidth - 420;

if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=1");
else{
document.getElementById("dwindow").style.display='';
document.getElementById("dwindow").style.width=initialwidth=width+"px";
document.getElementById("dwindow").style.height=initialheight=height+"px";

// document.getElementById("dwindow").style.left="430px";
// document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+300+"px" : iecompattest().scrollTop*1+430+"px";

document.getElementById("dwindow").style.left = posleft;
document.getElementById("dwindow").style.top = postop;

}
}

function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("maxname").setAttribute("src","restore.gif");
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth+"px";
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight+"px";
}
else{
minrestore=0 //restore window
document.getElementById("maxname").setAttribute("src","max.gif");
document.getElementById("dwindow").style.width=initialwidth;
document.getElementById("dwindow").style.height=initialheight;
}
document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px";
document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px";
}

function closeit(){
document.getElementById("dwindow").style.display="none";
}

function stopdrag(){
dragapproved=false;
document.getElementById("dwindow").onmousemove=null;
//document.getElementById("dwindowcontent").style.display="" //extra
}



