
<!-- Begin
// Browsercheck
function browserCheck() {
	browser = (((navigator.appName == "Netscape") &&
	(parseInt(navigator.appVersion) >= 5 )) || 
	((navigator.appName == "Microsoft Internet Explorer") && 
	(parseInt(navigator.appVersion) >= 4 )))
	if (browser) {
	}
	else {
		alert('OPGELET: uw browser is niet ondersteund.\n\nDe volgende browsers zijn ondersteund:\n\nMicrosoft IE 4.x en hoger\nNetscape Navigator 6.x en hoger');
	}
}


//Move list items
function addSrcToDestList(i,j) {
	var destList = window.document.form.elements[j];
	var srcList = window.document.form.elements[i]; 
		
	var len = destList.length;
	for(var i=0;i < srcList.length;i++){
		if(srcList.options[i].selected){
			if ((srcList.options[i] != null)) {
				//Check if this value already exist in the destList or not
				//if not then add it otherwise do not add it.
				var found = false;
				for(var count = 0; count < len; count++) {
					if (destList.options[count] != null) {
						if (srcList.options[i].value == destList.options[count].value) {
							found = true;
							break;
					      }
   					}
				}
				if (found != true) {
					//destList.options[len]=new Option(srcList);
					destList.options[len]= new Option();
					destList.options[len].text = srcList.options[i].text;
					destList.options[len].value= srcList.options[i].value;
					len++;
			
       		  	}
      		}
	  		srcList.options[i]=null;
	  		i--;
		}	
	}
	
	//window.document.form.elements[i].value = "";   	
	//window.document.form.elements[i].focus();		
}

//Move All list items
function addAllSrcToDestList(i,j) {
	var destList = window.document.form.elements[j];
	var srcList = window.document.form.elements[i]; 
	
	for(var k=0;k<srcList.length;k++){
		srcList.options[k].selected=true;
	}
	addSrcToDestList(i,j);

}

function countOptions(field){
	var totOptions = 0;
	for(i = 0; i < field.length; i++){
		if(field.options[i].value != ""){
			totOptions = totOptions + 1; 
		}
	}
	return totOptions;
}

//Delete All list items
function deleteListItems(i) {
	var srcList = window.document.form.elements[i]; 
	
	for(var k=0;k<srcList.length;k++){
		if(srcList.options[k].value != ""){
			srcList.options[k].value = "";
			srcList.options[k].text = "";
		}
	}
}

function addSrcToDestList1(i,j) {
	var destList = window.document.form.elements[j];
	var srcList = window.document.form.elements[i]; 
		
	var len = destList.length;
	for(var i=0;i < srcList.length;i++){
		if(srcList.options[i].selected){
			if ((srcList.options[i] != null)) {
				//Check if this value already exist in the destList or not
				//if not then add it otherwise do not add it.
				var found = false;
				for(var count = 0; count < len; count++) {
					if (destList.options[count] != null) {
						if (srcList.options[i].value == destList.options[count].value) {
							found = true;
							break;
					      }
   					}
				}
				if (found != true) {
					//destList.options[len]=new Option(srcList);
					destList.options[len]= new Option();
					destList.options[len].text = srcList.options[i].text;
					destList.options[len].value= srcList.options[i].value;
					len++;
			
       		  	}
      		}
	  		//srcList.options[i]=null;
	  		//i--;
		}	
	}
	
	//window.document.form.elements[i].value = "";   	
	//window.document.form.elements[i].focus();		
}

function delFromList(i) {
	var srcList = window.document.form.elements[i]; 
	
	for(var k=0;k<srcList.length;k++){
		if(srcList.options[k].selected){
			srcList.options[k] = null;
		}
	}
}

function getradioinfo(obj, dn, ret){
	var thisobj = document.getElementById(obj);
	if(thisobj.length == 0){
		thisobj.options[0]= new Option();
	}
	thisobj.options[0].value = dn;
	thisobj.options[0].text = ret;
}

function getcheckinfo(thisobj, ret){
	var len = thisobj.length;
	var aRet = ret.split("#");
	for(i=0;i<aRet.length-1;i++){
		thisobj.options[len] = new Option();
		thisobj.options[len].value = aRet[i];
		i++
		thisobj.options[len].text = aRet[i];
		len++
	}
}

function delItems(thisobj){
	if(thisobj.length > 0){
		for(i=thisobj.length-1;i>=0;i--){
			if(thisobj.options[i].selected){
				thisobj.options[i] = null;
			}
		}
	}
}

function addToList(list,Id,optionNL,optionUK,optionFR,optionDE,Condition){
  var List = window.document.form.elements[list];

  var len = List.length;
	
  var Id = window.document.form.elements[Id];
  var optionNL = window.document.form.elements[optionNL];
  var optionFR = window.document.form.elements[optionFR];
  var optionDE = window.document.form.elements[optionDE];
  var optionUK = window.document.form.elements[optionUK];
  var Condition = window.document.form.elements[Condition];
  
  if(optionNL.value != ""){
	if(optionFR.value == "")optionFR.value = optionNL.value;
	if(optionDE.value == "")optionDE.value = optionNL.value;
	if(optionUK.value == "")optionUK.value = optionNL.value;	
	if(Condition.value == "")Condition.value = 'true';	
  }
	
  var totOption = Id.value + "#NL#" + optionNL.value + "#FR#" + optionFR.value + "#DE#" + optionDE.value + "#UK#" + optionUK.value + "#COND#" + Condition.value + "#";
	
  List.options[len]= new Option();
  List.options[len].text = totOption;
  List.options[len].value= totOption;
  
  Id.value = "";
  optionNL.value = "";
  optionFR.value = "";
  optionDE.value = "";
  optionUK.value = "";	
  Condition.value = "";	
}

