<?php

include("common/connection.php");

login_check();



$Lead_Pa_Id=base64_decode($_REQUEST['Lid']);

$user_type_sql="select * from user_master where User_Name='".$_SESSION['user']."'";

$user_type_query=mysqli_query($con,$user_type_sql);

$user_type=mysqli_fetch_array($user_type_query);

?>

<!doctype html>

<html class="no-js" lang="en">



<head>

    <meta charset="utf-8">

    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <title>Patient Agreement | Buurtzorg</title>

 

    <script type="text/javascript">

	

	function delete_lead(per) 

	{

	  var response = confirm("Are You Sure to Delete Lead!");

	  if (response == true) 

	  {

		$.ajax({

		url:"ajax_delete_lead.php",

		type:"POST",

		data:{'per':per},

		success:function(data)

		{

 			//alert('Lead '+data+' Deleted Successfully');

		}

		});

	  } 

	  else 

	  {

		alert('Lead Not Deleted');

	  }

	}

	</script>

    <script >

	function update_callconnect(Status,Lead_Id)

	{

	 //alert(Status);

	 

	 $.ajax({

		url:"ajax_updatecall_lead.php",

		type:"POST",

		data:{'Status':Status,'Lead_Id':Lead_Id},

		success:function(data)

		{

		//alert(data)

			if(Status=='Call Connected')

			{

			

			  window.location.href='call_connected.php?Lid='+Lead_Id;

			}

			else

			{

			  window.location.href='current_leads.php';

			}

		}

		})

	}

	</script>

    

    <script >

	function total_calculation()

	{

	var start12=$("input[name=stdate]").val();

	var finish12=$("input[name=ndate]").val();

	var Rate=$('#Rate').val();

	if(start12!="" && finish12!="")

	{

	 $.ajax({

		url:"ajax_total_calculation.php",

		type:"POST",

		data:{'start12':start12,'finish12':finish12},

		success:function(data)

		{
        //alert(data);
		$('#Duration').val(data);
		$('#Rate').val('');
		$('#numdays2').val('');
		
		

		}

		});

	}

	}

	</script>

    <script type="text/javascript">

	/*function getrate()

	{

		

		var Hours=$('#Duration').val();

		

		

	$.ajax ({

		url:'ajax_patient_agreement.php',

		type:'POST',

		data: 'Hours=' + Hours ,

		async: false,

		success:function(f)

		{

		$("#Rate").val(f);

		total_calculation();

		}

		})

	}*/

	</script>

    <script>

	function Totalamount()

	{

	var Duration=$('#Duration').val();

	var Rate=$('#Rate').val();
	
	if(Rate=="")
	{
	   var Rate=0;
	}
    
		if(Duration!='')

		{
                
	$.ajax({

			url:'ajax-total-value-agreement.php',

			type:'POST',

			data:{'Duration':Duration,'Rate':Rate},

			success:function(f)

			{

			//alert(f);

				$('#numdays2').val(f);

			}

		  });

	}

	}

	</script>

    <script>

	function form_validation()

   {

   		var flag=0;
		
		var Nursing = $("#Nursing").val();

		/*var Rname = $("#Rname").val();

		var rel = $("#rel").val();

		var add = $("#add").val();

		var ph = $("#ph").val();

		var mail = $("#mail").val();*/

		var finish = $("#finish").val();

		var start12 = $("#start12").val();
		
		var finish12 = $("#finish12").val();
		
		var Rate = $("#Rate").val();
		

		
		if(Nursing=='')

		{

		$("#Nursing").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}

		

		/*if(Rname=='')

		{

		$("#Rname").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}

		

		if(rel=='')

		{

		$("#rel").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}

		

		if(add=='')

		{

		$("#add").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}

		

		if(ph=='')

		{

		$("#ph").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}

		

		if(mail=='')

		{

		$("#mail").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}*/

		

		if(finish=='')

		{

		$("#finish").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}

		if(start12=='')

		{

		$("#start12").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}
		
		if(Rate=='')

		{

		$("#Rate").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}
		
		if(Rate=='')

		{

		$("#Rate").css('border-color','#FF0000');

		$("#alert_msg").show();

		flag=1;

		}



		if(flag==1)

		{

		return false;

		}

		else

		{

		$("#desktop_enq").submit();

		}

   }

   

   function ActiveColour(per)

{

   $('#'+per).css('border','');

  // $('#msgdiv1').html('');

}
	
