





//********************************************ecno conditon*****************************//


function ecno_cdtn_no_validate(ecno_cdtn)


{


	


    valid = true;


	if(ecno_cdtn==0 )


    {


		document.getElementById("ecno_cdtn_no_err_design").style.display = "block";


		document.getElementById("ecno_cdtn_no_err_msg").style.display = "block";


        return false;


    }


	else


	{


		document.getElementById("ecno_cdtn_no_err_design").style.display = "none";


		document.getElementById("ecno_cdtn_no_err_msg").style.display = "none";


        return false;





	}


}


//*************************************spouse_present_validate***********************//


function spouse_present_no_validate (spouse_present)


{


valid = true;


	if(spouse_present== "" )


    {


		document.getElementById("spouse_present_no_err_design").style.display = "block";


		document.getElementById("spouse_present_no_err_msg").style.display = "block";


        return false;


    }


	


	else


	{


		document.getElementById("spouse_present_no_err_design").style.display = "none";


		document.getElementById("spouse_present_no_err_msg").style.display = "none";


        return false;





	}


}


//*****************************************familiarity_validate***********************


function familiarity_no_validate (familiarity)


{


    valid = true;


	if(familiarity== "" )


    {


		document.getElementById("familiarity_no_err_design").style.display = "block";


		document.getElementById("familiarity_no_err_msg").style.display = "block";


        return false;


    }


	else


	{


		document.getElementById("familiarity_no_err_design").style.display = "none";


		document.getElementById("familiarity_no_err_msg").style.display = "none";


        return false;





	}


}


////****************************************condition_validate**************************************//


function condition_no_validate (condition)


{


    valid = true;


	if(condition== "" )


    {


		document.getElementById("condition_no_err_design").style.display = "block";


		document.getElementById("condition_no_err_msg").style.display = "block";


        return false;


    }


	else


	{


		document.getElementById("condition_no_err_design").style.display = "none";


		document.getElementById("condition_no_err_msg").style.display = "none";


        return false;





	}


}





//******************************************************************************************//


function reson_no_validate (reason)


{


    valid = true;


	if(reason== "" )


    {


		document.getElementById("reson_no_validate_err_design").style.display = "block";


		document.getElementById("reson_no_validate_err_msg").style.display = "block";


        return false;


    }


	else


	{


		document.getElementById("reson_no_validate_err_design").style.display = "none";


		document.getElementById("reson_no_validate_err_msg").style.display = "none";


        return false;





	}


}








//*************************************************************************************************//





function name_no_validate (lead_first_name)


{


    valid = true;


	if(lead_first_name== "" )


    {


		document.getElementById("name_referal_no_err_design").style.display = "block";


		document.getElementById("name_referal_no_err_msg").style.display = "block";


        return false;


    }


	if(lead_first_name.length <=3 )


    {


		document.getElementById("name_referal_no_err_design").style.display = "block";


		document.getElementById("name_referal_no_err_msg").style.display = "block";


        return false;    }





	else


	{


		document.getElementById("name_referal_no_err_design").style.display = "none";


		document.getElementById("name_referal_no_err_msg").style.display = "none";


        return false;





	}


}














function phone_no_validate (phone_no)


{


    valid = true;





	if(phone_no== "" )


    {


		document.getElementById("pre_referal_no_err_design").style.display = "block";


		document.getElementById("pro_referal_no_err_msg").style.display = "block";


        return false;


    }


	if(phone_no.length <6 )


    {


		document.getElementById("pre_referal_no_err_design").style.display = "block";


		document.getElementById("pro_referal_no_err_msg").style.display = "block";


        return false;


    }





	else


	{


		document.getElementById("pre_referal_no_err_design").style.display = "none";


		document.getElementById("pro_referal_no_err_msg").style.display = "none";


        return false;





	}


}


//*******************************************************************************************//


function phone_no_validate1 (phone_no)


