﻿(function (a) { var c = {}; c.divcounter = 0; c.tabpos = ["", "0001021020212212", "00010203041020304041424344142434", "000102030405061020304050606162636465162636465666"]; c.font = { serif: "Georgia, 'Times New Roman', 'Century Schoolbook L', serif", sans_serif: "Verdana, Helvetica, Arial, 'URW Gothic L', sans-serif", monospace: "'Courier New', Courier, 'DejaVu Sans Mono', monospace", fantasy: "Impact, Papyrus, fantasy", cursive: "'Comic Sans MS' cursive" }; a.fn.FontEffect = function (f) { function e(d) { d = d.substring(1); if (d.length == 3) d = d.charAt(0) + d.charAt(0) + d.charAt(1) + d.charAt(1) + d.charAt(2) + d.charAt(2); return "rgb(" + parseInt(d.substring(0, 2), 16) + ", " + parseInt(d.substring(2, 4), 16) + ", " + parseInt(d.substring(4, 6), 16) + ")" } function m(d) { return /(#([0-9A-Fa-f]{3,6})\b)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/.test(d) } function s(d) { if (m(d)) { d = d.toUpperCase(); if (d.charAt(0) == "#") d = e(d); d = d.substring(4, d.length - 1).split(", "); var j = 255 - parseInt(d[0]), g = 255 - parseInt(d[1]); d = "rgb(" + (255 - parseInt(d[2])) + ", " + j + ", " + g + ")" } return d } var b = a.extend({ outline: false, outlineColor1: "", outlineColor2: "", outlineWeight: 1, mirror: false, mirrorColor: "#000", mirrorOffset: -10, mirrorHeight: 50, mirrorDetail: 1, mirrorTLength: 50, mirrorTStart: 0.2, shadow: false, shadowColor: "#aaa", shadowOffsetTop: 5, shadowOffsetLeft: 5, shadowBlur: 1, shadowOpacity: 0.1, gradient: false, gradientColor: "", gradientFromTop: true, gradientPosition: 20, gradientLength: 50, gradientSteps: 20, proportional: false, hideText: false, debug: false }, f); this.not(".JQFE").each(function () { if (!b.outline && !b.shadow && !b.mirror && !b.gradient) b.outline = true; if (b.outline) { if (b.outlineColor1 == "" && b.outlineColor2 == "") b.outlineColor1 = s(a(this).css("color")); if (b.outlineColor2 == "") b.outlineColor2 = b.outlineColor1 } if (b.gradient && b.gradientColor == "") b.gradientColor = s(a(this).css("color")); var d = a(this).css("display"), j = a(this).css("position"); a(this).css({ display: "inline", position: j == "absolute" ? "absolute" : "relative" }); var g = a(this).height(); j = a(this).width() * 1.04 + "px"; var k = g + "px", o = a(this).html(); a(this).data("options", b).addClass("JQFE").css({ width: j, height: k, display: d, position: a(this).css("position") != "absolute" ? "relative" : "absolute", zoom: 1 }); d = a("<div></div>").css({ width: j, height: k, position: "relative" }); d.append(a("<div class='JQFEText'>" + o + "</div>").css({ display: b.hideText ? "none" : "inline", width: j, height: k, position: "relative", zIndex: 100 })); var r = a("<div></div>").css({ width: j, height: k, left: "0px", position: "absolute", top: parseInt(a(this).css("paddingTop")) * 0 + "px", zIndex: 110 }), p = a(r).clone().css({ zIndex: 90 }); c.divounter += 4; a(this).html(""); if (b.mirror) for (i = 0; i < g * (b.mirrorHeight / 100); i++) { if (b.proportional) var h = (g + b.mirrorOffset + i * b.mirrorDetail).pxToEm({ scope: this }), l = b.mirrorDetail.pxToEm({ scope: this }), n = (g * -1 + i * (100 / b.mirrorHeight)).pxToEm({ scope: this }); else { h = g + b.mirrorOffset + i * b.mirrorDetail + "px"; l = b.mirrorDetail + "px"; n = g * -1 + i * (100 / b.mirrorHeight) + "px" } var q = b.mirrorTStart - i * (b.mirrorTStart / (b.mirrorHeight / 100 * b.mirrorTLength)); h = a("<div class='JQFEMirror'></div>").css({ position: "absolute", top: h, height: l, width: j, overflow: "hidden" }).append(a("<div>" + o + "</div>").css({ position: "absolute", color: b.mirrorColor, top: n, opacity: q })); c.divounter += i * 2; if (q < 0.01) break; p.append(h) } if (b.outline) { l = b.outlineWeight * 8; n = c.tabpos[b.outlineWeight]; for (i = 0; i < l; i++) { h = a("<div class='JQFEOutline'>" + o + "</div>").css({ position: "absolute", top: n.charAt(i * 2) - b.outlineWeight + "px", left: n.charAt(i * 2 + 1) - b.outlineWeight + "px", width: j, color: i < l / 2 + b.outlineWeight ? b.outlineColor1 : b.outlineColor2, zIndex: i > l - l / 3 ? 20 : 30 }); c.divounter += i; p.append(h) } } if (b.shadow) { l = b.shadowBlur * 8; n = c.tabpos[b.shadowBlur]; for (i = 0; i < l; i++) { h = a("<div class='JQFEShadow'>" + o + "</div>").css({ opacity: b.shadowOpacity, position: "absolute", top: n.charAt(i * 2) - b.shadowBlur + b.shadowOffsetTop + "px", left: n.charAt(i * 2 + 1) - b.shadowBlur + b.shadowOffsetLeft + "px", width: j, height: k, color: b.shadowColor, zIndex: 10 }); c.divounter += i; p.append(h) } } if (b.gradient) { k = Math.round(g * b.gradientLength * 0.01 / b.gradientSteps); g = g * b.gradientPosition * 0.01; q = 1 / b.gradientSteps; var t = b.gradientColor; for (i = 0; i < b.gradientSteps; i++) { if (b.proportional) { h = ((i == 0 ? 0 : g) + i * k).pxToEm({ scope: this }); l = ((i == 0 ? g : 0) + k).pxToEm({ scope: this }); n = (((i == 0 ? 0 : g) + i * k) * -1).pxToEm({ scope: this }) } else { h = (i == 0 ? 0 : g) + i * k + "px"; l = (i == 0 ? g : 0) + k + "px"; n = ((i == 0 ? 0 : g) + i * k) * -1 + "px" } h = a("<div class='JQFEGradient'></div>").css({ position: "absolute", top: h, height: l, left: "0px", width: j, overflow: "hidden" }).append(a("<div>" + o + "</div>").css({ width: "100%", position: "absolute", top: n, color: t, opacity: 1 - q * i })); c.divounter += i * 2; r.append(h) } } d.append(p); d.append(r); a(this).append(d) }); return this }; a.fn.changeOptionsFE = function (f) { if (this) { var e = a(this).data("options") || {}; a.extend(e, f); a(this).data("options", e) } }; a.fn.redrawFE = function (f) { if (this) { f && a(this).changeOptionsFE(f); a(this).removeFE(); a(this).FontEffect(a(this).data("options")) } }; a.fn.removeFE = function (f) { if (this && a(this).hasClass("JQFE")) { var e = a(this).find("div[class='JQFEText']").html(); a(this).removeClass("JQFE"); f && a(this).data("options", {}); a(this).find("div[class^='JQFE']").remove(); a(this).html(e) } } })(jQuery); Number.prototype.pxToEm = String.prototype.pxToEm = function (a) { a = $.extend({ scope: "body", reverse: false }, a); var c = this == "" ? 0 : parseFloat(this), f, e = function () { var m = document.documentElement; return self.innerWidth || m && m.clientWidth || document.body.clientWidth }; f = a.scope == "body" && $.browser.msie && (parseFloat($("body").css("font-size")) / e()).toFixed(1) > 0 ? function () { return (parseFloat($("body").css("font-size")) / e()).toFixed(3) * 16 } () : parseFloat($(a.scope).css("font-size")); return a.reverse == true ? (c * f).toFixed(2) + "px" : (c / f).toFixed(2) + "em" }; function PopupCenter(a, c, f) { var e = (screen.availWidth - c) / 2, m = ""; m += "top=" + (screen.availHeight - f) / 2; m += ",left=" + e; m += ",width=" + c; m += ",height=" + f; m += ",scrollbars=yes"; window.open(a, "_blank", m) } function PopupCorner(a, c, f) { var e = ""; e = ""; e += "top=0"; e += ",left=0"; if (c > 0) e += ",width=" + c; if (f < 0) e += ",height=" + f; e += ",scrollbars=yes"; window.open(a, "_blank", e) } function PrintPreview() { var a = document.getElementById("print_area"); if (a != null) { var c = window.open(); c.document.writeln('<HTML dir="rtl"><HEAD><title> \u0634\u0628\u0643\u0629 \u0627\u0644\u0623\u0644\u0648\u0643\u0629</title><LINK href="/css/alukah/alukah.css" type="text/css" rel="stylesheet">'); c.document.writeln('<LINK href="/css/alukah/print.css" type="text/css" rel="stylesheet" media="print"><base target="_self"></HEAD>'); c.document.writeln('<body style="background-color:white;margin:15px;">'); c.document.writeln('<form method="post">'); c.document.writeln(a.innerHTML); c.document.writeln('<p style="text-align:center">'); c.document.writeln('<INPUT ID="PRINT" type="button" class="button" value="\u0627\u0637\u0628\u0639" style="width:60px;" onclick="javascript:location.reload(true);window.print();">'); c.document.writeln('&nbsp;&nbsp;&nbsp;<INPUT ID="CLOSE" class="button" style="width:60px;" type="button" value="\u0623\u063a\u0644\u0642" onclick="window.close();"></p>'); c.document.writeln("</form></body></HTML>") } } function SendToFriend() { var a = "/SendToFriend.aspx?url=" + encodeURIComponent(location.href); PopupCenter(a, 530, 320) } function ReportBadLink() { var a = "/BadLink.aspx?url=" + encodeURIComponent(location.href); PopupCenter(a, 650, 300) } function ValidateEmail(a, c) { if (/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i.test(a)) return true; c == true && alert("\u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0645\u062f\u062e\u0644 \u063a\u064a\u0631 \u0635\u0627\u0644\u062d"); return false } function getFileName(a) { var c = a.lastIndexOf("\\"); return c > 0 ? a.substr(c + 1, a.length - c) : a } function goTo(a) { if (IMAGE_COUNT == 0) return false; if (isNaN(a)) return false; if (a < 1) return false; if (a > IMAGE_COUNT) return false; current = a; document.getElementById("img-scan").src = IMAGE_PATH + IMAGE_NAME.replace("{0}", current); document.getElementById("lblCurrent").innerHTML = "(" + IMAGE_COUNT + "/" + current + ")"; a = document.getElementById("btnFirst"); var c = document.getElementById("btnNext"), f = document.getElementById("btnPrevious"), e = document.getElementById("btnLast"); a.disabled = current == 1; f.disabled = current == 1; c.disabled = current == IMAGE_COUNT; e.disabled = current == IMAGE_COUNT };