</script>

<script type="text/javaScript">
        $(function() {
            $('input[type="checkbox"]').on('change', function() {
                $(this).closest('fieldset').find('.myClass').toggle(!this.checked);
            });
        });
    </script>

    
 <script>
function isNumberKey(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode;
    if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
    {
        return false;
    }
    else
    {
        return true;
    }
}

</script> 
    

    

    <?php include("headerlink.php"); ?>

    <?php

		//---------user type check-------// 

		$user_sql="select User_Type as type,Location from user_master where User_Name='".$_SESSION['user']."'";

		$user_query=mysqli_query($con,$user_sql);

		$user=mysqli_fetch_array($user_query);

		

		//---------all leads fetching by condition-------// 

		$all_leads_sql="select count(Lead_ID) as total_leads from lead_master";

		

		if($user['type']!='Super Admin')

		{

		//$all_leads_sql.=" where Lead_Referred_To='".$_SESSION['user']."'";

		$all_leads_sql.=" where Control_Location='".$user['Location']."'";

		}

		$all_leads_query=mysqli_query($con,$all_leads_sql);

		$all_leads=mysqli_fetch_array($all_leads_query);

		

		

		//---------fresh leads fetching by condition-------// 

		$fresh_leads_sql="select count(Lead_ID) as fresh_leads from lead_master where Status ='Yet to be Called'";

		

		if($user['type']!='Super Admin')

		{

		//$fresh_leads_sql.=" and Lead_Referred_To='".$_SESSION['user']."'";

		 $fresh_leads_sql.=" and Control_Location='".$user['Location']."'";

		}

		

		$fresh_leads_query=mysqli_query($con,$fresh_leads_sql);

		$fresh_leads=mysqli_fetch_array($fresh_leads_query);

		

		//---------fresh leads fetching by condition-------// 

		$progress_leads_sql="select count(Lead_ID) as progress_leads from lead_master where (Status !='Yet to be Called' and Status !='')";

		

		if($user['type']!='Super Admin')

		{

		//$progress_leads_sql.=" and Lead_Referred_To='".$_SESSION['user']."'";

		 $progress_leads_sql.=" and Control_Location='".$user['Location']."'";

		}

		

		$progress_leads_query=mysqli_query($con,$progress_leads_sql);

		$progress_leads=mysqli_fetch_array($progress_leads_query);

		

		//---------today leads fetching by condition-------// 

		$today_leads_sql="select count(Lead_ID) as today_leads from communication_master where (Status !='Yet to be Called' and Status !='') and Date_Of_Communication LIKE'".date('Y-m-d')."%'";

		

		if($user['type']!='Super Admin')

		{

		$today_leads_sql.=" and Communicator_ID='".$_SESSION['user']."'";

		}

		//echo $today_leads_sql;

		$today_leads_query=mysqli_query($con,$today_leads_sql);

		$today_leads=mysqli_fetch_array($today_leads_query);		

		?>

     	<link rel="stylesheet" href="css/data-table/bootstrap-table.css">

    	<link rel="stylesheet" href="css/data-table/bootstrap-editable.css">

        

        <link rel="stylesheet" href="css/datapicker/datepicker3.css">

  <script>
function show1(){

	if(document.getElementById('financial').checked==true)
	{
	  document.getElementById('email_div').style.display = 'block';
	}
   else{
     document.getElementById('email_div').style.display ='none';
  }
}
/*function show2(){
  document.getElementById('email_div').style.display = 'block';
}*/
</script>       

        
<script>
function add_childdetail()
{
	var Nursing=$('#Nursing').val();
	$.ajax({
	url:'ajax-change-service-agreement.php',
	type:'post',
	data:'Nursing=' + Nursing,
	success:function(f)
	{
	//alert(f);
	if(f==1){
	$('#cnfrm_btn').show();
	}else
	{
	$('#cnfrm_btn').hide();
	}
	}
	})
}
</script>
        

</head>



