70aa240532843bc6f741e163b18c596014907e6c24c91998b270fe3efa77bca7

Source Code:

function validatealphanumeric(ele){
    var TCode = $(ele).val().trim();

    if( /[^a-zA-Z0-9\-\.\/]/.test( TCode ) ) {
        return false;
    }
	return true;     
}

function OnlyNewmeric(element)
	{
	$(function(){
		$(element).keydown(function(e){
			if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110]) !== -1 ||
				 // Allow: Ctrl+A
				(e.keyCode == 65 && e.ctrlKey === true) || 
				 // Allow: home, end, left, right
				(e.keyCode >= 35 && e.keyCode <= 39)) {
					 // let it happen, don't do anything
					 return;
			}
			// Ensure that it is a number and stop the keypress

			if ((e.shiftKey ||  (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
				//alert('here123');
				e.preventDefault();
			}else{
					$(element).val().trim();
				}
		});
	});
	}

function validate(email) {
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
    var address = email;
    if(reg.test(address) == false) {
        return false;
    } else {
        return true;
    }
}

function DoValidateZipcode(zipcode)
{
    var reg=/^[0-9a-zA-Z]{5,9}$/;
    var isGoodMatch = zipcode.match(reg);
    //alert(isGoodMatch)
    if (!isGoodMatch) {
        return false;
    }
    else
    {
        return true;
    }
}

//Phone Number
function DoValidatePhone(phone)
{
    var reg=/^[0123456789.-]+$/;
    var isGoodMatch = phone.match(reg);
    //alert(isGoodMatch)
    if (!isGoodMatch) {
        return false;
    }
    else
    {
        return true;
    }
}

function hide_messaget_main_error(control)
{
    document.getElementById(control).style.display="none";
}

function SignupFormSubmit(serverpath)
{
   var signup_type = document.getElementById('signup_type').value;
   var username = document.getElementById('username').value;
   var password = document.getElementById('password').value;
   var email = document.getElementById('email').value;
   var zipcode = document.getElementById('zipcode').value;
   var username_hidden = document.getElementById('username_hidden').value;
   var email_hidden = document.getElementById('email_hidden').value;
   var terms = document.getElementById('terms').checked;
   if(terms==true){
        document.getElementById('terms').value=1;
   }else{
       document.getElementById('terms').value=0;
   }
   if(signup_type==""){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Please Select Signup Type.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("signup_type").focus();
       return false;
   }else if(username==""){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Please Enter Username.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("username").focus();
       return false;
   }else if(username_hidden==0){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Username Already exist.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("username").focus();
       return false;
   }else if(password==""){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Please Enter Password.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("password").focus();
       return false;
   }else if(password.length<4){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Password should be in 4 digit/characters.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("password").focus();
       return false;
   }else if(email==""){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Please Enter Email.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("email").focus();
       return false;
   }else if((email!="") && (!validate(email))){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Please Enter Valid Email.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("email").focus();
       return false;
   }else if(email_hidden==0){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Email Already exist.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("email").focus();
       return false;
   }else if(zipcode==""){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Please Enter Zipcode.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("zipcode").focus();
       return false;
   }else if((zipcode!="") && (!DoValidateZipcode(zipcode))){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Please Enter Valid Zipcode.';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       document.getElementById("zipcode").focus();
       return false;
   }else if(terms==false){
       document.getElementById("alert_error").style.display="block";
       document.getElementById("alert_error").innerHTML='Error, Please Click on "I agree, sign me up".';
       setTimeout("hide_messaget_main_error('alert_error')",5000);
       return false;
   }
}
function checkUserNameAvailability(username,type,path)
{
    if(username!='' && type!='')
    {
        if(username.length >0 && type.length >0)
        {
            $.ajax({
                type: 'POST',
                url: path,
                dataType: 'json',
                data: 'username=' + username + '&signuptype=' + type ,
                success: function(response)
                {
                    //alert(response);
                    if(response.error){
                        document.getElementById("alert_error").style.display="block";
                        document.getElementById("alert_error").innerHTML='Error, Username Already exist.';
                        setTimeout("hide_messaget_main_error('alert_error')",5000);
                        document.getElementById("username").focus();
                        document.getElementById('username_hidden').value=0;
                        return false;
                    }else
                    {
                       // document.getElementById("alert_error").style.display="none";
                        document.getElementById('username_hidden').value=1;
                        return true;
                    }
                }
            });
        }
    }
}
function checkEmailAvailability(email,type,path)
{
    if(email!='' && type!='')
    {
        if(email.length >0 && type.length >0)
        {
            if(!validate(email)){
                document.getElementById("alert_error").style.display="block";
                document.getElementById("alert_error").innerHTML='Error, Please Enter Valid Email.';
                setTimeout("hide_messaget_main_error('alert_error')",5000);
                document.getElementById("email").focus();
                return false;
            }
            $.ajax({
                type: 'POST',
                url: path,
                dataType: 'json',
                data: 'email=' + email + '&signuptype=' + type ,
                success: function(response)
                {
                    if(response.error){
                        document.getElementById("alert_error").style.display="block";
                        document.getElementById("alert_error").innerHTML='Error, Email Already exist.';
                        setTimeout("hide_messaget_main_error('alert_error')",5000);
                        document.getElementById("email").focus();
                        document.getElementById('email_hidden').value=0;
                        return false;
                    }else
                    {
                        //document.getElementById("alert_error").style.display="none";
                        document.getElementById('email_hidden').value=1;
                        return true;
                    }
                }
            });
        }
    }
}

