	// JavaScript Document
	
	/**
	 * Function to check is field empty
	 *
	 * @Param txtfield errmsg
	 * $Return true or false 
	 */
	function isFieldEmpty (txtfield,errmsg)	{
		if(trim($(txtfield).value) == ""){
			$("divRegisterError").style.display="block";
			$("divRegisterError").className="Errormsg";
			$("divRegisterError").innerHTML=errmsg;
			$(txtfield).focus();
			return false;
		}
	}
	/**
	 * Function for hide message Div
	 *
	 * @Param Null
	 * $Return true or false 
	 */
	function hideRegerror_msg ()
	{
		$('divRegisterError').style.display='none';
	}
	/**
	 * Function to check  Valid Email
	 *
	 * @Param email
	 * $Return true or false 
	 */
	function isValidEmail (email){
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (filter.test(email)){
			return true;
		}else{
			return false;
		}
		
	}
	/**
	 * Function to Save and validate tour operators details 
	 *
	 * @Param Null
	 * $Return true or false 
	 */
	function Accept_tour_operator () { 
	
		if(isFieldEmpty("Ufname","Please enter your full name")==false){
			$('Ufname').style.backgroundColor= "#FEEA83"; 
			return false;
		}
		if(isNaN($('Ufname').value)	==	'')	{
			$('divRegisterError').style.display	=	"block";
			$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
			$('Ufname').style.backgroundColor= "#FEEA83";
			$('Ufname').select();
			return;
		}
		if(isFieldEmpty("Uemail","Please enter your email address")==false){
			$('Uemail').style.backgroundColor= "#FEEA83";
			return false;
		}
		if(!isValidEmail($('Uemail').value)) {
			$('divRegisterError').style.display ='block';
			$('divRegisterError').innerHTML="Please Enter A Valid Email Address";
			$('Uemail').style.backgroundColor= "#FEEA83";
			$('Uemail').select();
			return false;
		}
		if(isFieldEmpty("Uname","Please enter your user name")==false){
			$('Uname').style.backgroundColor= "#FEEA83";
			return false;
		}
		if(isFieldEmpty("Password","Please enter your password")==false){
			$('Uname').style.backgroundColor= "#FEEA83";
			return false;
		}
		if($('Password').value.length < 8 ) {
			$('divRegisterError').style.display ='block';
			$('divRegisterError').innerHTML="Please enter your password with minimum 8 character "; 
			$('Password').style.backgroundColor= "#FEEA83";
			$('Password').select();
			return false;
		}
		
		if(isFieldEmpty("ConfPassword","Please confirm your password")==false){return false;}
		if($('Password').value != $('ConfPassword').value) {
			$('divRegisterError').style.display	=	"block";
			$('divRegisterError').innerHTML	=	"your password mismatch";
			$('ConfPassword').style.backgroundColor= "#FEEA83";
			$('ConfPassword').select();	
			return;
		}
		thisForm.txtWhat2Do.value	=	"SAVE_USER_DETAILS"; 
		thisForm.action	=	"operatorRegister.php?SAVE_USER_DETAILS";
		thisForm.submit();
	}
	/**
	 * Function to check user login details
	 *
	 * @Param Null
	 * $Return true or false 
	 */
	function check_user_login_details () {
		if(isFieldEmpty("Uname","Please enter your user name")==false){ 
			$('Uname').style.backgroundColor= "#FEEA83";
			return false;
		}
		if(isFieldEmpty("password","Please enter your password")==false){ 
			$('password').style.backgroundColor= "#FEEA83";
			return false;
		}
		thisForm.txtWhat2Do.value = "USERLOGIN";
		thisForm.action  = "index.php";
	}
	/**
	 * Function For show and hide forgot passowrd  text field  
	 *
	 * @Param Null
	 * @Return Unknown
	 *
	 */
	 function show_hide_accept_forgot_password () { 
		if($('divForgotPassword').style.display == 'none') {
			$('divForgotPassword').style.display = 'block';
		}
		else {
			$('divAdminLoginError').style.display = 'none';
			$('divForgotPassword').style.display = 'none';
		}
	}
	/**
	 * Function for sent new password to tour operators
	 *
	 * @Paran Null
	 * @Return Unknown
	 */
	function send_new_passowrd (){ 
		if(isFieldEmpty("Useremail","Please enter your  Email-id")==false){ 
			$('Useremail').style.backgroundColor= "#FEEA83";
			return false;
		}
		if(!isValidEmail($('Useremail').value)){
			$('divRegisterError').innerHTML = 'Please enter a valid Email-id';
			$('divRegisterError').style.display = 'block';
			$('Useremail').style.backgroundColor= "#FEEA83";
			$('Useremail').focus();
			return;
		}
		thisForm.txtWhat2Do.value='FORGOTPASSWORD';	
		thisForm.submit();
	}
	/**
	 * An Ajax function for Check user name Availability
	 *
	 * @Param Username
	 * @Return Response
	 * @Type Ajax
	 */
	 function check_username_availability (username) { 
		var params  	=	"username="+escape(username)+ "&action=CHECK_USERNAME";    
		var url = 'ajaxpost.php';
		$('useravailable').innerHTML = 'Please wait..<img src=././Images/loader_user.gif>';
		new Ajax.Request (url, {
									method      :   "post",
									parameters  :   params,
									onSuccess	:	username_check_msg
								}
							);
	 }
	 /**
	  * Function to display user name available or not
	  * 
	  * @Param reqObj
	  * @Return ------- 
	  */
	function username_check_msg (reqObj) {
		$('useravailable').innerHTML = reqObj.responseText;
		if(trim(reqObj.responseText) == "user name not available") { 
			$('Uname').select();
			return;
		}
	}
	/**
	 * Function for touroperator password is valid or not 
	 *
	 * @Param 
	 * @Return 
	 * NOTE  : Function Not in use--------------------------------------------
	 */
	 function check_is_valid_password (password)
	 { 
		var params	=	"password="+escape(password)+"&action=CHECKPASSWORD";
		var url		=	"ajaxpost.php";	
	 }
	 /**
	  * Function for update tour operator password
	  * 
	  * @Param Null
	  * @Return Null
	  */
	  function update_password()
	  {
		if(trim($('password').value) == '')
			{
				$('message').style.display ='block';
				$('message').innerHTML="Please Enter Your Current Password"; 
				$('password').style.backgroundColor= "#FEEA83";
				$('password').focus();return false;
			}
			if(trim($('newpswd').value) == '')
			{
				$('message').style.display ='block';
				$('message').innerHTML="Please Enter Your New Password"
				$('newpswd').style.backgroundColor= "#FEEA83";
				$('newpswd').focus();return false;
			}
	 		if($("newpswd").value.length <=7) 
			{
				$('message').style.display ='block';
				$('message').innerHTML="Enter Password atleast Eight character"; 
				$('newpswd').style.backgroundColor= "#FEEA83";
				$('newpswd').focus(); return;
			}
			if(trim($('confirmpswd').value) == '')
			{
				$('message').style.display ='block';
				$('message').innerHTML="Please Confirm Your Password"; 
				$('confirmpswd').style.backgroundColor= "#FEEA83";
				$('confirmpswd').focus();return false;
			}
			if($("newpswd").value!=$("confirmpswd").value) 
			{
				$('message').style.display ='block';
				$('message').innerHTML="Password's doesn't match"; 
				$('newpswd').style.backgroundColor= "#FEEA83";
				$('newpswd').focus(); return;
			}
		thisForm.txtWhat2Do.value='CHANGEPASSWORD';
		thisForm.action='changepassword.php';
		thisForm.submit();
	  }
	  /**
	   * Function for show password strength
	   * 
	   * @Param Null
	   * @Return Null
	   */
	  function passwordStrength(password)
	  { 
		var desc = new Array();
		desc[0] = "Very Weak";
		desc[1] = "Weak";
		desc[2] = "Better";
		desc[3] = "Medium";
		desc[4] = "Strong";
		desc[5] = "Strongest";
		var score   = 0;
		//if password bigger than 6 give 1 point
		if (password.length > 6) score++;
		//if password has both lower and uppercase characters give 1 point      
		if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++;
		//if password has at least one number give 1 point
		
		if (password.match(/\d+/)) score++;
		//if password has at least one special caracther give 1 point
		if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++;
		//if password bigger than 12 give another 1 point
		if (password.length > 12) score++;
		document.getElementById("passwordDescription").innerHTML = desc[score];
		document.getElementById("passwordStrength").className = "strength" + score;
	  }
	  /**
	   * Function for go back to home in user interface 
	   *
	   * @Param Null
	   * @Return Null
	   */
		function go_back_home () { 
			thisForm.action='index.php';
			thisForm.submit();
		}
		/**
		 * Function for check and uncheck checkbox
		 *
		 * @Param checkbox[input type]
		 * @Return true or false
		 * NOTE Function not in use-----------------------------------------------------
		 */
		function change_checkbox (checkbox)
		{
			if($(checkbox).checked == true)
			{
				$(checkbox).checked = false;
			}		
		}
		/**
		 * Function for save tour operator's basic information 
		 *
		 * @Param Null
		 * @Return Null
		 */
		 function save_basic_info () {
			if(isFieldEmpty("Orga","Please enter name of the organization")==false) {
				$('Orga').style.backgroundColor= "#FEEA83";
				$('Orga').focus();
				return false;
			}
			if(isNaN($('Orga').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Orga').style.backgroundColor= "#FEEA83";
				$('Orga').focus();
				return;
			}
			if(isFieldEmpty("Haddress","Please enter address of head office")==false) {
				$('Haddress').style.backgroundColor= "#FEEA83";
				return false;
			}
			/*if(isNaN($('phone0').value))	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('phone0').style.backgroundColor= "#FEEA83";
				$('phone0').focus();
				return;
			}
			if(isNaN($('phone1').value)){
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('phone1').style.backgroundColor= "#FEEA83";
				$('phone1').focus();
				return;
			}
			if(isNaN($('phone2').value))	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('phone2').style.backgroundColor= "#FEEA83";
				$('phone2').focus();
				return;
			}
			if(isNaN($('fax0').value))	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('fax0').style.backgroundColor= "#FEEA83";
				$('fax0').focus();
				return;
			}
			if(isNaN($('fax1').value))	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('fax1').style.backgroundColor= "#FEEA83";
				$('fax1').focus();
				return;
			}*/
			if(isFieldEmpty("Email","Please enter your email address")==false){return false;}
			var user_email = $('Email').value.split(',');
			var flag = 0;
			for(var i=0; i < user_email.length;i++)
			{
				if (!isValidEmail (trim(user_email[i])))
				{
					flag = 1;
					break;			
				}	
			}
			

			if(flag==1) {
				$('divRegisterError').style.display ='block';
				$('divRegisterError').innerHTML="Please Enter A Valid Email Address";
				$('Email').style.backgroundColor= "#FEEA83";
				$('Email').focus();
				return false;
			}
			if($('Orgtype').value 	== "Head") {
				if(isFieldEmpty("Baddress","Please enter address of the branch offices")==false) {
					$('Baddress').style.backgroundColor= "#FEEA83";
					$('Baddress').focus();
					return false;
				}
			}
			/*if(isFieldEmpty("Baddress","Please enter address of the branch offices")==false) {
					$('Baddress').style.backgroundColor= "#FEEA83";
					$('Baddress').focus();
					return false;
			}*/
			if(isFieldEmpty("Dboard","Please enter name of proprietor/ Directors/ Partners")==false) {
				$('Dboard').style.backgroundColor= "#FEEA83";
				$('Dboard').focus();
				return false;
			}
			if(isFieldEmpty("Rarea","Please enter reception area")==false) {
				$('Rarea').style.backgroundColor= "#FEEA83";
				$('Rarea').focus();
				return false;
			}
			if(!isNaN($('Rarea').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Rarea').style.backgroundColor= "#FEEA83";
				$('Rarea').focus();
				return;
			}
			if(isFieldEmpty("Taccessbility","Please enter reception area")==false) {
				$('Taccessbility').style.backgroundColor= "#FEEA83";
				return false;
			}
			if(!isNaN($('Taccessbility').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Taccessbility').style.backgroundColor= "#FEEA83";
				$('Taccessbility').focus();
				return;
			}
			thisForm.txtWhat2Do.value = "SAVE_BASIC_INFO";
			thisForm.action = "informations.php";
			thisForm.submit();
		 }
		 /**
		  * Function to create dynamic input fields
		  *
		  * @Param Null
		  * @Return 
		  */
		function  __fncAddRowToTableAcc()
		{ 
			$('hiddenAcc').value = parseInt($('hiddenAcc').value) + 1 ;
			$('hiddenAccForDelete').value = parseInt($('hiddenAccForDelete').value) + 1 ;
			var addval = $('hiddenAcc').value;
			var olddiv = $('divAccompany');
			var firstdiv = document.createElement('div');
			var outdiv = document.createElement('div');
				outdiv.id = 'DivAcc' + addval;
				outdiv.className = 'OuterDivJs';
			var inndiv1 = document.createElement('div');
			var inndiv2 = document.createElement('div');
			var inndiv3 = document.createElement('div');
			var inndiv4 = document.createElement('div');
		
			var title1 = document.createElement('Div');
				title1.innerHTML = 'Size';
				title1.name = 'title1' + addval;
				title1.className = 'titleDiv';
				inndiv1.appendChild(title1);
				
			var title2 = document.createElement('Div');
				title2.innerHTML = 'frequency';
				title2.name = 'title2' + addval;
				title2.className = 'titleDiv';
				inndiv1.appendChild(title2);
				
			var size = document.createElement('input');
				size.type = 'text';
				size.name = 'Size' + addval;
				size.id = 'Size' + addval;
				size.className = 'textfield';
				inndiv2.appendChild(size);
				
			var freq = document.createElement('input');
				freq.type = 'text';
				freq.name = 'Freq' + addval;
				freq.id = 'Freq' + addval;
				freq.className = 'textfield';
				inndiv3.appendChild(freq);
				
			var title3 = document.createElement('Div');
				title3.innerHTML = 'Name of group';
				title3.name = 'title3' + addval;
				title3.className = 'titleDiv';
				inndiv1.appendChild(title3);
				
			var but = document.createElement('input');
				but.type = 'button';
				but.name = 'remove' + addval;
				but.id = 'remove' + addval;
				but.value = 'Remove';
				but.className = 'rightbutton';
				but.onclick = function() {
				removeRowFromTableAcc(addval);
			};
				inndiv4.appendChild(but); 
			var Gname = document.createElement('input');
				Gname.type = 'text';
				Gname.name = 'Gname' + addval;
				Gname.id = 'Gname' + addval;
				Gname.className = 'textfield';
				inndiv1.appendChild(Gname);
				
				outdiv.appendChild(inndiv1);
				outdiv.appendChild(title1);
				outdiv.appendChild(inndiv2);
				outdiv.appendChild(title2);
				outdiv.appendChild(inndiv3);
				outdiv.appendChild(inndiv4);
				olddiv.appendChild(outdiv);
			$('hiddenCount').value =  parseInt($('hiddenCount').value ,10)+1;
			
			var Title1 = document.createElement('Div');
				Title1.innerHTML='Hotel/Homestay Name';
				Title1.id='Name'+addval;
				Title1.className='border';
		}
		/**
	  * Function to add row to phone number field
	  * 
	  * @Param none
	  * @Return ------- 
	  */
		function  __fncAddRowToPhone(cnt)
		{ 
			  var ni =$('divAccompany');
			  var numi = $('hiddenPhone');
			  var num = parseInt($('hiddenPhone').value) + parseInt(1);
			  numi.value = num;
			  var newdiv = document.createElement('input');
			  newdiv.type	=	"text";
			  var divIdName1 = 'phone'+num;
			  newdiv.setAttribute('id',divIdName1);
			  newdiv.setAttribute('name',divIdName1);
			  ni.appendChild(newdiv);
			  newdiv.className	=	'phone1';
			  var addval = $('hiddenPhone').value;
			  
			  var but = document.createElement('input');
				but.type = 'button';
				but.name = 'remove' + addval;
				but.id = 'remove' + addval;
				but.value = 'Remove';
				but.className = 'rightbuttonPhone';
				but.onclick = function() {
					$('hiddenPhone').value	=	parseInt($('hiddenPhone').value)-parseInt(1);
					removeElement('phone'+num);
					removeElement('remove'+ addval);
				}
				 ni.appendChild(but);
				 but.className	=	'removebtn';
		}
		/**
		  * Function toremove phone number rows
		  * 
		  * @Param none
		  * @Return ------- 
		  */
		function removeElement(divNum) 
		{
			  var d = $('divAccompany');
			  var olddiv = $(divNum);
			  d.removeChild(olddiv);
		}
		/**
		  * Function to remove fax
		  * 
		  * @Param none
		  * @Return ------- 
		  */
		function removeFax(divNum) 
		{
			  var d = $('divfax'); 
			  var olddiv = $(divNum);
			  d.removeChild(olddiv);
		}
		/**
		  * Function toremove phone number rows
		  * 
		  * @Param none
		  * @Return ------- 
		  */
		function removeInput(divNum,but) 
		{
		  var d = $('divinput');
		  var olddiv = $(divNum);
		  var button = $(but);
		  d.removeChild(olddiv);
		  d.removeChild(button);
		  $('hiddenPhone').value	=	parseInt($('hiddenPhone').value)-parseInt(1);
		}
		/**
		  * Function toremove phone number rows
		  * 
		  * @Param none
		  * @Return ------- 
		  */
		function removeFaxNo(divNum,but) 
		{
		  var d = $('removefaxno');
		  var olddiv = $(divNum);
		  var button = $(but);
		  d.removeChild(olddiv);
		  d.removeChild(button);
		  $('hiddenPhone').value	=	parseInt($('hiddenPhone').value)-parseInt(1);
		}
		/**
		  * Function toremove phone number rows
		  * 
		  * @Param none
		  * @Return ------- 
		  */
		function __fncAddRowToFax()
		{
			  var ni = $('divfax');
			  var numi =$('hiddenFax');
			  var num = ($('hiddenFax').value -1)+ 2;
			  numi.value = num;
			  var newdiv = document.createElement('input');
			  newdiv.type	=	"text";
			  var divIdName = 'fax'+num;
			  newdiv.setAttribute('id',divIdName);
			  newdiv.setAttribute('name',divIdName);
			  ni.appendChild(newdiv);
			  newdiv.className	=	"phone2";
			  var addval = $('hiddenFax').value;
			  var but = document.createElement('input');
				but.type = 'button';
				but.name = 'removeFax' + addval;
				but.id = 'removeFax' + addval;
				but.value = 'Remove';
				but.className = 'rightbuttonPhone phone2';
				but.onclick = function() {
					$('hiddenFax').value	=	$('hiddenFax').value -1;
					removeFax('fax'+num);
					removeFax('removeFax'+ addval);
				}
				 ni.appendChild(but);
				
		}
		 /**
		 * Function to remove dynamic input fields
		 *
		 * @Param Null
		 * @Return 
		 */
		function removeRowFromTableAcc(adds)
		{ 
			var divs = $('divAccompany');
			var olddiv = $('DivAcc' + adds);
				divs.removeChild(olddiv);
				$('hiddenAccForDelete').value = $('hiddenAccForDelete').value - 1;
		}
	    /**
		 * Function for save tour operator's other details 
		 *
		 * @Param Null
		 * @Return Null
		 */
		 function save_other_details () {
			 if(isFieldEmpty("activity","Please enter details ")==false) {
				  $('activity').style.backgroundColor= "#FEEA83";
				  return false;
			 }
			 if(isFieldEmpty("Member","Please enter details ")==false) {
				  $('Member').style.backgroundColor= "#FEEA83";
				  return false;
		     }
			  if(isNaN($('activity').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('activity').style.backgroundColor= "#FEEA83";
				$('activity').focus();
				return;
			 }
			  if(isNaN($('Member').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Member').style.backgroundColor= "#FEEA83";
				$('Member').focus();
				return;
			 }
			 if(isFieldEmpty("Domestic","Please enter details ")==false) {
				  $('Domestic').style.backgroundColor= "#FEEA83";
				  return false;
		     }
			 if(!isNaN($('Domestic').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Domestic').style.backgroundColor= "#FEEA83";
				$('Domestic').focus();
				return;
			 }
			 if(isFieldEmpty("Foreign","Please enter details ")==false) {
				  $('Foreign').style.backgroundColor= "#FEEA83";
				  return false;
		     }
			 if(!isNaN($('Foreign').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Foreign').style.backgroundColor= "#FEEA83";
				$('Foreign').focus();
				return;
			 }
			  if(isFieldEmpty("Gname0","Please enter group name")==false) {
				  $('Gname0').style.backgroundColor= "#FEEA83";
				  return false;
		     }
			 if(isFieldEmpty("Size0","Please enter group size")==false) {
				  $('Size0').style.backgroundColor= "#FEEA83";
				  return false;
		     }
			 if(!isNaN($('Size0').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Size0').style.backgroundColor= "#FEEA83";
				$('Size0').focus();
				return;
			 }
			  if(isFieldEmpty("Freq0","Please enter group Frequency")==false) {
				  $('Freq0').style.backgroundColor= "#FEEA83";
				  return false;
		     }
			 if(!isNaN($('Freq0').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Freq0').style.backgroundColor= "#FEEA83";
				$('Freq0').focus();
				return;
			 }
			 if(isFieldEmpty("Promote","Please enter details ")==false) {
				  $('Promote').style.backgroundColor= "#FEEA83";
				  return false;
			 }
			 if(isFieldEmpty("Speprogr","Please enter details ")==false) {
				  $('Speprogr').style.backgroundColor= "#FEEA83";
				  return false;
			 }
			 if(isFieldEmpty("ManPwr","Please enter details ")==false) {
				  $('ManPwr').style.backgroundColor= "#FEEA83";
				  return false;
			 }
			 thisForm.txtWhat2Do.value = "SAVE_OTHER_DETAILS";
			 thisForm.action = "otherDetails.php";
			 thisForm.submit();
		 }
		 /**
		 * Function for get total of Paid up capital, Loans, Secured, Unsecured, Reserves and Reserves
		 *
		 * @Param Null
		 * @Return Integer
		 */
		 function save_finance_details()
		 {
			
			 if(isFieldEmpty("Pcapital","Please enter your paid up capital")==false) {
				 $('Pcapital').style.backgroundColor= "#FEEA83";
				 return false;
			 }
			 if(!isNaN($('Pcapital').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Pcapital').style.backgroundColor= "#FEEA83";
				$('Pcapital').focus();
				return;
			}
			if(isFieldEmpty("secure","Please enter secured  loan")==false) {
				 $('secure').style.backgroundColor= "#FEEA83";
				 return false;
			}
			
			if(!isNaN($('secure').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('secure').style.backgroundColor= "#FEEA83";
				$('secure').focus();
				return;
			}
			if(isFieldEmpty("unsecure","Please enter unsecured  loan")==false) {
				  $('unsecure').style.backgroundColor= "#FEEA83";
				  return false;
			}
			if(!isNaN($('unsecure').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('unsecure').style.backgroundColor= "#FEEA83";
				$('unsecure').focus();
				return;
			}
			if(isFieldEmpty("Reserves","Please details of loan")==false) {
				$('Reserves').style.backgroundColor= "#FEEA83";
				return false;
			}
			if(!isNaN($('Reserves').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Reserves').style.backgroundColor= "#FEEA83";
				$('Reserves').focus();
				return;
			}
			if(isFieldEmpty("liabty","Please enter details ")==false) {
				$('liabty').style.backgroundColor= "#FEEA83";
				return false;
			}
			if(!isNaN($('liabty').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('liabty').style.backgroundColor= "#FEEA83";
				$('liabty').focus();
				return;
			}
			if(isFieldEmpty("Fasset","Please enter details ")==false) {
				$('Fasset').style.backgroundColor= "#FEEA83";
				return false;
			}
			if(!isNaN($('Fasset').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Fasset').style.backgroundColor= "#FEEA83";
				$('Fasset').focus();
				return;
			}
			if(isFieldEmpty("Invest","Please enter details ")==false) {
				$('Invest').style.backgroundColor= "#FEEA83";
				return false;
			}
			if(!isNaN($('Invest').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Invest').style.backgroundColor= "#FEEA83";
				$('Invest').focus();
				return;
			}
			if(isFieldEmpty("Casset","Please enter details ")==false) {
				$('Casset').style.backgroundColor= "#FEEA83";
				return false;
			}
			if(!isNaN($('Casset').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Casset').style.backgroundColor= "#FEEA83";
				$('Casset').focus();
				return;
			}
			if(isFieldEmpty("Iasset","Please enter details ")==false) {
				$('Iasset').style.backgroundColor= "#FEEA83";
				return false;
			}
			if(!isNaN($('Iasset').value)	==	'')	{
				$('divRegisterError').style.display	=	"block";
				$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
				$('Iasset').style.backgroundColor= "#FEEA83";
				$('Iasset').focus();
				return;
			}
			
			 thisForm.txtWhat2Do.value = "SAVE_FINANCE_DETAILS"; 
			 thisForm.action = "financialPerfomance.php";
			 thisForm.submit();
		 }
	    /**
		 * Function for get total of Paid up capital, Loans, Secured, Unsecured, Reserves and Reserves
		 *
		 * @Param Null
		 * @Return Integer
		 */
		function get_asset_tot ()
		{	 
			var fixed_asset 	=	Number($('Fasset').value);
			var invest 			=	Number($('Invest').value);
			var curr_asset 		= 	Number($('Casset').value);
			var intang_asset 	= 	Number($('Iasset').value);
			var second_total	=	fixed_asset	+ 
									invest	 	+
									curr_asset	+
									intang_asset;
			$('Stotal').value = second_total;
		}
		/**
		 * Function for get total of Fixed assets, Investment, Current assets and Intangible Assets
		 *
		 * @Param Null
		 * @Return Integer
		 */
		function get_loan_tot ()
		{	 
			var paid_cap 	=	Number($('Pcapital').value);
			var loan_secur 	= 	Number($('secure').value);
			var loan_unsec 	= 	Number($('unsecure').value);
			var reserves 	= 	Number($('Reserves').value);
			var liablity 	= 	Number($('liabty').value);
			var first_total	=	paid_cap 	+ 
								loan_secur	+
								loan_unsec	+
								reserves	+
								liablity;
			$('Ftotal').value = first_total;
		}
	    /**
		 * Function hide branch office input area
		 *
		 * @Param Null
		 * @Return Null
		 */
		function load_org_type () {
			
			if($('Orgtype').value 	== "Branch") {
				$('branch').style.display	= "none";
			}
			else if($('Orgtype').value 	== "Head") {
				$('branch').style.display	= "block";
			}
		}
		/*function compare_birth_dates(start_date, end_date)
		{ 
			start_date=start_date;
			var point1=0;
			var point2=0;
			var arrDate1 = start_date.split(");
			var useDate1 = new Date(arrDate1[2], arrDate1[1]-1, arrDate1[0]);
			var arrDate2 = end_date.split(");
			var useDate2 = new Date(arrDate2[2], arrDate2[1], arrDate2[0]-1);
			
			var year1=arrDate1[2];
			var month1=arrDate1[1];
			var day1=arrDate1[0];
			var year2=arrDate2[2];
			var month2=arrDate2[1];
			var day2=arrDate2[0];
			var year1 = parseInt(year1);
			var year2 = parseInt(year2);
			if(year1>year2)
			{
				point1++; 
			}
			else if(year1<year2)
			{
				point2++;
			}
			else
			{
				point1++;point2++;			
			}
			if(month1>month2 && point1>0) 
			{
				point1++; 
			}
			else if(month1<month2 && point2>0)
			{
				point2++; 
			}
			else 
			{
				point1++;point2++;
			}
			if(day1>day2 && point1>1)
			{ 
				point1++; 
			}
			else if(day1<day2 && point2>1)
			{
				point2++;
			}
			else 
			{
				point1++;point2++;
			}	
			
			if(point1>point2 )
			{
				return false;
			}
			else
			{
				return true;
			}
		}*/

		/**
		 * Function for save payment details
		 *
		 * @Param Null
		 * @Return Null
		 */
		function save_payement_data () {
			
			   if(isFieldEmpty("Bname","Please enter your bank name")==false)	{
				   $('Bname').style.backgroundColor= "#FEEA83"; 
				   return false;
				}
			   if(isNaN($('Bname').value)	==	'')	{
					$('divRegisterError').style.display	=	"block";
					$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
					$('Bname').style.backgroundColor= "#FEEA83";
					$('Bname').select();
					return;
				}
				/*
				if(isFieldEmpty("Naudit","Please enter name of auditors ")==false) {
					$('Naudit').style.backgroundColor= "#FEEA83"; 
					return false;
				}
				if(isNaN($('Naudit').value)	==	'')	{
					$('divRegisterError').style.display	=	"block";
					$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
					$('Naudit').style.backgroundColor= "#FEEA83";
					$('Naudit').select();
					return;
				}*/
				if(isFieldEmpty("DDnum","Please enter name of auditors ")==false) {
					$('DDnum').style.backgroundColor= "#FEEA83"; 
					return false;
				}
				/*if($('DDnum').value.length	> 15 )	{
					$('divRegisterError').style.display	=	"block";
					$('divRegisterError').innerHTML	=	"You are crossed the number limit";
					$('DDnum').style.backgroundColor= "#FEEA83";
					$('DDnum').select();
					return;      
				}*/
				if(!isNaN($('DDnum').value)	==	'')	{
					$('divRegisterError').style.display	=	"block";
					$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
					$('DDnum').style.backgroundColor= "#FEEA83";
					$('DDnum').select();
					return;
				}
				if(isFieldEmpty("DDdate","Please select DD date")==false){ 
					$('DDdate').style.backgroundColor= "#FEEA83"; 
					return false;
				}
				if(isFieldEmpty("DDamount","Please your DD amount")==false){ 
					$('DDamount').style.backgroundColor= "#FEEA83"; 
					return false;
				}
				if(!isNaN($('DDamount').value)	==	'')	{
					$('divRegisterError').style.display	=	"block";
					$('divRegisterError').innerHTML	=	"You are entered disallowed characters";
					$('DDamount').style.backgroundColor= "#FEEA83";
					$('DDamount').select();
					return;
				}
				thisForm.txtWhat2Do.value	=	"PAYMENT_DETAILS";
				thisForm.actiom	=	"paymentDetails.php";
				thisForm.submit();
		}
		/**
		 * Function to chnage text field background color
		 *
		 * @Param Null
		 * @ Return Null
		 *
		 */
		function change_bg_color (element) { 
			 element.style.backgroundColor = "#FFFFFF";
			 $('divRegisterError').style.display = "none";
		}
		/**
		 * Function to chnage text field background color
		 *
		 * @Param Null
		 * @ Return Null
		 * NOTE : note in use----------------------------------------------
		 */
		function setbg(color)
		{
			$("Areainterest").style.color=color;
		}
		function text_color (id) {
			$(id).style.color = '#000000';	  
		}
		function invisible_mgs (elId,msg) { 
			if(elId.value == msg)
			{ 
				elId.value='';	
				elId.value.classname='comnt_color';
			}
			else if(elId.value == '') {
				elId.value=msg;	
			}
		}
		/**
		 * Function to save profile image of tour operator
		 *
		 * @Param Null
		 * @Return Null
		 * @Type ajax
		 */
		function save_profile_image (Uploadimg) {
			   	
				var params  	=	"Uploadimg="+escape(Uploadimg)+ "&action=SAVE_PROFILE_IMAGE";    
				var url = 'ajaxpost.php';
				$('text').innerHTML = '<img src=./Images/img-loader.gif>uploading<blink>....</blink>';
				new Ajax.Request (url, {
											method      :   "post",
											parameters  :   params,
											onSuccess	:	username_check_msg
										}
									);
				thisForm.txtWhat2Do.value	=	"SAVE_PROFILE_IMAGE";
				thisForm.action	=	"documents.php";
				thisForm.submit();
		}
		/**
		 * Function to save profile image of tour operator
		 *
		 * @Param Null
		 * @Return Null
		 * @Type ajax
		 */
		function save_profile_photo (Uploadimg) {
			
			if( $('files').value=='' && $('filesBuilding1').value == '' && $('filesBuilding2').value =='' && $('filesBuilding3').value == '' && $('filesBuilding4').value == '')
			{
				alert('Please select your image');
				return false;
			}
			var params  	=	"Uploadimg="+escape(Uploadimg)+ "&action=SAVE_PROFILE_IMAGE";   
			var url = 'ajaxpost.php';
			$('text').innerHTML = '<img src=./Images/img-loader.gif>uploading<blink>....</blink>';
			new Ajax.Request (url, {
										method      :   "post",
										parameters  :   params,
										onSuccess	:	username_check_msg
									}
								);
			thisForm.txtWhat2Do.value	=	"SAVE_PROFILE_IMAGE";
			$('text').innerHTML = '<img src=./Images/img-loader.gif>uploading<blink>....</blink>'
			thisForm.actiom	=	"uploadImage.php";
			thisForm.submit();
		}
		/*
		 * Function to submit all forms confirmation 
		 *
		 * @Paran Null
		 * @Return Null
		 */
		function submit_all_forms_confirm () { 
			if(isFieldEmpty("orgName","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('orgName').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("headAddr","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('headAddr').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("telNum0","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('telNum0').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			/*if(isFieldEmpty("fax0","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('fax0').style.backgroundColor= "#FEEA83"; 
					return false;
			}*/
			/*if(isFieldEmpty("webname","Please enter Fax Numbers")==false){ 
					$('webname').style.backgroundColor= "#FEEA83"; 
					return false;
			}*/
			if(isFieldEmpty("Baddress","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('Baddress').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			
			/*if(isFieldEmpty("areaInterest","Please enter ")==false){ 
					$('areaInterest').style.backgroundColor= "#FEEA83"; 
					return false;
			}	*/
			/*if(isFieldEmpty("location","Please enter ")==false){ 
					$('location').style.backgroundColor= "#FEEA83"; 
					return false;
			}*/
			if(isFieldEmpty("reception","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('reception').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("toiletAcc","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('toiletAcc').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("paidCap","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('paidCap').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("secLoan","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('secLoan').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("unsecLoan","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('unsecLoan').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("reserves","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('reserves').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("currLiab","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('currLiab').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			
			if(isFieldEmpty("fasset","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs)")==false){ 
					$('fasset').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("invest","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('invest').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("casset","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('casset').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("inasset","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('inasset').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("actUnder","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('actUnder').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("membIner","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('membIner').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("volTouri","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs ")==false){ 
					$('volTouri').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("volTouriForeign","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('volTouriForeign').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("gName","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('gName').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("gSize","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('gSize').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("stepPromot","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('stepPromot').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("specprogram","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('specprogram').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("offpremises","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('offpremises').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("bname","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('bname').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("auditName","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('auditName').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("ddNo","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('ddNo').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("ddDate","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('ddDate').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("ddAmount","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('ddAmount').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("bLetter","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('bLetter').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("regCert","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('regCert').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("auditBal","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('auditBal').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("incTax","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('incTax').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("serTax","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('serTax').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("cetChartAcc","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('cetChartAcc').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			/*if(isFieldEmpty("name_prop","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('name_prop').style.backgroundColor= "#FEEA83"; 
					return false;
			}*/
			if(isFieldEmpty("turnChartAcc","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('turnChartAcc').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("undertaking","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('undertaking').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			if(isFieldEmpty("tourChartAcc","You have to fill all the fields in Basic details , Other detalls , Payment Details and document tabs")==false){ 
					$('tourChartAcc').style.backgroundColor= "#FEEA83"; 
					return false;
			}
			$('confirmation').className="data_entry_confirm_block";
			
		}
	   /**
		* Function to submit all forms 
		*
		* @Paran Null
		* @Return Null
		*/
		 function submit_all_forms () {
			/*thisForm.txtWhat2Do.value = "SUBMIT_ALL";*/
			thisForm.action = "create_pdf_application.php";
			thisForm.submit();	 
		 }
	   /**
		* Function to close confirmation box
		*
		* @Paran Null
		* @Return Null
		*/
		function finish_confirmation_non() {	
				$('confirmation').style.display="none";
				$('confirmation').focus();
		}
	   /**
		* Function to view usert guide
		*
		* @Paran Null
		* @Return Null
		*/
		function view_user_manual (Id) {
			window.open("usermanual.php?"+Id,"_blank","height=5000, width=1000,scrollbars=yes,resizeable=0,left=200");
			thisForm.submit();	
		}
	   /**
		* Function to Recommand fpr accreditation
		*
		* @Paran Null
		* @Return Null
		*/
		function  recommand_accreditation () { 
			thisForm.txtWhat2Do.value = "RECOMMAND_FOR_ACCREDITATION";
			thisForm.action = "viewalldetails.php";
			thisForm.submit();	 	
		}
		function download_certificate (username)
		{ 
			window.open(base_url+"uploads/"+username+"/accreditation_certificate.pdf","_blank","height=3000, width=1300,scrollbars=yes,left=55");
		}
		function download_ddreciept (username)
		{ 
			window.open(base_url+"uploads/"+username+"/demand_draft_reciept.pdf","_blank","height=3000, width=1000,scrollbars=yes,left=200");
		}
		function download_tourism_logo ()
		{
			window.open(base_url+"/Images/Kerala Tourism logo.jpg","_blank","height=5000, width=1000,scrollbars=yes,left=200");
		}
		function download_accreditation_logo ()
		{
			window.open(base_url+"/Images/ato logo.jpg","_blank","height=5000, width=1000,scrollbars=yes,left=200");
		}
		function show_underline () {
			$('addphoto').style.textDecoration="underline";	
		}
		function hide_underline () {
			$('addphoto').style.textDecoration="none";	
		}
		function add_photo ()
		{
			thisForm.action = "uploadImage.php";
			thisForm.submit();	
		}
		function open_guidelines () {
			window.open(base_url+"/guidelines.pdf","_blank","height=5000, width=1000,scrollbars=yes,left=220");
		}