<body onLoad="getrate()">

	<?php 

					
					//$patagr_fetch=mysqli_fetch_array($patagr_query);

					if(isset($_REQUEST['tyre_submit'])!="")

					{
					$lead_location=mysqli_fetch_array(mysqli_query($con,"select Control_Location from lead_master where Lead_ID='".$Lead_Pa_Id."'"));	
						
				    $patagr="select * from patient_agreement where Lead_ID='".$Lead_Pa_Id."'";
					$patagr_query=mysqli_query($con,$patagr);
					if(mysqli_num_rows($patagr_query)==0)
					{
						

						$sqla="insert into  `patient_agreement` (`patient_name`,`service_type`,`Start_Agreement_Date`,`Pan_Card`,`start_date`,`end_date`, `service_duration`,`rate_per_day`,`total_payable`,`Lead_ID`,`Infant_Dob`,`Infant_Weight`,`Control_Location`) values('".$_REQUEST['pName']."','".$_REQUEST['Nursing']."','".date('Y-m-d',strtotime($_REQUEST['finish']))."','".$_REQUEST['pan']."','".date('Y-m-d',strtotime($_REQUEST['stdate']))."','".date('Y-m-d',strtotime($_REQUEST['ndate']))."','".$_REQUEST['Duration']."','".$_REQUEST['Rate']."','".$_REQUEST['Payable']."','".$Lead_Pa_Id."','".date('Y-m-d',strtotime($_REQUEST['dob']))."','".$_REQUEST['weight']."','".$lead_location['Control_Location']."')";
							
						$pares=mysqli_query($con,$sqla);
						
						if ($_REQUEST['financial']=='Yes')
						{
						
							$responsible="update `lead_contact_details` set Financially_Reponsible_Person='".$_REQUEST['Rname']."',Financially_Reponsible_Relation='".$_REQUEST['rel']."',Financially_Reponsible_Address='".mysqli_real_escape_string($con,$_REQUEST['add'])."', 	Financially_Reponsible_Contact='".$_REQUEST['ph']."',Financially_Reponsible_Email='".$_REQUEST['mail']."' where Lead_ID='".$Lead_Pa_Id."'";
							
							$responsible_query=mysqli_query($con,$responsible);
							}
							else
							{
								$responsiblefetch="select * from lead_contact_details where Lead_ID='".$Lead_Pa_Id."'";
								$responsiblefetch_query=mysqli_query($con,$responsiblefetch);
								$responsible_fetch=mysqli_fetch_array($responsiblefetch_query);
								
								$responsible_update="update `lead_contact_details` set Financially_Reponsible_Person='".$responsible_fetch['Contactperson_Name']."',Financially_Reponsible_Relation='".$responsible_fetch['Relationship']."',Financially_Reponsible_Address='".mysqli_real_escape_string($con,$responsible_fetch['Patient_Address1'])."',Financially_Reponsible_Contact='".$responsible_fetch['Contactperson_Phno']."',Financially_Reponsible_Email='".$responsible_fetch['Contact_Person_Email']."' where Lead_ID='".$Lead_Pa_Id."'";
								$responsible_update_query=mysqli_query($con,$responsible_update);
							}
							$checkemr="select * from patient_emergency_contact where Lead_ID='".$_REQUEST['lead_id']."'";
							$checkemr_query=mysqli_query($con,$checkemr);
							if(mysqli_num_rows($checkemr_query)==0)
							{
							$emergency="insert into patient_emergency_contact (Lead_ID,Contact_Name,Mobile_No,Relationship) values ('".$_REQUEST['lead_id']."','".$_REQUEST['Rname']."','".$responsible_fetch['Contactperson_Phno']."','".$_REQUEST['rel']."')";
							$emergency_query=mysqli_query($con,$emergency);
							}

						?>

                        <script>

						alert('Added successsfully');

						setTimeout( function() {

			

						window.parent.location.href="Pending_Agreement.php";

						},1000);

                        	

                        </script>

					<?php 
					}else
							{
							?>
                            <script>
                            alert('already exist');
							</script>
                            <?php
							}
					}

					?>

	<?php
		//$sqfetch="select * from lead_contact_details where Lead_ID='".$Lead_Pa_Id."'";

		//$agfetch=mysqli_query($con,$sqfetch);

		//$agfetch=mysqli_fetch_array($agfetch);
	

		//query for allocation_master

		$sqlag="select * from allocation_master where Lead_ID='".$Lead_Pa_Id."' and service_provide='Yes'";

		$agres=mysqli_query($con,$sqlag);

		$agrow=mysqli_fetch_array($agres);

		

		//query for service_master

		$sqlags="select * from service_master where Active='Yes'";

		$ags=mysqli_query($con,$sqlags);

		$count=mysqli_num_rows($ags);

		

		//query for Service_Rate_Master

		$pasql="select * from Service_Rate_Master";

	 	$pares=mysqli_query($con,$pasql);

		$pacount=mysqli_num_rows($pares);

		



	?>

    

    <div class="row">

    <form id="t_size" method="post" enctype="multipart/form-data" action="" onSubmit="return form_validation()" >

                <div class="col-md-12 fix-pad" id="org_div">

                

               	<!-- <div class="col-md-4">

               <div class="form-group">

                  <label>Lead id</label>

                  <input class="form-control radius_5" name="li" id="li" placeholder="li" onKeyPress="return isNumberKey(event,1)" autocomplete="off" value="<?php echo $agrow['Lead_ID']; ?>">

                    

                </div>

                </div>-->

                

                

                <div class="col-md-4">

               <div class="form-group">

                  <label>Pan Card No</label>

                  <input class="form-control radius_5" name="pan" id="pan" placeholder="Pan Card No" onKeyPress="return isNumberKey(event,1)" autocomplete="off" >

                    

                </div>

                </div>

                

                <div class="col-md-4">

               	<div class="form-group">

                  <label>Patient Name</label>

                  <input class="form-control radius_5" name="pName" id="pName" placeholder="R. K. Agarwal" onBlur="no_color_border('tyre_name')" autocomplete="off" value="<?php echo $agrow['patient_name']; ?>" readonly>

                </div>

                </div>
                
                 
        	
                
                 <div class="row" style="padding:0px 15px">
         <div class="datebg_1 col-sm-3">
        	<div class="datetxt_new_heading"><span style="color:#FF0000;"></span></div> 
            <div class="datetxt_new" style="padding:5px 0px 0px;">
            
            <fieldset class="row">
            <div class="col-md-12">FINANCIALLY RESPONSIBLE PERSON <input type="checkbox" id="financial" name="financial" onClick="show1();" value="Yes"></div><br>
            <span class="myClass">
             
        		<div class="datebg_1 col-sm-3" id="email_div" style="display:none; padding:0px;">
                 <div class="col-md-4">

               <div class="form-group">

                  <label>Responsible Person Name</label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                  <input class="form-control radius_5" name="Rname" id="Rname" placeholder="Responsible Person Name" autocomplete="off" >

                    

                </div>

                </div>
        
                <div class="col-md-4">

               <div class="form-group">

                  <label>Relationship</label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                  <input class="form-control radius_5" name="rel" id="rel" placeholder="Responsible Person Relation" autocomplete="off" >

                    

                </div>

                </div>
                
                <div class="col-md-4">

               <div class="form-group">

                  <label>Adderss</label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                  <textarea class="form-control radius_5" name="add" id="add" placeholder="Responsible Person Address" autocomplete="off" ></textarea>

                    

                </div>

                </div>

                 <div class="col-md-4">

               <div class="form-group">

                  <label>Contact No</label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                  <input class="form-control radius_5" name="ph" id="ph" placeholder="Responsible Person No" autocomplete="off" onKeyPress="return isNumberKey(event)" maxlength="10" data-msg-required="Please enter your phone number" data-rule-required="true" data-rule-minlength="10" data-rule-maxlength="10"/>

                    

                </div>

                </div>
                
                <div class="col-md-4">

               <div class="form-group">

                  <label>Email Id</label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                  <input class="form-control radius_5" name="mail" id="mail" placeholder="Responsible Person Mail" autocomplete="off" >

                    

                </div>

                </div>
                </div>
                
            </span>
            </fieldset>
                        

               <div class="col-md-4" style="padding:0px;">

               <div class="form-group">

                  <label>Service Type </label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                  <select class="form-control radius_5" name="Nursing" id="Nursing" onChange="add_childdetail()">

                  <option value="">Select Care </option>

                 <?php while ($agsrow=mysqli_fetch_array($ags))

                 	{

                 	?>

                    <option value="<?php echo $agsrow['SLN']; ?>"><?php echo $agsrow['Service'] ?></option>

                    <?php

                    }

					?>

                  </select>

                </div>

                </div>

         <div id="cnfrm_btn" style="display:none;">
         <label>Infant Date of Birth</label>
           <input type="text" id="start" class="form-control radius_5" name="dob" style="font-weight:bold;" placeholder="Please Select Date of Birth"><br/>
           <label>Infant Weight</label>
           <input type="text" id="weight" onKeyPress="return isNumberKey(event,1)" class="form-control radius_5" name="weight" style="font-weight:bold;" placeholder="Please Give Child Age"><br/>
           </div>

                 <div class="col-md-4" style="padding:0px;">

                <div class="form-group">

                  <label>Start Agreement Date </label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                 <input name="finish" id="finish" type="text" style="border:0px; border: 1px solid #e5e6e7; background-color:; width:100%; height:40px; padding-left:10px;" placeholder="Start Agreement Date" class="form-control txtbox_div" data-rule-required="true" data-msg-required="Please Select Visit date" onChange="total_calculation(),showDays(),Totalamount()" >

                    

                </div>

                </div>

                

                

                <div class="col-md-4" style="padding:0px;">

                <div class="form-group">

                  <label>Start Date </label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                 <input name="stdate" id="start12" type="text" style="border:0px; border: 1px solid #e5e6e7; background-color:; width:100%; height:40px; padding-left:10px;" placeholder="Visit Date" class="form-control txtbox_div" data-rule-required="true" data-msg-required="Please Select Visit date" onChange="total_calculation(),Totalamount()" >

                    

                </div>

                </div>

                

                <div class="col-md-4" style="padding:0px;">

               <div class="form-group">

                  <label> End Date</label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                  <input name="ndate" id="finish12" type="text" style="border:0px; border: 1px solid #e5e6e7; background-color:; width:100%; height:40px; padding-left:10px;" placeholder="End Date" class="form-control txtbox_div" data-rule-required="true" data-msg-required="Please Select Visit date" onChange="total_calculation(),Totalamount()" >

                    

                </div>

                </div>

                

                <div class="col-md-4" style="padding:0px;">

               <div class="form-group">

                  <label>Service Duration/session</label>

                 <input class="form-control radius_5" name="Duration" id="Duration" placeholder="Duration" onKeyPress="return isNumberKey(event,1)" autocomplete="off"  value="" readonly>

                </div>

                </div>

                

                <div class="col-md-4" style="padding:0px;">

               <div class="form-group">

                  <label> Rate Per session</label><span style="color:#FF0000; font-size:12px; padding-top:0px;">*</span>

                  <input class="form-control radius_5" name="Rate" id="Rate" placeholder="Rate Per session" onKeyPress="return isNumberKey(event,1)" autocomplete="off"  onKeyUp="Totalamount()"  onBlur="Totalamount()" >

                    

                </div>

                </div>

               	<div class="col-md-4" style="padding:0px;">

               	<div class="form-group">

                  <label>Total Payable</label>

                  <input class="form-control radius_5" name="Payable" id="numdays2" placeholder="Total Payable" onKeyPress="return isNumberKey(event,1)" autocomplete="off"  readonly >

					                 

               

                </div>

                </div>

                

                </div>

                

                <div class="col-md-3" id="banner_image_main_div" style="display:none; padding-top:25px; padding-bottom:20px;">

                <input type="file" class="radius_5" name="tyre_new_image" id="tyre_new_image">

                  <div class="img_tyre" id="banner_image_div" style="display:none;">

                  

                  </div>

                  <div class="" id="banner_new_image_div" style="display:none;">

                  

                  </div>

                </div>

                 

                <div class="col-md-12 fix-pad"> 
 

                  <div class="col-md-3"><button type="submit" class="btn btn-block btn-warning" name="tyre_submit" >ADD</button></div>

               </div><br>

                   </script>

               

                    

                    <!--<script>

        				function Multiply() 

					{

            			var a = document.getElementById("Duration").value;

            			var b = document.getElementById("Rate").value;

						var c = document.getElementById("Payable").value;

            			var result = parseInt(a) * parseInt(b) * parseInt(c);

            			alert(result);

						

        			}

    </script>-->

                </form>

    </div>



    <!-- jquery

		============================================ -->

    <script src="js/vendor/jquery-1.12.4.min.js"></script>

    <!-- bootstrap JS

		============================================ -->

    <script src="js/bootstrap.min.js"></script>

    <!-- wow JS

		============================================ -->

    <script src="js/wow.min.js"></script>

    <!-- price-slider JS

		============================================ -->

    <script src="js/jquery-price-slider.js"></script>

    <!-- meanmenu JS

		============================================ -->

    <script src="js/jquery.meanmenu.js"></script>

    <!-- owl.carousel JS

		============================================ -->

    <script src="js/owl.carousel.min.js"></script>

    <!-- sticky JS

		============================================ -->

    <script src="js/jquery.sticky.js"></script>

    <!-- scrollUp JS

		============================================ -->

    <script src="js/jquery.scrollUp.min.js"></script>

    

    

    <!-- data table JS

		============================================ -->

    <script src="js/data-table/bootstrap-table.js"></script>

    <script src="js/data-table/tableExport.js"></script>

    <script src="js/data-table/data-table-active.js"></script>

    <script src="js/data-table/bootstrap-table-editable.js"></script>

    <script src="js/data-table/bootstrap-editable.js"></script>

    <script src="js/data-table/bootstrap-table-resizable.js"></script>

    <script src="js/data-table/colResizable-1.5.source.js"></script>

    <script src="js/data-table/bootstrap-table-export.js"></script>

    

    

    

    <!-- mCustomScrollbar JS

		============================================ -->

    <script src="js/scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>

    <script src="js/scrollbar/mCustomScrollbar-active.js"></script>

    <!-- metisMenu JS

		============================================ -->

    <script src="js/metisMenu/metisMenu.min.js"></script>

    <script src="js/metisMenu/metisMenu-active.js"></script>

    <!-- peity JS

		============================================ -->

    <script src="js/peity/jquery.peity.min.js"></script>

    <script src="js/peity/peity-active.js"></script>

    <!-- sparkline JS

		============================================ -->

    <script src="js/sparkline/jquery.sparkline.min.js"></script>

    <script src="js/sparkline/sparkline-active.js"></script>

    <!-- tab JS

		============================================ -->

    <script src="js/tab.js"></script>

    <!-- plugins JS

		============================================ -->

    <script src="js/plugins.js"></script>

    <!-- main JS

		============================================ -->

    <script src="js/main.js"></script>

    <!-- tawk chat JS

		============================================ -->

        

         <script>

