﻿var oh, ow; var mth = 0; var zoom = 1.5; function imgo(c) { var e = document.createElement("div"); e.id = "div_" + c.id; e.style.width = c.width + "px"; e.style.height = c.height + "px"; e.style.overflow = "hidden"; e.style.display = "block"; e.style.position = "relative"; c.style.left = "0px"; c.style.top = "0px"; c.style.width = c.width + "px"; c.style.height = c.height + "px"; c.style.position = "absolute"; c.style.display = "block"; c.style.overflow = "hidden"; c.style.margin = "0px"; c.style.border = "none"; ow = c.width; oh = c.height; e.className = c.className + " imga_cont"; c.removeAttribute("class"); c.setAttribute("border", "0"); var d = c.parentNode; d.insertBefore(e, c); var b = document.createElement("div"); b.className = "imga_text"; b.style.width = c.width + "px"; var a = document.createElement("div"); b.appendChild(a); a.innerHTML = c.alt; e.appendChild(b); e.appendChild(c); imga(c) } function imga(b) { var c = 1; var a = b.style; if (mth == 0) { a.top = parseInt(a.top) - c + "px"; a.left = parseInt(a.left) - c + "px"; a.width = parseInt(a.width) + 2 * c + "px"; a.height = parseInt(a.height) + 2 * c + "px"; if (oh * zoom <= parseInt(a.height)) { mth = 1 } } if (mth == 1) { a.top = parseInt(a.top) + c + "px"; a.left = parseInt(a.left) + c + "px"; a.width = parseInt(a.width) - 2 * c + "px"; a.height = parseInt(a.height) - 2 * c + "px"; if (oh >= parseInt(a.height)) { mth = -1 } } if (mth == 2) { a.top = parseInt(a.top) - 0 + "px"; a.left = parseInt(a.left) - 0 + "px"; a.width = parseInt(a.width) + 2 * c + "px"; a.height = parseInt(a.height) + 2 * c + "px"; if (oh * zoom <= parseInt(a.height)) { mth = 3 } } if (mth == 3) { a.top = parseInt(a.top) + 0 + "px"; a.left = parseInt(a.left) + 0 + "px"; a.width = parseInt(a.width) - 2 * c + "px"; a.height = parseInt(a.height) - 2 * c + "px"; if (oh >= parseInt(a.height)) { mth = 4 } } if (mth == 4) { a.top = parseInt(a.top) - 0 + "px"; a.left = parseInt(a.left) - 2 * c + "px"; a.width = parseInt(a.width) + 2 * c + "px"; a.height = parseInt(a.height) + 2 * c + "px"; if (oh * zoom <= parseInt(a.height)) { mth = 5 } } if (mth == 5) { a.top = parseInt(a.top) + 0 + "px"; a.left = parseInt(a.left) + 2 * c + "px"; a.width = parseInt(a.width) - 2 * c + "px"; a.height = parseInt(a.height) - 2 * c + "px"; if (oh >= parseInt(a.height)) { mth = 6 } } if (mth == 6) { a.top = parseInt(a.top) - 2 * c + "px"; a.left = parseInt(a.left) - 0 + "px"; a.width = parseInt(a.width) + 2 * c + "px"; a.height = parseInt(a.height) + 2 * c + "px"; if (oh * zoom <= parseInt(a.height)) { mth = 7 } } if (mth == 7) { a.top = parseInt(a.top) + 2 * c + "px"; a.left = parseInt(a.left) + 0 + "px"; a.width = parseInt(a.width) - 2 * c + "px"; a.height = parseInt(a.height) - 2 * c + "px"; if (oh >= parseInt(a.height)) { mth = 8 } } if (mth == 8) { a.top = parseInt(a.top) - 2 * c + "px"; a.left = parseInt(a.left) - 2 * c + "px"; a.width = parseInt(a.width) + 2 * c + "px"; a.height = parseInt(a.height) + 2 * c + "px"; if (oh * zoom <= parseInt(a.height)) { mth = 9 } } if (mth == 9) { a.top = parseInt(a.top) + 2 * c + "px"; a.left = parseInt(a.left) + 2 * c + "px"; a.width = parseInt(a.width) - 2 * c + "px"; a.height = parseInt(a.height) - 2 * c + "px"; if (oh >= parseInt(a.height)) { mth = -1 } } if (mth >= 0) { setTimeout(function() { imga(b) }, 50) } };
