
function login() {
	var key = window.event.keyCode;
	if (key == 13) loginSubmit()
}
	
function loginSubmit(){
 if ((frmLogin.txtUserName.value!=="") && (frmLogin.txtPassword.value!=="")) {
  frmLogin.submit(); }
}

function getTraining(){
	
	var f=frmTraining;
	f.submit();
}

function getCourseByMonth(){
	frmCourse.submit();
}

function registerParticipant(){
	
	var f=frmRegister;
	
	if(f.txtFirstName.value==""){
	  alert("Name may not empty");
	  f.txtFirstName.focus();	
	}else if (f.txtCompany.value==""){
	  alert("Company may not empty");
	  f.txtCompany.focus();	
	}else if (f.txtAddress.value==""){
	  alert("Address may not empty");
	  f.txtAddress.focus();	
	}else if (f.txtTel.value==""){
	  alert("Telephone may not empty");
	  f.txtTel.focus();
	}else if (f.txtMobile.value==""){
	  alert("Mobile phone may not empty");
	  f.txtMobile.focus();
	}else if (f.txtEmail.value==""){
	  alert("E-mail may not empty");
	  f.txtEmail.focus();
	}	
	else
	  f.submit();  
}




function sendEmail(){

	var f=frmSendEmail;
	
	if (f.txtName.value==""){
		alert("Name may not empty");
		f.txtName.focus();
	}else if (f.txtEmail.value==""){
		alert("E-mail address may not empty");
		f.txtEmail.focus();
	}else if (f.txtSubject.value==""){
		alert("Message subject may not empty");
		f.txtSubject.focus();
	}else if (f.txtMsg.value==""){
		alert("Message may not empty");
		f.txtMsg.focus();
	}else{
		f.submit();
	}
}

function search()
{
 if (txtQuery.value!=="")
 {
	 if (cbCategory.value=="N"){
		document.location.href="search.php?q=" + txtQuery.value;
	 }else if (cbCategory.value=="T"){
		document.location.href="search.php?q=" + txtQuery.value;
	 }
  }
}


function CMS_Search()
{
   if (txtQuery.value!=="")
   {
   if (cbChannel.value=="N")
      document.location.href="cms_news_show.php?act=search&query=" + txtQuery.value;	
   else if (cbChannel.value=="A")
      document.location.href="cms_article_show.php?act=search&query=" + txtQuery.value;
   else if (cbChannel.value=="S")
      document.location.href="cms_story_show.php?act=search&query=" + txtQuery.value;
   else if (cbChannel.value=="B")
      document.location.href="cms_book_show.php?act=search&query=" + txtQuery.value;
   else if (cbChannel.value=="D")
      document.location.href="cms_download_show.php?act=search&query=" + txtQuery.value;
   else if (cbChannel.value=="L")
      document.location.href="cms_link_show.php?act=search&query=" + txtQuery.value;
   }
   
}


function CheckAll(){
  
with (document.frmList) {
    for (var i=0; i < elements.length; i++) {
        if (elements[i].type == 'checkbox')
           elements[i].checked = true;
    }
  }
}

function ClearAll(){ 
 frmList.reset();
 } 
 


