<!--
var GlobalMsg = ''
var Language = ''
var theform

/*************************************************************************************************
  BEGIN REPLACE
*************************************************************************************************/

function Replace(s,  seekchar, repchar) {
	
	var checks = "";
	var tmps = "";
	for (pos=0;pos<s.length;pos++) {
		tmps = s.substring(pos,pos+1);
		if (tmps == seekchar)
			checks = checks + repchar;
		else
			checks = checks + tmps;
			
	}
    return checks;
}

/*************************************************************************************************
  BEGIN TRIM
*************************************************************************************************/
// LEFT
//====
function TrimLeft( str ) {
	var resultStr = "";
	var i = len = 0;

	// Return immediately if an invalid value was passed in
	if (str+"" == "undefined" || str == null)	
		return null;

	// Make sure the argument is a string
	str += "";

	if (str.length == 0) 
		resultStr = "";
	else {	
  		// Loop through string starting at the beginning as long as there
  		// are spaces.
//	  	len = str.length - 1;
		len = str.length;
		
  		while ((i <= len) && (str.charAt(i) == " "))
			i++;

   	// When the loop is done, we're sitting at the first non-space char,
 		// so return that char plus the remaining chars of the string.
  		resultStr = str.substring(i, len);
  	}

  	return resultStr;
} // end TrimLeft

// RIGHT
//=====

function TrimRight( str ) {
	var resultStr = "";
	var i = 0;

	// Return immediately if an invalid value was passed in
	if (str+"" == "undefined" || str == null)	
		return null;

	// Make sure the argument is a string
	str += "";
	
	if (str.length == 0) 
		resultStr = "";
	else {
  		// Loop through string starting at the end as long as there
  		// are spaces.
  		i = str.length - 1;
  		while ((i >= 0) && (str.charAt(i) == " "))
 			i--;
 			
 		// When the loop is done, we're sitting at the last non-space char,
 		// so return that char plus all previous chars of the string.
  		resultStr = str.substring(0, i + 1);
  	}
  	
  	return resultStr;  	
} // end TrimRight

function TrimString( str ) {
	var resultStr = "";
	
	resultStr = TrimLeft(str);
	resultStr = TrimRight(resultStr);
	
	return resultStr;
} // end Trim


/*************************************************************************************************
  BEGIN CHECK DATE
*************************************************************************************************/
function _CF_onError(form_object, input_object, object_value, error_message)
    {
	//alert(error_message);
       	return false;	
    }



function _CF_hasValue(obj, obj_type)
    {
    if (obj_type == "TEXT" || obj_type == "PASSWORD")
	{
    	if (obj.value.length == 0) 
      		return false;
    	else 
      		return true; 
    	}
    else if (obj_type == "SELECT")
	{
        for (i=0; i < obj.length; i++)
	    	{
		if (obj.options[i].selected)
			return true;
		}

       	return false;	
	}
    else if (obj_type == "SINGLE_VALUE_RADIO" || obj_type == "SINGLE_VALUE_CHECKBOX")
	{

		if (obj.checked)
			return true;
		else
       		return false;	
	}
    else if (obj_type == "RADIO" || obj_type == "CHECKBOX")
	{

        for (i=0; i < obj.length; i++)
	    	{
		if (obj[i].checked)
			return true;
		}

       	return false;	
	}
	}



function _CF_checkeurodate(object_value)
    {
    //Returns true if value is a eurodate format or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return true;

    //Returns true if value is a date in the dd/mm/yyyy format
	isplit = object_value.indexOf('/');

	if (isplit == -1 || isplit == object_value.length)
		return false;

    sDay = object_value.substring(0, isplit);
	isplit = object_value.indexOf('/', isplit + 1);

	if (isplit == -1 ||  (isplit + 1 )  == object_value.length)
		return false;

    sMonth = object_value.substring((sDay.length + 1), isplit);

	sYear = object_value.substring(isplit + 1);

	if (!_CF_checkinteger(sMonth)) //check month
		return false;
	else
	if (!_CF_checkrange(sMonth, 1, 12)) // check month
		return false;
	else
	if (!_CF_checkinteger(sYear)) //check year
		return false;
	else
	if (!_CF_checkrange(sYear, 0, null)) //check year
		return false;
	else
	if (!_CF_checkinteger(sDay)) //check day
		return false;
	else
	if (!_CF_checkday(sYear, sMonth, sDay)) //check day
		return false;
	else
		return true;
    }