function LoginFormSubmit()
{
    var login_type = document.getElementById('login_type').value;
    var username = document.getElementById('username').value;
    var password = document.getElementById('password').value;
    if(login_type==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Select Login Type.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("login_type").focus();
        return false;
    }else if(username==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter Username.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("username").focus();
        return false;
    }else if(password==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter Password.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("password").focus();
        return false;
    }else if(password.length<4){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Password should be in 4 digit/characters.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("password").focus();
        return false;
    }
}

function FogotPasswordFormSubmit()
{
    var user_type = document.getElementById('user_type').value;
    var fusername = document.getElementById('fusername').value;
    if(user_type==""){
        document.getElementById("alert_error1").style.display="block";
        document.getElementById("alert_error1").innerHTML='Error, Please Select User Type.';
        setTimeout("hide_messaget_main_error('alert_error1')",5000);
        document.getElementById("user_type").focus();
        return false;
    }else if(fusername==""){
        document.getElementById("alert_error1").style.display="block";
        document.getElementById("alert_error1").innerHTML='Error, Please Enter Username.';
        setTimeout("hide_messaget_main_error('alert_error1')",5000);
        document.getElementById("fusername").focus();
        return false;
    }
}

function ResetPasswordFormSubmit()
{
    var resetPassword = document.getElementById('resetPassword').value;
    var resetConPassword = document.getElementById('resetConPassword').value;
    if(resetPassword==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Fill Password.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("resetPassword").focus();
        return false;
    }else if(resetPassword.length<4){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Password should be in 4 digit/characters.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("resetPassword").focus();
        return false;
    }else if(resetConPassword==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Fill Confirm Password.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("resetConPassword").focus();
        return false;
    }else if(resetPassword!=resetConPassword){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Match Password and Confirm Password.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("resetConPassword").focus();
        return false;
    }
}

function checkEditUserNameAvailability(username,type,path,userid)
{
    if(username!='' && type!='')
    {
        if(username.length >0 && type.length >0)
        {
            $.ajax({
                type: 'POST',
                url: path,
                dataType: 'json',
                data: 'username=' + username + '&signuptype=' + type + '&user_id=' + userid,
                success: function(response)
                {
                    //alert(response);
                    if(response.error){
                        document.getElementById("alert_error").style.display="block";
                        document.getElementById("alert_error").innerHTML='Error, Username Already exist.';
                        setTimeout("hide_messaget_main_error('alert_error')",5000);
                        document.getElementById("eusername").focus();
                        document.getElementById('eusername_hidden').value=0;
                        return false;
                    }else
                    {
                        // document.getElementById("alert_error").style.display="none";
                        document.getElementById('eusername_hidden').value=1;
                        return true;
                    }
                }
            });
        }
    }
}