{


    valid = true;





	if(phone_no== "" )


    {


		document.getElementById("pre_no_err_design").style.display = "block";


		document.getElementById("pro_no_err_msg").style.display = "block";


        return false;


    }


	if(phone_no.length <6 )


    {


		document.getElementById("pre_no_err_design").style.display = "block";


		document.getElementById("pro_no_err_msg").style.display = "block";


        return false;


    }





	else


	{


		document.getElementById("pre_no_err_design").style.display = "none";


		document.getElementById("pro_no_err_msg").style.display = "none";


        return false;





	}


}


//************************************************NOTE VALIDAE**************************************//


function note_no_validate (note)


{


    valid = true;


	if(note== "" )


    {


		document.getElementById("note_no_referal_err_design").style.display = "block";


		document.getElementById("note_no_referal_err_msg").style.display = "block";


        return false;


    }


	if(note.length <=3 )


    {


		document.getElementById("note_no_referal_err_design").style.display = "block";


		document.getElementById("note_no_referal_err_msg").style.display = "block";


        return false;    }





	else


	{


		document.getElementById("note_no_referal_err_design").style.display = "none";


		document.getElementById("note_no_referal_err_msg").style.display = "none";


        return false;





	}


}





//****************************** NEW PROSPECTOR ***************************************//


var p9= jQuery.noConflict();





function exe_demo_condition_no(ecno_cdtn,spouse_present,familiarity,condition,note,pro_id,reason,demo_status,referal_count)


{ 


/*if(referal_count!=0)


{


*/	if((ecno_cdtn!="")&&(spouse_present!='')&&(familiarity!='')&&(condition!=''))


	{


		


		p9("#exe_demo_div_no").html('<img src="images/ajax-loader.gif">Loading...');


		p9.ajax({


		type: "GET",


		url: "scheduled_demos/executed_demo_status/executed_demo_condition_db_no.php",


		data: "ecno_cdtn="+ecno_cdtn+"&spouse_present="+spouse_present+"&familiarity="+familiarity+"&condition="+condition+"&note="+note+"&prospector_id="+pro_id+"&reason="+reason+"&demo_status="+demo_status+"&action=SUBMIT",


		success: function(msg){p9("#exe_demo_div_no").html(msg);}


		});


		window.close();


	}


	else


	{


ecno_cdtn_no_validate(ecno_cdtn),spouse_present_no_validate(spouse_present),familiarity_no_validate (familiarity),condition_no_validate (condition);


	}


}


/*else


{


			alert("Add Referals...!");


			document.prospector_entry_form.referal_name.focus();


	}


}


*/


//*********************************************************************************************************//


function add_referals_no_demo(referal_name,referal_last_name,referal_last_name1,phone_no,refered_phone_no,refered_by,pro_id)


{ 


	if((phone_no!="")&&(referal_name!=""))


	{		


		p9("#exe_demo_no_referal_div").html('<img src="images/ajax-loader.gif"> Loading...');


		p9.ajax({


		type: "GET",


		url: "scheduled_demos/executed_demo_status/executed_demo_condition_db_no.php",


		data: "referal_name="+referal_name+"&referal_last_name="+referal_last_name+"&referal_last_name1="+referal_last_name1+"&phone_no="+phone_no+"&refered_phone_no="+refered_phone_no+"&refered_by="+refered_by+"&prospector_id="+pro_id+"&action=ADD",


		success: function(msg){p9("#exe_demo_no_referal_div").html(msg);}


		});


		document.getElementById("referal_name").value="";


		document.getElementById("referal_last_name").value="";


		document.getElementById("referal_last_name1").value="";


		document.getElementById("phone_no").value="";





		


		alert("Referral Added.");


	}


	else


	{


		phone_no_validate(phone_no),name_no_validate (referal_name);


	}


}


/********************************************************************************************************************/


function delete_list_prospecno(delete_id,prospector_id)


{


if(confirm('Are You Sure! You Want To Delete?'))


{


		p8("#exe_demo_no_referal_div").html('<img src="images/ajax-loader.gif"> Loading...');


		p8.ajax({


		type: "GET",


		url: "scheduled_demos/executed_demo_status/executed_demo_condition_db_no.php",


		data: "delete_id="+delete_id+"&prospector_id="+prospector_id+"&action=ref_delete",


		success: function(msg){p8("#exe_demo_no_referal_div").html(msg);}


		});


}


}