function _CF_checkday(checkYear, checkMonth, checkDay)
    {

	maxDay = 31;

	if (checkMonth == 4 || checkMonth == 6 ||
			checkMonth == 9 || checkMonth == 11)
		maxDay = 30;
	else
	if (checkMonth == 2)
	{
		if (checkYear % 4 > 0)
			maxDay =28;
		else
		if (checkYear % 100 == 0 && checkYear % 400 > 0)
			maxDay = 28;
		else
			maxDay = 29;
	}

	return _CF_checkrange(checkDay, 1, maxDay); //check day
    }



function _CF_checkinteger(object_value)
    {
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return true;

    //Returns true if value is an integer defined as
    //   having an optional leading + or -.
    //   otherwise containing only the characters 0-9.
	var decimal_format = ".";
	var check_char;

    //The first character can be + -  blank or a digit.
	check_char = object_value.indexOf(decimal_format)
    //Was it a decimal?
    if (check_char < 1)
	return _CF_checknumber(object_value);
    else
	return false;
    }



function _CF_numberrange(object_value, min_value, max_value)
    {
    // check minimum
    if (min_value != null)
	{
        if (object_value < min_value)
		return false;
	}

    // check maximum
    if (max_value != null)
	{
	if (object_value > max_value)
		return false;
	}
	
    //All tests passed, so...
    return true;
    }



function _CF_checknumber(object_value)
    {
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return true;

    //Returns true if value is a number defined as
    //   having an optional leading + or -.
    //   having at most 1 decimal point.
    //   otherwise containing only the characters 0-9.
	var start_format = " .+-0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

    //The first character can be + - .  blank or a digit.
	check_char = start_format.indexOf(object_value.charAt(0))
    //Was it a decimal?
	if (check_char == 1)
	    decimal = true;
	else if (check_char < 1)
		return false;
        
	//Remaining characters can be only . or a digit, but only one decimal.
	for (var i = 1; i < object_value.length; i++)
	{
		check_char = number_format.indexOf(object_value.charAt(i))
		if (check_char < 0)
			return false;
		else if (check_char == 1)
		{
			if (decimal)		// Second decimal.
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)	
				trailing_blank = true;
        // ignore leading blanks

		}
	        else if (trailing_blank)
			return false;
		else
			digits = true;
	}	
    //All tests passed, so...
    return true;
    }



function _CF_checkrange(object_value, min_value, max_value)
    {
    //if value is in range then return true else return false

    if (object_value.length == 0)
        return true;


    if (!_CF_checknumber(object_value))
	{
	return false;
	}
    else
	{
	return (_CF_numberrange((eval(object_value)), min_value, max_value));
	}
	
    //All tests passed, so...
    return true;
    }


function  CheckDate(ThisForm, ThisObject,TheLength)

    {
	var SameObject = TrimString(ThisObject.value);

	if (SameObject.length != TheLength)
		{
			return false
				}
    if  (!_CF_hasValue(ThisObject, "TEXT" )) 
        {
        if  (!_CF_onError(ThisForm, ThisObject, ThisObject.value, "Error in TestDate text."))
            {
            return false; 
            }
        }
    if  (!_CF_checkeurodate(ThisObject.value))
        {
        if  (!_CF_onError(ThisForm, ThisObject, ThisObject.value, "Error in TestDate text."))
            {
            return false; 
            }
        }
    return true;
    }


/*************************************************************************************************
  BEGIN CHECK SELECTED COMBO
*************************************************************************************************/
function CheckCombo (MyObject)
	{	if (MyObject[MyObject.selectedIndex].value == '')
			{	return (false);
					} else {
				return true;
					}
	}


/*************************************************************************************************
  BEGIN CHECK INTEGER
*************************************************************************************************/

function CheckInteger(TheValue) {
	//Trim the value and assign it to var Number
	MyNumber = TrimString(TheValue);
	//Return false if the value is not a number
	if ( isNaN(TheValue) || (MyNumber.length==0) ) {
		return false;
			}	
	if ( parseFloat(TheValue) == parseInt(TheValue) ) {
		// Is Integer
		return true;
		} else { // Not Integer
		return false;
			}
    }

/*************************************************************************************************
  BEGIN CHECK MAXLENGTH TEXTAREA
*************************************************************************************************/
function CheckMLength (TheValue,MaxLength) {
	if (TheValue.length > MaxLength) {
		return false;
		} else {
		return true;
			}
 }