function updateProfileFormSubmit(){
    var name = document.getElementById('name').value;
    var eusername = document.getElementById('eusername').value;
    var eusername_hidden = document.getElementById('eusername_hidden').value;
    var country = document.getElementById('country').value;
    var stateDiv = document.getElementById('stateDiv').value;
    var city = document.getElementById('city').value;
    var address = document.getElementById('address').value;
    var ezipcode = document.getElementById('ezipcode').value;
    var contactno = document.getElementById('contactno').value;
    if(name==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter Name.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("name").focus();
        return false;
    }else if(eusername==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter Username.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("eusername").focus();
        return false;
    }else if(eusername_hidden==0){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Username Already exist.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("eusername").focus();
        return false;
    }else if(country=="" ||country==0){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Select Country.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("country").focus();
        return false;
    }else if(stateDiv=="" ||stateDiv==0){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Select State.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("stateDiv").focus();
        return false;
    }else if(city==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter City.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("city").focus();
        return false;
    }else if(address==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter Address.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("address").focus();
        return false;
    }else if(ezipcode==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter Zipcode.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("ezipcode").focus();
        return false;
    }else if((ezipcode!="") && (!DoValidateZipcode(ezipcode))){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter Valid Zipcode.';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("ezipcode").focus();
        return false;
    }else if(contactno==""){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter Contact no..';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("contactno").focus();
        return false;
    }else if((contactno!="") && (!DoValidatePhone(contactno))){
        document.getElementById("alert_error").style.display="block";
        document.getElementById("alert_error").innerHTML='Error, Please Enter Valid Contact No..';
        setTimeout("hide_messaget_main_error('alert_error')",5000);
        document.getElementById("contactno").focus();
        return false;
    }
}

function LoaderShow()
{
    if(jQuery('body').find('#resultLoading').attr('id') != 'resultLoading'){
        jQuery('body').append('<div id="resultLoading" style="display:none"><div><img src="' + SiteUrl + 'images/ajax-loader.gif"><div></div></div><div class="bg"></div></div>');
}

    jQuery('#resultLoading').css({
        'width':'100%',
        'height':'100%',
        'position':'fixed',
        'z-index':'10000000',
        'top':'0',
        'left':'0',
        'right':'0',
        'bottom':'0',
        'margin':'auto'
    });

    jQuery('#resultLoading .bg').css({
        'background':'#000000',
        'opacity':'0.7',
        'width':'100%',
        'height':'100%',
        'position':'absolute',
        'top':'0'
    });

    jQuery('#resultLoading>div:first').css({
        'width': '250px',
        'height':'75px',
        'text-align': 'center',
        'position': 'fixed',
        'top':'0',
        'left':'0',
        'right':'0',
        'bottom':'0',
        'margin':'auto',
        'font-size':'16px',
        'z-index':'10',
        'color':'#ffffff'

    });

    jQuery('#resultLoading .bg').height('100%');
    jQuery('#resultLoading').fadeIn(300);
    jQuery('body').css('cursor', 'wait');
}

function LoaderHide()
{
    jQuery('#resultLoading .bg').height('100%');
    jQuery('#resultLoading').fadeOut(300);
    jQuery('body').css('cursor', 'default');
}

$(document).ready(function(){

    $("#loginplus").click(function(){
        $('#logindiv_popup').show();
        $('#logindiv_popup').fadeOut(200);
    });
});

/*
$(window).bind("load", function() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition);
    } else {
        alert("Distance Filter will not work due to Geolocation is not supported by this browser.") ;
    }
});

function showPosition(position) {
    //$('#lat').val(position.coords.latitude);
    //$('#long').val(position.coords.longitude);
    //alert($('#lat').val());
        $.ajax({
            type:'post',
            dataType:'json',
            url:SiteUrl+'patient/setlatlng',
            data:{latitude:position.coords.latitude,longitude:position.coords.longitude},
            success:function(result){
                if(result.set){
                    //  window.setTimeout(location.reload(), 1000);
                }
            }
        });
    // document.getElementById('search_form').submit();
    //HTMLFormElement.prototype.submit.call($('#search_form')[0]);

}
*/