$(document).ready(function() {

   $("body").tooltip({ 

   	selector: '[data-toggle=tooltip]' 

	 });

});

 

</script>



  <script src="js/main.js"></script>



    <script src="js/datepicker/jquery-ui.min.js"></script>

    <script src="js/datepicker/datepicker-active.js"></script>

    

     <script src="js/form-validation/jquery.form.min.js"></script>

    <script src="js/form-validation/jquery.validate.min.js"></script>

    <script src="js/form-validation/form-active.js"></script>

    <!------------------------Fancybox---------------------------------->

 

 <script type="text/javascript" src="lib/jquery.mousewheel.pack.js"></script>



<script type="text/javascript" src="source/jquery.fancybox.pack.js?v=2.1.5"></script>

	<link rel="stylesheet" type="text/css" href="source/jquery.fancybox.css" media="screen" />



<style type="text/css">

	.fancybox-custom .fancybox-skin {

		box-shadow: 0 0 50px #222;

	}

</style> 

<script>

$(document).ready(function() {

	$(".various").fancybox({

		maxWidth	: 380,

		maxHeight	: 410,

		fitToView	: true,

		width		: '100%',

		height		: '100%',

		autoSize	: false,

		closeClick	: false,

		openEffect	: 'none',

		closeEffect	: 'none',

		

		

		

		

	});

	

	$(".various5").fancybox({



		maxWidth	: 700,



		maxHeight	: 530,



		fitToView	: false,



		width		: '100%',



		height		: '100%',



		autoSize	: false,



		closeClick	: false,



		openEffect	: 'none',



		closeEffect	: 'none'



	});

	

 

});



</script>



<script type="text/javascript">

$("#manual").validate({

          

      showErrors: function(errorMap, errorList) {

          // Clean up any tooltips for valid elements

          $.each(this.validElements(), function (index, element) {

              var $element = $(element);

              $element.data("title", "") // Clear the title - there is no error associated anymore

                  .removeClass("error")

                  .tooltip("destroy");

          });

          // Create new tooltips for invalid elements

          $.each(errorList, function (index, error) {

              var $element = $(error.element);



              $element.tooltip("destroy") // Destroy any pre-existing tooltip so we can repopulate with new tooltip content

                  .data("title", error.message)

                  .addClass("error")

                  .tooltip(); // Create a new tooltip based on the error messsage we just set in the title

          });

      },



     

	  

});

</script> 

<!--    <script src="js/tawk-chat.js"></script>-->

</body>



</html>