var href = '';
function CallPopup() {
    $("#mainmenu li").bind('click', function() {
        href = $(this).find('a:first').attr('href');
        ModalPopups.Confirm("idConfirm1",
                            "Confirmation",
                            "<div style='padding: 25px;'>All data will be lost.<br/><br/><b>Do you want to leave this page?</b></div>",
                            {
                                yesButtonText: "Yes",
                                noButtonText: "No",
                                onYes: "ModalPopupsConfirmYes()",
                                onNo: "ModalPopupsConfirmNo()"
                            }
                        );
        return false;
    });

    $("#menutop li").bind('click', function () {
        href = $(this).find('a:first').attr('href');
        ModalPopups.Confirm("idConfirm1",
                                    "Confirmation",
                                    "<div style='padding: 25px;'>All data will be lost.<br/><br/><b>Do you want to leave this page?</b></div>",
                                    {
                                        yesButtonText: "Yes",
                                        noButtonText: "No",
                                        onYes: "ModalPopupsConfirmYes()",
                                        onNo: "ModalPopupsConfirmNo()"
                                    }
                                );
        return false;
    });

//    $(".submitsearch").bind('click', function() {
//        if (confirm("On Leaving this page, your all data will be lost !") == true) {
//        } else {
//            return false;
//        }
//    });

    $("#boxcontact a").bind('click', function() {
        href = $(this).attr('href');
        ModalPopups.Confirm("idConfirm1",
                                    "Confirmation",
                                    "<div style='padding: 25px;'>All data will be lost.<br/><br/><b>Do you want to leave this page?</b></div>",
                                    {
                                        yesButtonText: "Yes",
                                        noButtonText: "No",
                                        onYes: "ModalPopupsConfirmYes()",
                                        onNo: "ModalPopupsConfirmNo()"
                                    }
                                );
        return false;
    });

    //document.getElementsByName("searchButton").disabled = 'disabled';
    jQuery('input[name="searchButton"]').attr('disabled', 'disabled');
}

function ModalPopupsConfirmYes() {
    ModalPopups.Close("idConfirm1");
    window.location.href = href;
}
function ModalPopupsConfirmNo() {
    ModalPopups.Cancel("idConfirm1");
    return false;
}