/*************************************************************************************************
  BEGIN CHECK EXACT LENGTH
*************************************************************************************************/
function CheckLength (TheValue,MaxLength) {
	//var SameValue
	//SameValue = TrimString(TheValue)
	if (TheValue.length == MaxLength) {
		return true;
		} else {
		return false;
			}
 }

/*************************************************************************************************
  BEGIN CHECK IF NUMBER
*************************************************************************************************/

function CheckIfNr (MyNumber) {

	if ( isNaN(MyNumber) ) { // Not a number
						 return false;
						} else { // Is a number
						return true;
							}
}

/*************************************************************************************************
  BEGIN CHECK IF DOUBLE
*************************************************************************************************/

function CheckIfDble (MyNumber,SeparatorIndex) {
MyNumber = Replace (MyNumber,  ',','.')
	if ( isNaN(MyNumber) ) {
		return false;
		}
	digitaftercoma = parseInt(MyNumber.length) - (parseInt(MyNumber.indexOf('.')) + 1)
	if (digitaftercoma != SeparatorIndex) {
		return false;
		}
	return true;

}

/*************************************************************************************************
  BEGIN CHECK IF VALID EMAIL
*************************************************************************************************/

// Checks the E-MAIL field.
function isEmail(TheObject)
   {
  //Last 2 letters of the email adress
  TheDomSfx1 = TheObject.slice(TheObject.length-3,TheObject.length);
  //Last 3 letters of the email adress
  TheDomSfx2 = TheObject.slice(TheObject.length-4,TheObject.length);
  //Return false if the first letter of TheDomSfx1 is  not '.' AND if the first letter of TheDomSfx2 is  not '.' 
  if ( (TheDomSfx1.charAt(0) != '.') && (TheDomSfx2.charAt(0) != '.') )
	{	return false
			}
	
  TheObject.slice
   // Return false if e-mail field is blank.
   if (TheObject == "") 
	{	return false
			}
   // Return false if e-mail field does not contain a '@' and '.' .
   if (TheObject.indexOf ('@',0) == -1 || TheObject.indexOf ('.',0) == -1)
      {	return false;
			}
      return true;
   }

/*************************************************************************************************
  BEGIN CHECK IF OPTION OR RADIO SELECTED
*************************************************************************************************/
function CheckGroup (MyGroup,NrOfElement) {
var Flag = false;
if (NrOfElement==1)
{
	if(MyGroup.checked==true)
		{
		Flag = true;
		}
}else{
	for (i=0;i<NrOfElement;i++)
		{
		if (MyGroup[i].checked==true)
			{
			Flag = true;
			}
		}
}		

if (Flag==false) 
	{
	return false;
	} else {
	return true;
	}
}

