﻿
function htmlEncode(value) { return $('<div/>').text(value).html(); }
function htmlDecode(value) { return $('<div/>').html(value).text(); }
jQuery.fn.center = function () {
    this.css("position", "absolute"); this.css("top", ($(window).height() - this.height()) / 2 + $(window).scrollTop() + "px");
    this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
    return this;
}



$(document).ready(function () {
    //create a bubble popup for each DOM element with class attribute as "button"
    $('div.help').CreateBubblePopup();
    $('div.help').each(function () {
        $(this).SetBubblePopupOptions({

            position: 'left',
            align: 'center',
            tail: { align: 'right', hidden: true },
            innerHtml: $(this).html(),
            innerHtmlStyle: { 'text-align': 'center' },
            themeName: 'all-orange',
            themePath: '/CM/CSS/RTL/jquerybubblepopup-theme',
            alwaysVisible: false,
            dropShadow: true,
            manageMouseEvents: true,
            closingDelay: 200
        });
    });

    $("input.englishonly").keypress(function (event) {
        if (event.which > 128) {
            alert('این بخش باید بصورت انگلیسی و مطابق گذرنامه وارد شود.');
            event.preventDefault();
        }
    });
});
