	//***********************************************************************
	// Function OnSubmit_Search is called when the submitbutton is used.
	// it handles the http request so SiteServer will understand it.
	//***********************************************************************
	function OnSubmit_CRNSearch(msg_str)
	{
	var ls_ct = "";
	var ls_ctt = "";
		//vgraf, 04.07.2000: removed mandatory dates
		if (false){
			//check the dates format
			setDefDates(); //to initialize the dates
			if (!pf_CheckDate(document.form_simpleSearch.docdistsday.value)){
				return false;
			}
			if (!pf_CheckDate(document.form_simpleSearch.docdisteday.value)){
				return false;
			}
			if (!pf_CheckDate(document.form_simpleSearch.notrecsday.value)){
				return false;
			}
			if (!pf_CheckDate(document.form_simpleSearch.notreceday.value)){
				return false;
			}
		}

		if (!pf_CheckIsFormEmpty()){
			return false;
		}
 		//if (!pf_CheckFullText(msg_str)){
		//	return false;
		//}

		//for the search, date is translated into yyyy/mm/dd
		docdistsDate=document.form_simpleSearch.docdistsday.value.slice(6,10)+ "/"  +document.form_simpleSearch.docdistsday.value.slice(3,5)+ "/"  +document.form_simpleSearch.docdistsday.value.slice(0,2) + ' 00:00:00';
		docdisteDate=document.form_simpleSearch.docdisteday.value.slice(6,10)+ "/"  +document.form_simpleSearch.docdisteday.value.slice(3,5)+ "/"  +document.form_simpleSearch.docdisteday.value.slice(0,2) + ' 23:59:59';
		notrecsDate=document.form_simpleSearch.notrecsday.value.slice(6,10)+ "/"  +document.form_simpleSearch.notrecsday.value.slice(3,5)+ "/"  +document.form_simpleSearch.notrecsday.value.slice(0,2) + ' 00:00:00';
		notreceDate=document.form_simpleSearch.notreceday.value.slice(6,10)+ "/"  +document.form_simpleSearch.notreceday.value.slice(3,5)+ "/"  +document.form_simpleSearch.notreceday.value.slice(0,2) + ' 23:59:59';

		//set the default value of the text_search field used for ???
		//NOTE: full text search is done via the q1 field
		//document.form_simpleSearch.text_search.value=document.form_simpleSearch.q1.value;

		//now starts to build the generic q0 field
		searchStr = new String("");
		if (document.form_simpleSearch.qnotnum.value != "") {
			if (searchStr!="") {
				searchStr+=" & ";
			}
			if (document.form_simpleSearch.qnotnum.value.substring(document.form_simpleSearch.qnotnum.value.length-1,document.form_simpleSearch.qnotnum.value.length) != "*"){
				searchStr+="( @META_NOTIFICATION_NO " + document.form_simpleSearch.qnotnum.value + "*)";
			} else {
				searchStr+="( @META_NOTIFICATION_NO " + document.form_simpleSearch.qnotnum.value + ")";
			}
		}

        //Notif reception date
		if (notrecsDate.length>=17) {
			if (searchStr!="") {
					searchStr+=" & ";
				}
			searchStr+="( @NOTIF_RECEPTION_DATE  >= " + notrecsDate  + ")";
		}
		if (notreceDate.length>=17) {
			if (searchStr!="") {
					searchStr+=" & ";
				}
			searchStr+="(@NOTIF_RECEPTION_DATE <= " + notreceDate + ")";
		}

        //Requirement
        if (document.form_simpleSearch.qreq.value != "") {
			if (searchStr!="") {
				searchStr+=" & ";
			}
			searchStr+="( @META_REQ_SHORTNAME " + document.form_simpleSearch.qreq.value + ")";
		}

        //Countries
        if (document.form_simpleSearch.countries.value != "") {
			if (searchStr!="") {
				searchStr+=" & ";
			}
			//searchStr+="( @META_REQ_COUNTRY " + document.form_simpleSearch.countries.value + ")";
			searchStr+="( @META_NOTIF_COUNTRY_NOTIFYING " + document.form_simpleSearch.countries.value + ")";
		}

        //Subjects
        if (document.form_simpleSearch.qsub.value != "") {
			if (searchStr!="") {
				searchStr+=" & ";
			}
			searchStr+="( @META_REQ_SUBJECT " + document.form_simpleSearch.qsub.value + ")";
		}

        //Doc distribution date
		if (docdistsDate.length>=17) {
			if (searchStr!="") {
					searchStr+=" & ";
				}
			searchStr+="( @DOC_ISSUING_DATE  >= " + docdistsDate  + ")";
		}
		if (docdisteDate.length>=17) {
			if (searchStr!="") {
					searchStr+=" & ";
				}
			searchStr+="(@DOC_ISSUING_DATE <= " + docdisteDate + ")";
		}

        //HS classifications
		if (document.form_simpleSearch.qclasshs.value != "") {
			if (searchStr!="") {
				searchStr+=" & ";
			}
			searchStr+="( @META_TC_HS_CODE " + document.form_simpleSearch.qclasshs.value + ")";
		}

        //Service classifications
		if (document.form_simpleSearch.qclassser.value != "") {
			if (searchStr!="") {
				searchStr+=" & ";
			}
			searchStr+="( @META_TC_SERV_CODE " + document.form_simpleSearch.qclassser.value + ")";
		}

        //Environment classification
        if (document.form_simpleSearch.qclassenv.value != "") {
			if (searchStr!="") {
				searchStr+=" & ";
			}
			searchStr+="( @META_TC_ENV_CODE " + document.form_simpleSearch.qclassenv.value + ")";
		}

        //Word in classifications
		if (document.form_simpleSearch.qclassfulltext.value != "") {
			if (searchStr!="") {
				searchStr+=" & ";
			}
			//searchStr+="( @META_TC_HS_DESC " + document.form_simpleSearch.qclassfulltext.value + ")";
			searchStr+="(" + document.form_simpleSearch.qclassfulltext.value + ") | ";
			searchStr+="( @META_TC_ENV_DESC " + document.form_simpleSearch.qclassfulltext.value + ")";
			searchStr+=" | ( @META_TC_SERV_DESC " + document.form_simpleSearch.qclassfulltext.value + ")";
		}

		//alert(searchStr);
		document.form_simpleSearch.q0.value=searchStr;
		return true;
	}

	//**********************************************************************
	//* This function clear the form fields
	//* CREATION	: 01.05.2000
	//* AUTHOR		: Vincent Graf
	//* CONTENT		:
	//*
	//***********************************************************************
	//* UPDATES		:
	//*
	//***********************************************************************
	function btnClearCRNClick() {
        //document.form_simpleSearch.action = "./GEN_CRNsEarch.asp"
                document.form_simpleSearch.clearForm.value = 1
		for (var i=0; i< document.form_simpleSearch.elements.length;i++){
			if (document.form_simpleSearch.elements[i].type == "text" ){
				document.form_simpleSearch.elements[i].value ="";
			}
                }
        }

	//**********************************************************************
	//* This private function check the date format
	//* CREATION	: 01.05.2000
	//* AUTHOR		: Vincent Graf
	//* CONTENT		:
	//*
	//***********************************************************************
	//* UPDATES		:
	//*
	//***********************************************************************
	function pf_CheckIsFormEmpty(){
		if ((document.form_simpleSearch.docdistsday.value==document.form_simpleSearch.docdisteday.value)
                && (document.form_simpleSearch.notrecsday.value==document.form_simpleSearch.notreceday.value)
			 	&& (document.form_simpleSearch.docdistsday.value=="")
			 	&& (document.form_simpleSearch.docdisteday.value=="")
			 	&& (document.form_simpleSearch.notrecsday.value=="")
			 	&& (document.form_simpleSearch.notreceday.value=="")
			    	&& (document.form_simpleSearch.qnotnum.value == "")
			    	&& (document.form_simpleSearch.qreq.value == "")
			    	&& (document.form_simpleSearch.countries.value == "")
			    	&& (document.form_simpleSearch.qsub.value == "")
        			&& (document.form_simpleSearch.qclasshs.value == "")
			    	&& (document.form_simpleSearch.qclassser.value == "")
			    	&& (document.form_simpleSearch.qclassenv.value == "")
			    	&& (document.form_simpleSearch.qclassfulltext.value == ""))
		{
				alert(document.ALERTFORMEMPTY);
				return false;
		}else{
				return true;
		}
	}