$(document).ready(function(){
    $('input[name=price_option]').click(function(){
        if($('#radio4').is(':checked')){
            $('#proposed_amount').show();

        }else{
            $('#proposed_amount').hide();
            $('.error-text').hide();
        }
    });

    $('#submitForm').click(function(){
        if($('#radio4').is(':checked') && $('#proposed_amount').val()==''){
            $('.error-text').show();
            return false;

        }

    });

    $('.show-hint').mouseover(function(){
        $(this).find('#hint').show();
    });
    $('.show-hint').mouseout(function(){
        $(this).find('#hint').hide();
    });

});
function LoadMoreData(container_ele, item_ele, pagination_ele, next_page_url_ele, box_type) {
    var next_page_url = '';


    next_page_url = $(next_page_url_ele).attr('href');


    $(container_ele + ' .loadmoredata').remove();


    console.log($(container_ele).length)
    console.log($(item_ele).length)
    console.log($(pagination_ele).length)
    console.log($(next_page_url_ele).length)
    console.log(next_page_url)

    if ($(container_ele).length > 0 && $(item_ele).length > 0 && $(pagination_ele).length > 0 && $(next_page_url_ele).length > 0 && (next_page_url != undefined || next_page_url != '')) {
        $(pagination_ele).hide();
        next_page_url = $(next_page_url_ele).attr('href');
        if (next_page_url != '') {

            $(container_ele).append('<div class="loadmoredata"><a href="javascript:void(0);" class="loadmoredata_tag">View More</a></div>');
        }
    }
    else {
        $(pagination_ele).hide();
        $(container_ele + ' .loadmoredata').remove();
    }


    $(container_ele + ' .loadmoredata_tag').click(function () {

        if (next_page_url_ele) {

            $(this).parent().remove();
            $(container_ele).append('<div class="loadmoredata"><img src="' + SiteUrl + 'images/loading.gif"></div>');
            //console.log(next_page_url);
            $.get(next_page_url, function (data) {
                var container_content = $(data).find(container_ele).html();
                if (container_content) {

                    if ($(data).find(item_ele).length > 0) {
                        $(data).find(item_ele).each(function () {
                            var classes = $(this).attr('class');
                            var style = $(this).attr('class');
                            var ids = $(this).attr('class');
                            var item_html = $(this).html();
                            var attr_list = '';
                            if (ids) {
                                attr_list += ' id="' + ids + '" ';
                            }

                            if (classes) {
                                attr_list += ' class="' + classes + '" ';
                            }

                            if (style) {
                                attr_list += ' style="' + style + '" ';
                            }


                            $(item_ele + ':last').after('<' + box_type + attr_list + '>' + item_html + '</' + box_type + '>');


                        });
                    }

                    $(pagination_ele).html($(data).find(pagination_ele).html());

                    //console.log(container_content);
                    //$(container_ele).html(container_content);
                    LoadMoreData(container_ele, item_ele, pagination_ele, next_page_url_ele, box_type);
                }
            });
        }
    });
}

function LoadMoreDataDashboard(container_ele, item_ele, pagination_ele, next_page_url_ele, box_type) {
    var next_page_url = '';


    next_page_url = $(next_page_url_ele).attr('href');


    $(container_ele + ' .loadmoredataDashboard').remove();

    if ($(container_ele).length > 0 && $(item_ele).length > 0 && $(pagination_ele).length > 0 && $(next_page_url_ele).length > 0 && (next_page_url != undefined || next_page_url != '')) {
        $(pagination_ele).hide();
        next_page_url = $(next_page_url_ele).attr('href');
        if (next_page_url != '') {

            $(container_ele).append('<div class="loadmoredataDashboard"><div align="center"><a href="javascript:void(0);" class="view-more">VIEW MORE</a></div>');
        }
    }
    else {
        $(pagination_ele).hide();
        $(container_ele + ' .loadmoredataDashboard').remove();
    }


    $(container_ele + ' .view-more').click(function () {

        if (next_page_url_ele) {

            $(this).parent().remove();
            $(container_ele).append('<div class="loadmoredataDashboard"><img src="' + SiteUrl + 'images/loading.gif"></div>');
            console.log(next_page_url);
            $.get(next_page_url, function (data) {

                var container_content = $(data).find(container_ele).html();
                if (container_content) {
                    if ($(data).find(item_ele).length > 0) {
                        $(data).find(item_ele).each(function () {
                            var classes = $(this).attr('class');
                            var style = $(this).attr('class');
                            var ids = $(this).attr('class');
                            var item_html = $(this).html();



                            var attr_list = '';
                            if (ids) {
                                attr_list += ' id="' + ids + '" ';
                            }

                            if (classes) {
                                attr_list += ' class="' + classes + '" ';
                            }

                            if (style) {
                                attr_list += ' style="' + style + '" ';
                            }


                            $(item_ele + ':last').after('<' + box_type + attr_list + '>' + item_html + '</' + box_type + '>');


                        });
                    }

                    $(pagination_ele).html($(data).find(pagination_ele).html());

                    //console.log(container_content);
                    //$(container_ele).html(container_content);
                    LoadMoreDataDashboard(container_ele, item_ele, pagination_ele, next_page_url_ele, box_type);
                }
            });
        }
    });
}