/*************************************************************************************************
  BEGIN CALL THE RIGHT FUNCTION
*************************************************************************************************/
function CheckField ( Name, TheForm ,FieldObject, CheckType, Required, MaxLength )
	 {
		// Return false if the checked field is empty and required
		var MyObject;
		var FormatCheck = true;
		var msgRequired, msgDate, msgInt, msgString1a, msgString1b, msgString2a;
		var msgString2b, msgNumber, msgEmail, msgSelect, msgConfirm1, msgConfirm2;

		if (Language == 'en')
			{
			msgRequired = ' is required.\r\n';
			msgDate = ' is not a valid date.\r\n';
			msgInt = ' is not a valid integer.\r\n';
			msgString1a = ' can not contain more than ';
			msgString1b = ' characters.\r\n';
			msgString2 = ' must have a length of ';
			msgNumber = ' is not a valid number.\r\n';
			msgEmail = ' is not a valid e-mail adress.\r\n';
			msgSelect = ' has to be selected.\r\n';
			msgDouble = ' is not a valid decimal.\r\n';
			msgConfirm1 = '';
			msgConfirm2 = ' confirmation is invalid.\r\n';
			} 
		if (Language == 'fr')
			{
			msgRequired = ' est obligatoire.\r\n';
			msgDate = ' n\'est pas une date valide.(jj/mm/aaaa)\r\n';
			msgInt = ' n\'est pas un entier.\r\n';
			msgString1a = ' ne peut pas contenir plus de ';
			msgString1b = ' charactères.\r\n';
			msgString2 = ' doit avoir une longueur de ';
			msgNumber = ' n\'est pas un nombre valide.\r\n';
			msgEmail = ' n\'est pas une adresse e-mail valide.\r\n';
			msgDouble = ' n\'est pas un décimal valable.\r\n';
			msgConfirm1 = 'la confirmation du ';
			msgConfirm2 = ' est invalide.\r\n';
			} 
		if (Language == 'nl')
			{
			msgRequired = ' is verplicht.\r\n';
			msgDate = ' is geen juiste datum.\r\n';
			msgInt = ' is geen juiste integer. .\r\n';
			msgString1a = ' kan niet meer dan  ';
			msgString1b = ' karakters bevatten.\r\n';
			msgString2 = ' moet een lengte hebben van ';
			msgNumber = ' is geen geldig nummer.\r\n';
			msgEmail = ' is geen geldig E-mail adres.\r\n';
			msgSelect = ' moet geselecteerd worden.\r\n';
			msgDouble = ' is geen geldig decimal.\r\n';
			msgConfirm1 = 'fout bij ';
			msgConfirm2 = ' bevestiging.\r\n' ;
			} 

/**********************************************************************************************************************
 REQUIRED FIELDS
**********************************************************************************************************************/
		/*  The format check is performed when:
				1. the field is required and not empty.
				2. the field is not required and not empty.
			 The format check is NOT performed when:
				1. the field is required and empty.
				2. the field is not required and empty.
				3. for the case 'select' because it only checks if selected (if value not null)
				4. for the case 'group' because it one of the group of radio or checkbox is selected				
		*/
			
			if (MaxLength == -1) { FormatCheck = false } //Do not checks format	
			
			switch (CheckType) {
					case 'date' : case 'integer' : case 'string' : case 'string2' : case 'number' : case 'email' : case 'double':
						MyObject = TrimString(FieldObject.value);
						//alert((Required=='yes') + ' - ' + (MyObject.length==0));
						if ( (Required=='yes') && (MyObject.length==0) ) { //the field is required and empty.
			  				GlobalMsg = GlobalMsg + '\'' + Name  + '\'' + msgRequired ; //Displays msg 'is required'
							FormatCheck = false; //Do not checks format
							return false;
						}
						if ( (Required=='no') && (MyObject.length==0) ) { //the field is required and empty.
							FormatCheck = false; //Do not checks format
						}
					break;
					case 'select' :
						FormatCheck = false; //Do not checks format
						MyObject = TrimString(FieldObject[FieldObject.selectedIndex].value);
						if (MyObject == '') {
							GlobalMsg = GlobalMsg  + '\''  +  Name  + '\'' + msgRequired;
							return false;
						}
					break;
					case 'group' :
						FormatCheck = false; //Do not checks format
						if ( !CheckGroup (FieldObject,MaxLength) ) {
						GlobalMsg = GlobalMsg  + '\'' +  Name  + '\''  + msgRequired;
							}
						return CheckGroup (FieldObject,MaxLength);
					break;
					case 'password' :
						MyObject = TrimString(FieldObject.value)
						//alert((Required=='yes') + ' - ' + (MyObject.length==0));
						if ( (Required=='yes') && (MyObject.length==0) ) { //the field is required and empty.
			  				GlobalMsg = GlobalMsg + '\'' + Name  + '\'' + msgRequired ; //Displays msg 'is required'
							FormatCheck = false; //Do not checks format
							return false;
						}
						if ( (Required=='no') && (MyObject.length==0) ) { //the field is required and empty.
							FormatCheck = false; //Do not checks format
						}
						break;					
					} //End switch


/**********************************************************************************************************************
 CHECK SPECIAL VALUES
**********************************************************************************************************************/
			
		if ( FormatCheck==true ) {
				switch (CheckType) {
					case 'date' :
						if ( !CheckDate(TheForm, FieldObject,MaxLength) ) {
							GlobalMsg = GlobalMsg  + '\'' +  Name  + '\'' + msgDate;
							}
						return CheckDate(TheForm, FieldObject,MaxLength);
					break;
					case 'integer' :
						if ( !CheckInteger(FieldObject.value) ) {
						GlobalMsg = GlobalMsg + '\''  +  Name  + '\'' + msgInt;
							}
						return CheckInteger(FieldObject.value);	
					break;
					case 'string' :
						if ( !CheckMLength(FieldObject.value, MaxLength) ) {
						GlobalMsg = GlobalMsg  + '\'' +  Name  + '\'' + msgString1a + MaxLength + msgString1b;
							}
						return CheckMLength(FieldObject.value, MaxLength);
					break;
					case 'password' :
						if(!CheckMLength(FieldObject.value, MaxLength) ) {
							GlobalMsg = GlobalMsg  + '\'' +  Name  + '\'' + msgString1a + MaxLength + msgString1b;
						}
						if(CheckMLength(FieldObject.value, MaxLength)) {
							if(FieldObject.form.elements[String(FieldObject.name) + 'Confirm']) {
								if(FieldObject.form.elements[String(FieldObject.name) + 'Confirm'].value != FieldObject.value) {
										GlobalMsg = GlobalMsg  + msgConfirm1 +  Name  + ' ' + msgConfirm2; 
									return false;
								} else {
									return true;
								}
							} else {
								return true;
							}
						} else {
							return false;
						}
					break;
					case 'string2' :
						if ( !CheckLength(FieldObject.value, MaxLength) ) {
						GlobalMsg = GlobalMsg  + '\'' +  Name  + '\'' + msgString2 + MaxLength + '.\r';
							}
						return CheckLength(FieldObject.value, MaxLength);
					break; 
					case 'number' :
						if ( !CheckIfNr(FieldObject.value) ) {
						GlobalMsg = GlobalMsg  + '\'' +  Name  + '\'' + msgNumber;
							}
						return CheckIfNr(FieldObject.value);
					break;
					case 'email' :
						if ( !isEmail(FieldObject.value) ) {
						GlobalMsg = GlobalMsg  + '\'' +  Name  + '\'' + msgEmail;
							}
						return isEmail(FieldObject.value);
					break;
					case 'double' :
						if ( !CheckIfDble(FieldObject.value, MaxLength) ) {
						GlobalMsg = GlobalMsg  + '\'' +  Name  + '\'' + msgDouble;
							}
						return CheckIfDble(FieldObject.value, MaxLength);
					break;


						}
			} // End If
	return true;
	}