function addToFields(list){
	var List = window.document.form.elements[list];
	
	for(var i=0;i < List.length;i++){
		if(List.options[i].selected){
			var item = List.options[i].value;
			items = item.split("#");
			List.options[i] = null;
			for(var x=0; x<items.length;x++){
				if(x==0){window.document.form.elements["_Id"].value=items[x];}
				if(items[x]=='NL'){window.document.form.elements["_OptieNL"].value=items[x+1];}
				if(items[x]=='FR'){window.document.form.elements["_OptieFR"].value=items[x+1];}
				if(items[x]=='UK'){window.document.form.elements["_OptieUK"].value=items[x+1];}
				if(items[x]=='DE'){window.document.form.elements["_OptieDE"].value=items[x+1];}
				if(items[x]=='COND'){window.document.form.elements["_Condition"].value=items[x+1];}
			}	
		}
	}
}

function moveUp(list){
	var List = window.document.form.elements[list];
	var len = List.length;

	for(var i=0;i < List.length;i++){
		if(List.options[i].selected & (i!=0)){
			var tempval = List.options[i-1].value;
			var temptxt = List.options[i-1].text;
			
			List.options[i-1].value = List.options[i].value;
			List.options[i-1].text = List.options[i].text;
			List.options[i].value = tempval;
			List.options[i].text = temptxt;
			
		}
	}
}


function gsMail(params){
	window.open('gsMail.jsp?' + params , 'email', 'location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=yes');
}

function doc(lib,doc){
	window.open('gsViewDoc.jsp?lib='+lib+'&doc='+doc, "doc", 'location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=yes');
//	window.open('gsDoc.jsp?lib='+lib+'&doc='+doc, "doc", 'location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=yes');
}

function selAllData(dit) {
	var destList  = dit;
	for(var i = (destList.options.length-1); i >= 0; i--) {
		destList.options[i].text = destList.options[i].value ;
		destList.options[i].selected = true;
   	}
}

/*
function gsNumeric(dit, defa, mandatory){
	return gsInField(dit, '0123456789.', defa, mandatory);
}

function gsInteger(dit, defa, mandatory){
	return gsInField(dit, "0123456789", defa, mandatory);
}

function gsString(dit, defa, mandatory){
	return gsOutField(dit, "\"", defa, mandatory);
}

function gsPassword(dit, defa, mandatory){
	return gsOutField(dit, "<>\"", defa, mandatory);
}

function gsMemo(dit, defa, mandatory){
	return gsOutField(dit, "", defa, mandatory);
}

function gsHtml(dit, defa, mandatory){
	return gsOutField(dit, "", defa, mandatory);
}
*/

function getReverseDate(dit){
	var gsField = dit.value;
	vdt = gsField.split("/");
	if(!(gsField == "")){
		temp = vdt[2];
		if(vdt[1].length < 2){temp += "0";}
		temp +=  vdt[1];
		if(vdt[0].length < 2){temp += "0";}
		temp +=  vdt[0];
		dit.value=temp;
	}
}

function gsDate(dit, defa, mandatory){
	if(gsInField(dit, "/1234567890", defa, mandatory)){
		var gsField = dit.value;
		var dates = gsField.split("/");
		if(gsField == "" && mandatory == "O"){dit.value = defa; return true;}
		if(dates.length != 3){gsMessage(dit);return false;}
		if(dates[2].length != 4){gsMessage(dit);return false;}  
		mm = parseInt(dates[1]);
		if(dates[1] == "08"){
			mm = 8;
		}	
		if(dates[1] == "09"){
			mm = 9;
		}	
		d = parseInt(dates[0]);
		j = parseInt(dates[2]);
		var dagen = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
		if(mm<1 || mm>12){gsMessage(dit);return false;}
		if(d<0 && d>dagen[mm-1]){gsMessage(dit);return false;}
		if(mm==2 && d==29){
			if(j%4!=0){return false;}
			if(j%100==0 && j%400!=0){gsMessage(dit);return false;}
		}
	} else {
		gsMessage(dit);return false;
	}
	return true;
}

/*
function gsOutField(dit, notvalid, defa, mandatory){
	var gsField = dit.value;
if(gsField){	
if(gsField == "" && mandatory == "O"){dit.value = defa; return true;}
	if(gsField == "" && mandatory == "MO"){gsMessage(dit);return false;}
	for (var j=0; j<gsField.length; j++) {
		temp = gsField.substring(j, j+1);
		if (notvalid.indexOf(temp) != "-1"){gsMessage(dit);return false;}
	}
}
	return true;
}
*/
function gsInField(dit, vali, defa, manda){
	var gsField = dit.value;
	if(gsField == "" && manda == "O"){dit.value = defa; return true;}
	if(gsField == "" && manda == "MO"){gsMessage(dit);return false;}
	for (var j=0; j<gsField.length; j++) {
		temp = gsField.substring(j, j+1);
		if (vali.indexOf(temp) == "-1"){gsMessage(dit);return false;}
	}
	return true;
}


function gsMessage(dit){
	dit.focus();
	dit.blur();
	dit.select();
	return false;
}

function doScript(script, param){
	document.view.action="gsScript.jsp?script="+script + param;
	document.view.target="script";
	document.view.submit();
}

function startTextArea(obj){
  objTextArea = obj;	
  height = parseInt(obj.style.height);
  interval = setInterval("calcTextArea()",1);
}

function calcTextArea(){
	temp = objTextArea.scrollHeight;
	if(temp > height){
		objTextArea.style.height = temp + "px";
	}
}

function stopTextArea(obj){
  obj.style.height = height;	
  clearInterval(interval);
}

//  End -->