function required(fvalue) {
	if (TrimString(fvalue)=='') return (false);
	return (true);
}

function CheckField2 ()
	{
	if (Language=='en')
		{
		var msgRequired = ' is required.\r';
		var msgNrInterval = ' should have a value included between ',msgNrInterval2 = ' and ';
		var msgTwins1 = 'If \'', msgTwins2 = '\' is filled in, then \'',msgTwins3 = '\' has also to be filled in.\n';
		var msgOther1 = 'If \'',msgOther2 = '\' is checked , then ',msgOther3a=' the field \'',msgOther3b=' the fields \'',msgOther4a='\' is required.\n',msgOther4b='\' are required.\n';
		var msgExclude1 = 'If \'',msgExclude2 = '\' is filled in , then ',msgExclude3a=' the field \'',msgExclude3b=' the fields \'',msgExclude4a='\' must be empty.\n',msgExclude4b='\' must be empty.\n';  
		}
	if (Language=='fr')
		{
		var msgRequired = ' est obligatoire.\r';
		var msgNrInterval = ' doit avoir une valeur comprise entre ',msgNrInterval2 = ' et ';	
		var msgTwins1 = 'Si \'', msgTwins2 = '\' est rempli, alors \'',msgTwins3 = '\' doit être aussi rempli.\n';
		var msgOther1 = 'Si \'',msgOther2 = '\' est coché , alors ',msgOther3a=' le champ \'',msgOther3b=' les champs \'',msgOther4a='\' est requis.\n',msgOther4b='\' sont requis.\n';
		var msgExclude1 = 'Si \'',msgExclude2 = '\' est rempli , alors ',msgExclude3a=' le champ \'',msgExclude3b=' les champs \'',msgExclude4a='\' doit être vide.\n',msgExclude4b='\' doivent être vides.\n'; 
		}
	if (Language=='nl')
		{
		var msgRequired = ' is verplicht.\r';
		var msgNrInterval = ' het veld moet een waarde hebben tussen ',msgNrInterval2 = ' en ';
		}

	switch (arguments[0])
		{
		case 'nr_interval' :
			var fval = eval('frm.' + arguments[2] + '.value');
			if (arguments[5]=='required' && !required(fval))
				{ 
				GlobalMsg += '\'' + arguments[1] + '\'' + msgRequired; return (false);
				}
			if (required(fval) && (fval<arguments[3] || fval>arguments[4] || !CheckIfNr(fval)))
				{
				GlobalMsg += '\'' + arguments[1] + '\'' + msgNrInterval + arguments[3] + msgNrInterval2 + arguments[4] +  '. \r';
				return (false);
				}
		return (true);
		break;
		case 'twins' :
			var fld1 = eval('frm.' + arguments[2] + '.value');
			var fld2 = eval('frm.' + arguments[4] + '.value');
			if (required(fld1) && !required(fld2)) { GlobalMsg+=msgTwins1 + arguments[1]+ msgTwins2 +arguments[3] + msgTwins3;return false; }
			if (!required(fld1) && required(fld2)) { GlobalMsg+=msgTwins1 + arguments[3]+ msgTwins2 +arguments[1] + msgTwins3;return false; }
			return (true);
		break;
		case 'other' :
			var fld1 = eval('frm.' + arguments[2] + '.checked==true');
			var fld2 = eval('frm.' + arguments[4] + '.value');
			var count=0;
			var flds='';
			if (fld1)
			{	
				if (!required(fld2))
					{
					count+=1;flds+=arguments[3];
					}	
				if ((arguments.length>5) && (parseInt(arguments.length)%2==1)) 
					{
					for (var i=5;i<(arguments.length-1);i=i+2)
							{
							var myval=eval('frm.' + arguments[i+1] + '.value');
							if (!required(myval)) 
								{
								count+=1;
								if (count>1) flds +=', ';
								flds+=arguments[i];
								}
							}//end for
					}
				if (count==1) { GlobalMsg+=msgOther1 + arguments[1] + msgOther2 + msgOther3a + flds + msgOther4a;return (false); }
				if (count>1) { GlobalMsg+=msgOther1 + arguments[1] + msgOther2 + msgOther3b + flds + msgOther4b;return (false); }
			} //end if	(fld1)
			return(true);
		break;
		case 'exclude':
			var fld1 = eval('frm.' + arguments[2] + '.value');
			var fld2 = eval('frm.' + arguments[4] + '.value');
			var count=0;
			var flds='';
			if (required(fld1))
			{	
				if (required(fld2))
					{
					count+=1;flds+=arguments[3];
					}	
				if ((arguments.length>5) && (parseInt(arguments.length)%2==1)) 
					{
					for (var i=5;i<(arguments.length-1);i=i+2)
							{
							var myval=eval('frm.' + arguments[i+1] + '.value');
							if (required(myval)) 
								{
								count+=1;
								if (count>1) flds +=', ';
								flds+=arguments[i];
								}
							}//end for
					}
				if (count==1) { GlobalMsg+=msgExclude1 + arguments[1] + msgExclude2 + msgExclude3a + flds + msgExclude4a;return (false); }
				if (count>1) { GlobalMsg+=msgExclude1 + arguments[1] + msgExclude2 + msgExclude3b + flds + msgExclude4b;return (false);}
			} //end if	(fld1)
			return(true);
		break;
		case 'url':
				myval = eval('frm.' + arguments[2] + '.value');
				myval = TrimString(myval);
				if (myval.slice(0,11) == 'http://www.') var cnd1=true;
				if (myval.slice(0,7) == 'http://') var cnd2=true;
				if (myval.slice(0,4) == 'www.') var cnd3;
				for (i=0;i<myval.length;i++)
					{
					if ((myval.charAt(i)=='/') && i!=5 && i!=6) { var slash=i;break; }
					}
				alert(slash)
				//Last 2 letters of the URL
  				DomSfx1 = myval.slice(slash,slash+3);
 				//Last 3 letters of the URl
  				DomSfx2 = myval.slice(slash,slash+4);
 	 			//Return false if the first letter of TheDomSfx1 is  not '.' AND if the first letter of TheDomSfx2 is  not '.'
  				if ( (DomSfx1.charAt(0) == '.') || (DomSfx2.charAt(0) == '.') ) cnd4=true;
  				var cnd5=0;
				//Count number of dot		
				for (i=0;i<myval.length;i++)
					{
					if (myval.charAt(i)=='.') cnd5+=1;
					}
				// begin with http, www or both	
				if ((arguments[3]!='h') ) //&& (arguments[3]!='w')
					{
						if (!((cnd1==true || cnd2==true || cnd3==true) && cnd4==true && (cnd5==1 || cnd5==2)))
						{ alert('bad adress'); }
					}
				return true;
		break; 
		} /* end switch */

	} /*end CheckField2 */
	
// -->
