camera.min.js 100 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225
// Camera slideshow v1.4.0 - a jQuery slideshow with many effects, transitions, easy to customize, using canvas and mobile ready, based on jQuery 1.4+
// Copyright (c) 2012 by Manuel Masia - www.pixedelic.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function (a) {
    a.fn.camera = function (b, c) {
        function e() {
            if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)) {
                return true
            }
        }
        function H() {
            var b = a(s).width();
            a("li", s).removeClass("camera_visThumb");
            a("li", s).each(function () {
                var c = a(this).position(),
                    d = a("ul", s).outerWidth(),
                    e = a("ul", s).offset().left,
                    f = a("> div", s).offset().left,
                    g = f - e;
                if (g > 0) {
                        a(".camera_prevThumbs", V).removeClass("hideNav")
                    } else {
                        a(".camera_prevThumbs", V).addClass("hideNav")
                    }
                if (d - g > b) {
                        a(".camera_nextThumbs", V).removeClass("hideNav")
                    } else {
                        a(".camera_nextThumbs", V).addClass("hideNav")
                    }
                var h = c.left,
                    i = c.left + a(this).width();
                if (i - g <= b && h - g >= 0) {
                        a(this).addClass("camera_visThumb")
                    }
            })
        }
        function K() {
            function d() {
                t = f.width();
                if (b.height.indexOf("%") != -1) {
                    var c = Math.round(t / (100 / parseFloat(b.height)));
                    if (b.minHeight != "" && c < parseFloat(b.minHeight)) {
                        u = parseFloat(b.minHeight)
                    } else {
                        u = c
                    }
                    f.css({
                        height: u
                    })
                } else if (b.height == "auto") {
                    u = f.height()
                } else {
                    u = parseFloat(b.height);
                    f.css({
                        height: u
                    })
                }
                a(".camerarelative", k).css({
                    width: t,
                    height: u
                });
                a(".imgLoaded", k).each(function () {
                    var c = a(this),
                        d = c.attr("width"),
                        e = c.attr("height"),
                        f = c.index(),
                        g, h, i = c.attr("data-alignment"),
                        j = c.attr("data-portrait");
                    if (typeof i === "undefined" || i === false || i === "") {
                            i = b.alignment
                        }
                    if (typeof j === "undefined" || j === false || j === "") {
                            j = b.portrait
                        }
                    if (j == false || j == "false") {
                            if (d / e < t / u) {
                                var k = t / d;
                                var l = Math.abs(u - e * k) * .5;
                                switch (i) {
                                case "topLeft":
                                    g = 0;
                                    break;
                                case "topCenter":
                                    g = 0;
                                    break;
                                case "topRight":
                                    g = 0;
                                    break;
                                case "centerLeft":
                                    g = "-" + l + "px";
                                    break;
                                case "center":
                                    g = "-" + l + "px";
                                    break;
                                case "centerRight":
                                    g = "-" + l + "px";
                                    break;
                                case "bottomLeft":
                                    g = "-" + l * 2 + "px";
                                    break;
                                case "bottomCenter":
                                    g = "-" + l * 2 + "px";
                                    break;
                                case "bottomRight":
                                    g = "-" + l * 2 + "px";
                                    break
                                }
                                c.css({
                                    height: e * k,
                                    "margin-left": 0,
                                    "margin-top": g,
                                    position: "absolute",
                                    visibility: "visible",
                                    width: t
                                })
                            } else {
                                var k = u / e;
                                var l = Math.abs(t - d * k) * .5;
                                switch (i) {
                                case "topLeft":
                                    h = 0;
                                    break;
                                case "topCenter":
                                    h = "-" + l + "px";
                                    break;
                                case "topRight":
                                    h = "-" + l * 2 + "px";
                                    break;
                                case "centerLeft":
                                    h = 0;
                                    break;
                                case "center":
                                    h = "-" + l + "px";
                                    break;
                                case "centerRight":
                                    h = "-" + l * 2 + "px";
                                    break;
                                case "bottomLeft":
                                    h = 0;
                                    break;
                                case "bottomCenter":
                                    h = "-" + l + "px";
                                    break;
                                case "bottomRight":
                                    h = "-" + l * 2 + "px";
                                    break
                                }
                                c.css({
                                    height: u,
                                    "margin-left": h,
                                    "margin-top": 0,
                                    position: "absolute",
                                    visibility: "visible",
                                    width: d * k
                                })
                            }
                        } else {
                            if (d / e < t / u) {
                                var k = u / e;
                                var l = Math.abs(t - d * k) * .5;
                                switch (i) {
                                case "topLeft":
                                    h = 0;
                                    break;
                                case "topCenter":
                                    h = l + "px";
                                    break;
                                case "topRight":
                                    h = l * 2 + "px";
                                    break;
                                case "centerLeft":
                                    h = 0;
                                    break;
                                case "center":
                                    h = l + "px";
                                    break;
                                case "centerRight":
                                    h = l * 2 + "px";
                                    break;
                                case "bottomLeft":
                                    h = 0;
                                    break;
                                case "bottomCenter":
                                    h = l + "px";
                                    break;
                                case "bottomRight":
                                    h = l * 2 + "px";
                                    break
                                }
                                c.css({
                                    height: u,
                                    "margin-left": h,
                                    "margin-top": 0,
                                    position: "absolute",
                                    visibility: "visible",
                                    width: d * k
                                })
                            } else {
                                var k = t / d;
                                var l = Math.abs(u - e * k) * .5;
                                switch (i) {
                                case "topLeft":
                                    g = 0;
                                    break;
                                case "topCenter":
                                    g = 0;
                                    break;
                                case "topRight":
                                    g = 0;
                                    break;
                                case "centerLeft":
                                    g = l + "px";
                                    break;
                                case "center":
                                    g = l + "px";
                                    break;
                                case "centerRight":
                                    g = l + "px";
                                    break;
                                case "bottomLeft":
                                    g = l * 2 + "px";
                                    break;
                                case "bottomCenter":
                                    g = l * 2 + "px";
                                    break;
                                case "bottomRight":
                                    g = l * 2 + "px";
                                    break
                                }
                                c.css({
                                    height: e * k,
                                    "margin-left": 0,
                                    "margin-top": g,
                                    position: "absolute",
                                    visibility: "visible",
                                    width: t
                                })
                            }
                        }
                })
            }
            var c;
            if (I == true) {
                clearTimeout(c);
                c = setTimeout(d, 200)
            } else {
                d()
            }
            I = true
        }
        function X(a) {
            for (var b, c, d = a.length; d; b = parseInt(Math.random() * d), c = a[--d], a[d] = a[b], a[b] = c);
            return a
        }
        function Y(a) {
            return Math.ceil(a) == Math.floor(a)
        }
        function hb() {
            if (a(s).length && !a(r).length) {
                var b = a(s).outerWidth(),
                    c = a("ul > li", s).outerWidth(),
                    d = a("li.cameracurrent", s).length ? a("li.cameracurrent", s).position() : "",
                    e = a("ul > li", s).length * a("ul > li", s).outerWidth(),
                    g = a("ul", s).offset().left,
                    h = a("> div", s).offset().left,
                    i;
                if (g < 0) {
                        i = "-" + (h - g)
                    } else {
                        i = h - g
                    }
                if (gb == true) {
                        a("ul", s).width(a("ul > li", s).length * a("ul > li", s).outerWidth());
                        if (a(s).length && !a(r).lenght) {
                            f.css({
                                marginBottom: a(s).outerHeight()
                            })
                        }
                        H();
                        a("ul", s).width(a("ul > li", s).length * a("ul > li", s).outerWidth());
                        if (a(s).length && !a(r).lenght) {
                            f.css({
                                marginBottom: a(s).outerHeight()
                            })
                        }
                    }
                gb = false;
                var j = a("li.cameracurrent", s).length ? d.left : "",
                    k = a("li.cameracurrent", s).length ? d.left + a("li.cameracurrent", s).outerWidth() : "";
                if (j < a("li.cameracurrent", s).outerWidth()) {
                        j = 0
                    }
                if (k - i > b) {
                        if (j + b < e) {
                            a("ul", s).animate({
                                "margin-left": "-" + j + "px"
                            }, 500, H)
                        } else {
                            a("ul", s).animate({
                                "margin-left": "-" + (a("ul", s).outerWidth() - b) + "px"
                            }, 500, H)
                        }
                    } else if (j - i < 0) {
                        a("ul", s).animate({
                            "margin-left": "-" + j + "px"
                        }, 500, H)
                    } else {
                        a("ul", s).css({
                            "margin-left": "auto",
                            "margin-right": "auto"
                        });
                        setTimeout(H, 100)
                    }
            }
        }
        function ib() {
            bb = 0;
            var c = a(".camera_bar_cont", V).width(),
                d = a(".camera_bar_cont", V).height();
            if (h != "pie") {
                    switch (U) {
                    case "leftToRight":
                        a("#" + i).css({
                            right: c
                        });
                        break;
                    case "rightToLeft":
                        a("#" + i).css({
                            left: c
                        });
                        break;
                    case "topToBottom":
                        a("#" + i).css({
                            bottom: d
                        });
                        break;
                    case "bottomToTop":
                        a("#" + i).css({
                            top: d
                        });
                        break
                    }
                } else {
                    db.clearRect(0, 0, b.pieDiameter, b.pieDiameter)
                }
        }
        function jb(c) {
            j.addClass("camerasliding");
            R = false;
            var d = parseFloat(a("div.cameraSlide.cameracurrent", k).index());
            if (c > 0) {
                var l = c - 1
            } else if (d == B - 1) {
                var l = 0
            } else {
                var l = d + 1
            }
            var m = a(".cameraSlide:eq(" + l + ")", k);
            var n = a(".cameraSlide:eq(" + (l + 1) + ")", k).addClass("cameranext");
            if (d != l + 1) {
                n.hide()
            }
            a(".cameraContent", g).fadeOut(600);
            a(".camera_caption", g).show();
            a(".camerarelative", m).append(a("> div ", j).eq(l).find("> div.camera_effected"));
            a(".camera_target_content .cameraContent:eq(" + l + ")", f).append(a("> div ", j).eq(l).find("> div"));
            if (!a(".imgLoaded", m).length) {
                var o = v[l];
                var p = new Image;
                p.src = o + "?" + (new Date).getTime();
                m.css("visibility", "hidden");
                m.prepend(a(p).attr("class", "imgLoaded").css("visibility", "hidden"));
                var q, w;
                if (!a(p).get(0).complete || q == "0" || w == "0" || typeof q === "undefined" || q === false || typeof w === "undefined" || w === false) {
                    a(".camera_loader", f).delay(500).fadeIn(400);
                    p.onload = function () {
                        q = p.naturalWidth;
                        w = p.naturalHeight;
                        a(p).attr("data-alignment", z[l]).attr("data-portrait", y[l]);
                        a(p).attr("width", q);
                        a(p).attr("height", w);
                        k.find(".cameraSlide_" + l).hide().css("visibility", "visible");
                        K();
                        jb(l + 1)
                    }
                }
            } else {
                if (v.length > l + 1 && !a(".imgLoaded", n).length) {
                    var x = v[l + 1];
                    var A = new Image;
                    A.src = x + "?" + (new Date).getTime();
                    n.prepend(a(A).attr("class", "imgLoaded").css("visibility", "hidden"));
                    A.onload = function () {
                        q = A.naturalWidth;
                        w = A.naturalHeight;
                        a(A).attr("data-alignment", z[l + 1]).attr("data-portrait", y[l + 1]);
                        a(A).attr("width", q);
                        a(A).attr("height", w);
                        K()
                    }
                }
                b.onLoaded.call(this);
                if (a(".camera_loader", f).is(":visible")) {
                    a(".camera_loader", f).fadeOut(400)
                } else {
                    a(".camera_loader", f).css({
                        visibility: "hidden"
                    });
                    a(".camera_loader", f).fadeOut(400, function () {
                        a(".camera_loader", f).css({
                            visibility: "visible"
                        })
                    })
                }
                var C = b.rows,
                    D = b.cols,
                    F = 1,
                    G = 0,
                    H, I, J, N, O, P = new Array("simpleFade", "curtainTopLeft", "curtainTopRight", "curtainBottomLeft", "curtainBottomRight", "curtainSliceLeft", "curtainSliceRight", "blindCurtainTopLeft", "blindCurtainTopRight", "blindCurtainBottomLeft", "blindCurtainBottomRight", "blindCurtainSliceBottom", "blindCurtainSliceTop", "stampede", "mosaic", "mosaicReverse", "mosaicRandom", "mosaicSpiral", "mosaicSpiralReverse", "topLeftBottomRight", "bottomRightTopLeft", "bottomLeftTopRight", "topRightBottomLeft", "scrollLeft", "scrollRight", "scrollTop", "scrollBottom", "scrollHorz");
                marginLeft = 0,
                marginTop = 0,
                opacityOnGrid = 0;
                if (b.opacityOnGrid == true) {
                        opacityOnGrid = 0
                    } else {
                        opacityOnGrid = 1
                    }
                var Q = a(" > div", j).eq(l).attr("data-fx");
                if (e() && b.mobileFx != "" && b.mobileFx != "default") {
                        N = b.mobileFx
                    } else {
                        if (typeof Q !== "undefined" && Q !== false && Q !== "default") {
                            N = Q
                        } else {
                            N = b.fx
                        }
                    }
                if (N == "random") {
                        N = X(P);
                        N = N[0]
                    } else {
                        N = N;
                        if (N.indexOf(",") > 0) {
                            N = N.replace(/ /g, "");
                            N = N.split(",");
                            N = X(N);
                            N = N[0]
                        }
                    }
                dataEasing = a(" > div", j).eq(l).attr("data-easing");
                mobileEasing = a(" > div", j).eq(l).attr("data-mobileEasing");
                if (e() && b.mobileEasing != "" && b.mobileEasing != "default") {
                        if (typeof mobileEasing !== "undefined" && mobileEasing !== false && mobileEasing !== "default") {
                            O = mobileEasing
                        } else {
                            O = b.mobileEasing
                        }
                    } else {
                        if (typeof dataEasing !== "undefined" && dataEasing !== false && dataEasing !== "default") {
                            O = dataEasing
                        } else {
                            O = b.easing
                        }
                    }
                H = a(" > div", j).eq(l).attr("data-slideOn");
                if (typeof H !== "undefined" && H !== false) {
                        T = H
                    } else {
                        if (b.slideOn == "random") {
                            var T = new Array("next", "prev");
                            T = X(T);
                            T = T[0]
                        } else {
                            T = b.slideOn
                        }
                    }
                var Y = a(" > div", j).eq(l).attr("data-time");
                if (typeof Y !== "undefined" && Y !== false && Y !== "") {
                        I = parseFloat(Y)
                    } else {
                        I = b.time
                    }
                var Z = a(" > div", j).eq(l).attr("data-transPeriod");
                if (typeof Z !== "undefined" && Z !== false && Z !== "") {
                        J = parseFloat(Z)
                    } else {
                        J = b.transPeriod
                    }
                if (!a(j).hasClass("camerastarted")) {
                        N = "simpleFade";
                        T = "next";
                        O = "";
                        J = 400;
                        a(j).addClass("camerastarted")
                    }
                switch (N) {
                    case "simpleFade":
                        D = 1;
                        C = 1;
                        break;
                    case "curtainTopLeft":
                        if (b.slicedCols == 0) {
                            D = b.cols
                        } else {
                            D = b.slicedCols
                        }
                        C = 1;
                        break;
                    case "curtainTopRight":
                        if (b.slicedCols == 0) {
                            D = b.cols
                        } else {
                            D = b.slicedCols
                        }
                        C = 1;
                        break;
                    case "curtainBottomLeft":
                        if (b.slicedCols == 0) {
                            D = b.cols
                        } else {
                            D = b.slicedCols
                        }
                        C = 1;
                        break;
                    case "curtainBottomRight":
                        if (b.slicedCols == 0) {
                            D = b.cols
                        } else {
                            D = b.slicedCols
                        }
                        C = 1;
                        break;
                    case "curtainSliceLeft":
                        if (b.slicedCols == 0) {
                            D = b.cols
                        } else {
                            D = b.slicedCols
                        }
                        C = 1;
                        break;
                    case "curtainSliceRight":
                        if (b.slicedCols == 0) {
                            D = b.cols
                        } else {
                            D = b.slicedCols
                        }
                        C = 1;
                        break;
                    case "blindCurtainTopLeft":
                        if (b.slicedRows == 0) {
                            C = b.rows
                        } else {
                            C = b.slicedRows
                        }
                        D = 1;
                        break;
                    case "blindCurtainTopRight":
                        if (b.slicedRows == 0) {
                            C = b.rows
                        } else {
                            C = b.slicedRows
                        }
                        D = 1;
                        break;
                    case "blindCurtainBottomLeft":
                        if (b.slicedRows == 0) {
                            C = b.rows
                        } else {
                            C = b.slicedRows
                        }
                        D = 1;
                        break;
                    case "blindCurtainBottomRight":
                        if (b.slicedRows == 0) {
                            C = b.rows
                        } else {
                            C = b.slicedRows
                        }
                        D = 1;
                        break;
                    case "blindCurtainSliceTop":
                        if (b.slicedRows == 0) {
                            C = b.rows
                        } else {
                            C = b.slicedRows
                        }
                        D = 1;
                        break;
                    case "blindCurtainSliceBottom":
                        if (b.slicedRows == 0) {
                            C = b.rows
                        } else {
                            C = b.slicedRows
                        }
                        D = 1;
                        break;
                    case "stampede":
                        G = "-" + J;
                        break;
                    case "mosaic":
                        G = b.gridDifference;
                        break;
                    case "mosaicReverse":
                        G = b.gridDifference;
                        break;
                    case "mosaicRandom":
                        break;
                    case "mosaicSpiral":
                        G = b.gridDifference;
                        F = 1.7;
                        break;
                    case "mosaicSpiralReverse":
                        G = b.gridDifference;
                        F = 1.7;
                        break;
                    case "topLeftBottomRight":
                        G = b.gridDifference;
                        F = 6;
                        break;
                    case "bottomRightTopLeft":
                        G = b.gridDifference;
                        F = 6;
                        break;
                    case "bottomLeftTopRight":
                        G = b.gridDifference;
                        F = 6;
                        break;
                    case "topRightBottomLeft":
                        G = b.gridDifference;
                        F = 6;
                        break;
                    case "scrollLeft":
                        D = 1;
                        C = 1;
                        break;
                    case "scrollRight":
                        D = 1;
                        C = 1;
                        break;
                    case "scrollTop":
                        D = 1;
                        C = 1;
                        break;
                    case "scrollBottom":
                        D = 1;
                        C = 1;
                        break;
                    case "scrollHorz":
                        D = 1;
                        C = 1;
                        break
                    }
                var _ = 0;
                var ab = C * D;
                var eb = t - Math.floor(t / D) * D;
                var fb = u - Math.floor(u / C) * C;
                var gb;
                var kb;
                var lb = 0;
                var mb = 0;
                var nb = new Array;
                var ob = new Array;
                var pb = new Array;
                while (_ < ab) {
                        nb.push(_);
                        ob.push(_);
                        E.append('<div class="cameraappended" style="display:none; overflow:hidden; position:absolute; z-index:1000" />');
                        var qb = a(".cameraappended:eq(" + _ + ")", k);
                        if (N == "scrollLeft" || N == "scrollRight" || N == "scrollTop" || N == "scrollBottom" || N == "scrollHorz") {
                            S.eq(l).clone().show().appendTo(qb)
                        } else {
                            if (T == "next") {
                                S.eq(l).clone().show().appendTo(qb)
                            } else {
                                S.eq(d).clone().show().appendTo(qb)
                            }
                        }
                        if (_ % D < eb) {
                            gb = 1
                        } else {
                            gb = 0
                        }
                        if (_ % D == 0) {
                            lb = 0
                        }
                        if (Math.floor(_ / D) < fb) {
                            kb = 1
                        } else {
                            kb = 0
                        }
                        qb.css({
                            height: Math.floor(u / C + kb + 1),
                            left: lb,
                            top: mb,
                            width: Math.floor(t / D + gb + 1)
                        });
                        a("> .cameraSlide", qb).css({
                            height: u,
                            "margin-left": "-" + lb + "px",
                            "margin-top": "-" + mb + "px",
                            width: t
                        });
                        lb = lb + qb.width() - 1;
                        if (_ % D == D - 1) {
                            mb = mb + qb.height() - 1
                        }
                        _++
                    }
                switch (N) {
                    case "curtainTopLeft":
                        break;
                    case "curtainBottomLeft":
                        break;
                    case "curtainSliceLeft":
                        break;
                    case "curtainTopRight":
                        nb = nb.reverse();
                        break;
                    case "curtainBottomRight":
                        nb = nb.reverse();
                        break;
                    case "curtainSliceRight":
                        nb = nb.reverse();
                        break;
                    case "blindCurtainTopLeft":
                        break;
                    case "blindCurtainBottomLeft":
                        nb = nb.reverse();
                        break;
                    case "blindCurtainSliceTop":
                        break;
                    case "blindCurtainTopRight":
                        break;
                    case "blindCurtainBottomRight":
                        nb = nb.reverse();
                        break;
                    case "blindCurtainSliceBottom":
                        nb = nb.reverse();
                        break;
                    case "stampede":
                        nb = X(nb);
                        break;
                    case "mosaic":
                        break;
                    case "mosaicReverse":
                        nb = nb.reverse();
                        break;
                    case "mosaicRandom":
                        nb = X(nb);
                        break;
                    case "mosaicSpiral":
                        var rb = C / 2,
                            sb, tb, ub, vb = 0;
                        for (ub = 0; ub < rb; ub++) {
                                tb = ub;
                                for (sb = ub; sb < D - ub - 1; sb++) {
                                    pb[vb++] = tb * D + sb
                                }
                                sb = D - ub - 1;
                                for (tb = ub; tb < C - ub - 1; tb++) {
                                    pb[vb++] = tb * D + sb
                                }
                                tb = C - ub - 1;
                                for (sb = D - ub - 1; sb > ub; sb--) {
                                    pb[vb++] = tb * D + sb
                                }
                                sb = ub;
                                for (tb = C - ub - 1; tb > ub; tb--) {
                                    pb[vb++] = tb * D + sb
                                }
                            }
                        nb = pb;
                        break;
                    case "mosaicSpiralReverse":
                        var rb = C / 2,
                            sb, tb, ub, vb = ab - 1;
                        for (ub = 0; ub < rb; ub++) {
                                tb = ub;
                                for (sb = ub; sb < D - ub - 1; sb++) {
                                    pb[vb--] = tb * D + sb
                                }
                                sb = D - ub - 1;
                                for (tb = ub; tb < C - ub - 1; tb++) {
                                    pb[vb--] = tb * D + sb
                                }
                                tb = C - ub - 1;
                                for (sb = D - ub - 1; sb > ub; sb--) {
                                    pb[vb--] = tb * D + sb
                                }
                                sb = ub;
                                for (tb = C - ub - 1; tb > ub; tb--) {
                                    pb[vb--] = tb * D + sb
                                }
                            }
                        nb = pb;
                        break;
                    case "topLeftBottomRight":
                        for (var tb = 0; tb < C; tb++) for (var sb = 0; sb < D; sb++) {
                                pb.push(sb + tb)
                            }
                        ob = pb;
                        break;
                    case "bottomRightTopLeft":
                        for (var tb = 0; tb < C; tb++) for (var sb = 0; sb < D; sb++) {
                                pb.push(sb + tb)
                            }
                        ob = pb.reverse();
                        break;
                    case "bottomLeftTopRight":
                        for (var tb = C; tb > 0; tb--) for (var sb = 0; sb < D; sb++) {
                                pb.push(sb + tb)
                            }
                        ob = pb;
                        break;
                    case "topRightBottomLeft":
                        for (var tb = 0; tb < C; tb++) for (var sb = D; sb > 0; sb--) {
                                pb.push(sb + tb)
                            }
                        ob = pb;
                        break
                    }
                a.each(nb, function (c, e) {
                        function o() {
                            a(this).addClass("cameraeased");
                            if (a(".cameraeased", k).length >= 0) {
                                a(s).css({
                                    visibility: "visible"
                                })
                            }
                            if (a(".cameraeased", k).length == ab) {
                                hb();
                                a(".moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom", g).each(function () {
                                    a(this).css("visibility", "hidden")
                                });
                                S.eq(l).show().css("z-index", "999").removeClass("cameranext").addClass("cameracurrent");
                                S.eq(d).css("z-index", "1").removeClass("cameracurrent");
                                a(".cameraContent", g).eq(l).addClass("cameracurrent");
                                if (d >= 0) {
                                    a(".cameraContent", g).eq(d).removeClass("cameracurrent")
                                }
                                b.onEndTransition.call(this);
                                if (a("> div", j).eq(l).attr("data-video") != "hide" && a(".cameraContent.cameracurrent .imgFake", g).length) {
                                    a(".cameraContent.cameracurrent .imgFake", g).click()
                                }
                                var c = S.eq(l).find(".fadeIn").length;
                                var e = a(".cameraContent", g).eq(l).find(".moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom").length;
                                if (c != 0) {
                                    a(".cameraSlide.cameracurrent .fadeIn", g).each(function () {
                                        if (a(this).attr("data-easing") != "") {
                                            var b = a(this).attr("data-easing")
                                        } else {
                                            var b = O
                                        }
                                        var d = a(this);
                                        if (typeof d.attr("data-outerWidth") === "undefined" || d.attr("data-outerWidth") === false || d.attr("data-outerWidth") === "") {
                                            var e = d.outerWidth();
                                            d.attr("data-outerWidth", e)
                                        } else {
                                            var e = d.attr("data-outerWidth")
                                        }
                                        if (typeof d.attr("data-outerHeight") === "undefined" || d.attr("data-outerHeight") === false || d.attr("data-outerHeight") === "") {
                                            var f = d.outerHeight();
                                            d.attr("data-outerHeight", f)
                                        } else {
                                            var f = d.attr("data-outerHeight")
                                        }
                                        var g = d.position();
                                        var h = g.left;
                                        var i = g.top;
                                        var j = d.attr("class");
                                        var k = d.index();
                                        var l = d.parents(".camerarelative").outerHeight();
                                        var m = d.parents(".camerarelative").outerWidth();
                                        if (j.indexOf("fadeIn") != -1) {
                                            d.animate({
                                                opacity: 0
                                            }, 0).css("visibility", "visible").delay(I / c * .1 * (k - 1)).animate({
                                                opacity: 1
                                            }, I / c * .15, b)
                                        } else {
                                            d.css("visibility", "visible")
                                        }
                                    })
                                }
                                a(".cameraContent.cameracurrent", g).show();
                                if (e != 0) {
                                    a(".cameraContent.cameracurrent .moveFromLeft, .cameraContent.cameracurrent .moveFromRight, .cameraContent.cameracurrent .moveFromTop, .cameraContent.cameracurrent .moveFromBottom, .cameraContent.cameracurrent .fadeIn, .cameraContent.cameracurrent .fadeFromLeft, .cameraContent.cameracurrent .fadeFromRight, .cameraContent.cameracurrent .fadeFromTop, .cameraContent.cameracurrent .fadeFromBottom", g).each(function () {
                                        if (a(this).attr("data-easing") != "") {
                                            var b = a(this).attr("data-easing")
                                        } else {
                                            var b = O
                                        }
                                        var c = a(this);
                                        var d = c.position();
                                        var f = d.left;
                                        var g = d.top;
                                        var h = c.attr("class");
                                        var i = c.index();
                                        var j = c.outerHeight();
                                        if (h.indexOf("moveFromLeft") != -1) {
                                            c.css({
                                                left: "-" + t + "px",
                                                right: "auto"
                                            });
                                            c.css("visibility", "visible").delay(I / e * .1 * (i - 1)).animate({
                                                left: d.left
                                            }, I / e * .15, b)
                                        } else if (h.indexOf("moveFromRight") != -1) {
                                            c.css({
                                                left: t + "px",
                                                right: "auto"
                                            });
                                            c.css("visibility", "visible").delay(I / e * .1 * (i - 1)).animate({
                                                left: d.left
                                            }, I / e * .15, b)
                                        } else if (h.indexOf("moveFromTop") != -1) {
                                            c.css({
                                                top: "-" + u + "px",
                                                bottom: "auto"
                                            });
                                            c.css("visibility", "visible").delay(I / e * .1 * (i - 1)).animate({
                                                top: d.top
                                            }, I / e * .15, b, function () {
                                                c.css({
                                                    top: "auto",
                                                    bottom: 0
                                                })
                                            })
                                        } else if (h.indexOf("moveFromBottom") != -1) {
                                            c.css({
                                                top: u + "px",
                                                bottom: "auto"
                                            });
                                            c.css("visibility", "visible").delay(I / e * .1 * (i - 1)).animate({
                                                top: d.top
                                            }, I / e * .15, b)
                                        } else if (h.indexOf("fadeFromLeft") != -1) {
                                            c.animate({
                                                opacity: 0
                                            }, 0).css({
                                                left: "-" + t + "px",
                                                right: "auto"
                                            });
                                            c.css("visibility", "visible").delay(I / e * .1 * (i - 1)).animate({
                                                left: d.left,
                                                opacity: 1
                                            }, I / e * .15, b)
                                        } else if (h.indexOf("fadeFromRight") != -1) {
                                            c.animate({
                                                opacity: 0
                                            }, 0).css({
                                                left: t + "px",
                                                right: "auto"
                                            });
                                            c.css("visibility", "visible").delay(I / e * .1 * (i - 1)).animate({
                                                left: d.left,
                                                opacity: 1
                                            }, I / e * .15, b)
                                        } else if (h.indexOf("fadeFromTop") != -1) {
                                            c.animate({
                                                opacity: 0
                                            }, 0).css({
                                                top: "-" + u + "px",
                                                bottom: "auto"
                                            });
                                            c.css("visibility", "visible").delay(I / e * .1 * (i - 1)).animate({
                                                top: d.top,
                                                opacity: 1
                                            }, I / e * .15, b, function () {
                                                c.css({
                                                    top: "auto",
                                                    bottom: 0
                                                })
                                            })
                                        } else if (h.indexOf("fadeFromBottom") != -1) {
                                            c.animate({
                                                opacity: 0
                                            }, 0).css({
                                                bottom: "-" + j + "px"
                                            });
                                            c.css("visibility", "visible").delay(I / e * .1 * (i - 1)).animate({
                                                bottom: "0",
                                                opacity: 1
                                            }, I / e * .15, b)
                                        } else if (h.indexOf("fadeIn") != -1) {
                                            c.animate({
                                                opacity: 0
                                            }, 0).css("visibility", "visible").delay(I / e * .1 * (i - 1)).animate({
                                                opacity: 1
                                            }, I / e * .15, b)
                                        } else {
                                            c.css("visibility", "visible")
                                        }
                                    })
                                }
                                a(".cameraappended", k).remove();
                                j.removeClass("camerasliding");
                                S.eq(d).hide();
                                var f = a(".camera_bar_cont", V).width(),
                                    m = a(".camera_bar_cont", V).height(),
                                    o;
                                if (h != "pie") {
                                        o = .05
                                    } else {
                                        o = .005
                                    }
                                a("#" + i).animate({
                                        opacity: b.loaderOpacity
                                    }, 200);
                                L = setInterval(function () {
                                        if (j.hasClass("stopped")) {
                                            clearInterval(L)
                                        }
                                        if (h != "pie") {
                                            if (bb <= 1.002 && !j.hasClass("stopped") && !j.hasClass("paused") && !j.hasClass("hovered")) {
                                                bb = bb + o
                                            } else if (bb <= 1 && (j.hasClass("stopped") || j.hasClass("paused") || j.hasClass("stopped") || j.hasClass("hovered"))) {
                                                bb = bb
                                            } else {
                                                if (!j.hasClass("stopped") && !j.hasClass("paused") && !j.hasClass("hovered")) {
                                                    clearInterval(L);
                                                    W();
                                                    a("#" + i).animate({
                                                        opacity: 0
                                                    }, 200, function () {
                                                        clearTimeout(M);
                                                        M = setTimeout(ib, n);
                                                        jb();
                                                        b.onStartLoading.call(this)
                                                    })
                                                }
                                            }
                                            switch (U) {
                                            case "leftToRight":
                                                a("#" + i).animate({
                                                    right: f - f * bb
                                                }, I * o, "linear");
                                                break;
                                            case "rightToLeft":
                                                a("#" + i).animate({
                                                    left: f - f * bb
                                                }, I * o, "linear");
                                                break;
                                            case "topToBottom":
                                                a("#" + i).animate({
                                                    bottom: m - m * bb
                                                }, I * o, "linear");
                                                break;
                                            case "bottomToTop":
                                                a("#" + i).animate({
                                                    bottom: m - m * bb
                                                }, I * o, "linear");
                                                break
                                            }
                                        } else {
                                            cb = bb;
                                            db.clearRect(0, 0, b.pieDiameter, b.pieDiameter);
                                            db.globalCompositeOperation = "destination-over";
                                            db.beginPath();
                                            db.arc(b.pieDiameter / 2, b.pieDiameter / 2, b.pieDiameter / 2 - b.loaderStroke, 0, Math.PI * 2, false);
                                            db.lineWidth = b.loaderStroke;
                                            db.strokeStyle = b.loaderBgColor;
                                            db.stroke();
                                            db.closePath();
                                            db.globalCompositeOperation = "source-over";
                                            db.beginPath();
                                            db.arc(b.pieDiameter / 2, b.pieDiameter / 2, b.pieDiameter / 2 - b.loaderStroke, 0, Math.PI * 2 * cb, false);
                                            db.lineWidth = b.loaderStroke - b.loaderPadding * 2;
                                            db.strokeStyle = b.loaderColor;
                                            db.stroke();
                                            db.closePath();
                                            if (bb <= 1.002 && !j.hasClass("stopped") && !j.hasClass("paused") && !j.hasClass("hovered")) {
                                                bb = bb + o
                                            } else if (bb <= 1 && (j.hasClass("stopped") || j.hasClass("paused") || j.hasClass("hovered"))) {
                                                bb = bb
                                            } else {
                                                if (!j.hasClass("stopped") && !j.hasClass("paused") && !j.hasClass("hovered")) {
                                                    clearInterval(L);
                                                    W();
                                                    a("#" + i + ", .camera_canvas_wrap", V).animate({
                                                        opacity: 0
                                                    }, 200, function () {
                                                        clearTimeout(M);
                                                        M = setTimeout(ib, n);
                                                        jb();
                                                        b.onStartLoading.call(this)
                                                    })
                                                }
                                            }
                                        }
                                    }, I * o)
                            }
                        }
                        if (e % D < eb) {
                            gb = 1
                        } else {
                            gb = 0
                        }
                        if (e % D == 0) {
                            lb = 0
                        }
                        if (Math.floor(e / D) < fb) {
                            kb = 1
                        } else {
                            kb = 0
                        }
                        switch (N) {
                        case "simpleFade":
                            height = u;
                            width = t;
                            opacityOnGrid = 0;
                            break;
                        case "curtainTopLeft":
                            height = 0,
                            width = Math.floor(t / D + gb + 1),
                            marginTop = "-" + Math.floor(u / C + kb + 1) + "px";
                            break;
                        case "curtainTopRight":
                            height = 0,
                            width = Math.floor(t / D + gb + 1),
                            marginTop = "-" + Math.floor(u / C + kb + 1) + "px";
                            break;
                        case "curtainBottomLeft":
                            height = 0,
                            width = Math.floor(t / D + gb + 1),
                            marginTop = Math.floor(u / C + kb + 1) + "px";
                            break;
                        case "curtainBottomRight":
                            height = 0,
                            width = Math.floor(t / D + gb + 1),
                            marginTop = Math.floor(u / C + kb + 1) + "px";
                            break;
                        case "curtainSliceLeft":
                            height = 0,
                            width = Math.floor(t / D + gb + 1);
                            if (e % 2 == 0) {
                                marginTop = Math.floor(u / C + kb + 1) + "px"
                            } else {
                                marginTop = "-" + Math.floor(u / C + kb + 1) + "px"
                            }
                            break;
                        case "curtainSliceRight":
                            height = 0,
                            width = Math.floor(t / D + gb + 1);
                            if (e % 2 == 0) {
                                marginTop = Math.floor(u / C + kb + 1) + "px"
                            } else {
                                marginTop = "-" + Math.floor(u / C + kb + 1) + "px"
                            }
                            break;
                        case "blindCurtainTopLeft":
                            height = Math.floor(u / C + kb + 1),
                            width = 0,
                            marginLeft = "-" + Math.floor(t / D + gb + 1) + "px";
                            break;
                        case "blindCurtainTopRight":
                            height = Math.floor(u / C + kb + 1),
                            width = 0,
                            marginLeft = Math.floor(t / D + gb + 1) + "px";
                            break;
                        case "blindCurtainBottomLeft":
                            height = Math.floor(u / C + kb + 1),
                            width = 0,
                            marginLeft = "-" + Math.floor(t / D + gb + 1) + "px";
                            break;
                        case "blindCurtainBottomRight":
                            height = Math.floor(u / C + kb + 1),
                            width = 0,
                            marginLeft = Math.floor(t / D + gb + 1) + "px";
                            break;
                        case "blindCurtainSliceBottom":
                            height = Math.floor(u / C + kb + 1),
                            width = 0;
                            if (e % 2 == 0) {
                                marginLeft = "-" + Math.floor(t / D + gb + 1) + "px"
                            } else {
                                marginLeft = Math.floor(t / D + gb + 1) + "px"
                            }
                            break;
                        case "blindCurtainSliceTop":
                            height = Math.floor(u / C + kb + 1),
                            width = 0;
                            if (e % 2 == 0) {
                                marginLeft = "-" + Math.floor(t / D + gb + 1) + "px"
                            } else {
                                marginLeft = Math.floor(t / D + gb + 1) + "px"
                            }
                            break;
                        case "stampede":
                            height = 0;
                            width = 0;
                            marginLeft = t * .2 * (c % D - (D - Math.floor(D / 2))) + "px";
                            marginTop = u * .2 * (Math.floor(c / D) + 1 - (C - Math.floor(C / 2))) + "px";
                            break;
                        case "mosaic":
                            height = 0;
                            width = 0;
                            break;
                        case "mosaicReverse":
                            height = 0;
                            width = 0;
                            marginLeft = Math.floor(t / D + gb + 1) + "px";
                            marginTop = Math.floor(u / C + kb + 1) + "px";
                            break;
                        case "mosaicRandom":
                            height = 0;
                            width = 0;
                            marginLeft = Math.floor(t / D + gb + 1) * .5 + "px";
                            marginTop = Math.floor(u / C + kb + 1) * .5 + "px";
                            break;
                        case "mosaicSpiral":
                            height = 0;
                            width = 0;
                            marginLeft = Math.floor(t / D + gb + 1) * .5 + "px";
                            marginTop = Math.floor(u / C + kb + 1) * .5 + "px";
                            break;
                        case "mosaicSpiralReverse":
                            height = 0;
                            width = 0;
                            marginLeft = Math.floor(t / D + gb + 1) * .5 + "px";
                            marginTop = Math.floor(u / C + kb + 1) * .5 + "px";
                            break;
                        case "topLeftBottomRight":
                            height = 0;
                            width = 0;
                            break;
                        case "bottomRightTopLeft":
                            height = 0;
                            width = 0;
                            marginLeft = Math.floor(t / D + gb + 1) + "px";
                            marginTop = Math.floor(u / C + kb + 1) + "px";
                            break;
                        case "bottomLeftTopRight":
                            height = 0;
                            width = 0;
                            marginLeft = 0;
                            marginTop = Math.floor(u / C + kb + 1) + "px";
                            break;
                        case "topRightBottomLeft":
                            height = 0;
                            width = 0;
                            marginLeft = Math.floor(t / D + gb + 1) + "px";
                            marginTop = 0;
                            break;
                        case "scrollRight":
                            height = u;
                            width = t;
                            marginLeft = -t;
                            break;
                        case "scrollLeft":
                            height = u;
                            width = t;
                            marginLeft = t;
                            break;
                        case "scrollTop":
                            height = u;
                            width = t;
                            marginTop = u;
                            break;
                        case "scrollBottom":
                            height = u;
                            width = t;
                            marginTop = -u;
                            break;
                        case "scrollHorz":
                            height = u;
                            width = t;
                            if (d == 0 && l == B - 1) {
                                marginLeft = -t
                            } else if (d < l || d == B - 1 && l == 0) {
                                marginLeft = t
                            } else {
                                marginLeft = -t
                            }
                            break
                        }
                        var m = a(".cameraappended:eq(" + e + ")", k);
                        if (typeof L !== "undefined") {
                            clearInterval(L);
                            clearTimeout(M);
                            M = setTimeout(ib, J + G)
                        }
                        if (a(r).length) {
                            a(".camera_pag li", f).removeClass("cameracurrent");
                            a(".camera_pag li", f).eq(l).addClass("cameracurrent")
                        }
                        if (a(s).length) {
                            a("li", s).removeClass("cameracurrent");
                            a("li", s).eq(l).addClass("cameracurrent");
                            a("li", s).not(".cameracurrent").find("img").animate({
                                opacity: .5
                            }, 0);
                            a("li.cameracurrent img", s).animate({
                                opacity: 1
                            }, 0);
                            a("li", s).hover(function () {
                                a("img", this).stop(true, false).animate({
                                    opacity: 1
                                }, 150)
                            }, function () {
                                if (!a(this).hasClass("cameracurrent")) {
                                    a("img", this).stop(true, false).animate({
                                        opacity: .5
                                    }, 150)
                                }
                            })
                        }
                        var n = parseFloat(J) + parseFloat(G);
                        if (N == "scrollLeft" || N == "scrollRight" || N == "scrollTop" || N == "scrollBottom" || N == "scrollHorz") {
                            b.onStartTransition.call(this);
                            n = 0;
                            m.delay((J + G) / ab * ob[c] * F * .5).css({
                                display: "block",
                                height: height,
                                "margin-left": marginLeft,
                                "margin-top": marginTop,
                                width: width
                            }).animate({
                                height: Math.floor(u / C + kb + 1),
                                "margin-top": 0,
                                "margin-left": 0,
                                width: Math.floor(t / D + gb + 1)
                            }, J - G, O, o);
                            S.eq(d).delay((J + G) / ab * ob[c] * F * .5).animate({
                                "margin-left": marginLeft * -1,
                                "margin-top": marginTop * -1
                            }, J - G, O, function () {
                                a(this).css({
                                    "margin-top": 0,
                                    "margin-left": 0
                                })
                            })
                        } else {
                            b.onStartTransition.call(this);
                            n = parseFloat(J) + parseFloat(G);
                            if (T == "next") {
                                m.delay((J + G) / ab * ob[c] * F * .5).css({
                                    display: "block",
                                    height: height,
                                    "margin-left": marginLeft,
                                    "margin-top": marginTop,
                                    width: width,
                                    opacity: opacityOnGrid
                                }).animate({
                                    height: Math.floor(u / C + kb + 1),
                                    "margin-top": 0,
                                    "margin-left": 0,
                                    opacity: 1,
                                    width: Math.floor(t / D + gb + 1)
                                }, J - G, O, o)
                            } else {
                                S.eq(l).show().css("z-index", "999").addClass("cameracurrent");
                                S.eq(d).css("z-index", "1").removeClass("cameracurrent");
                                a(".cameraContent", g).eq(l).addClass("cameracurrent");
                                a(".cameraContent", g).eq(d).removeClass("cameracurrent");
                                m.delay((J + G) / ab * ob[c] * F * .5).css({
                                    display: "block",
                                    height: Math.floor(u / C + kb + 1),
                                    "margin-top": 0,
                                    "margin-left": 0,
                                    opacity: 1,
                                    width: Math.floor(t / D + gb + 1)
                                }).animate({
                                    height: height,
                                    "margin-left": marginLeft,
                                    "margin-top": marginTop,
                                    width: width,
                                    opacity: opacityOnGrid
                                }, J - G, O, o)
                            }
                        }
                    })
            }
        }
        var d = {
            alignment: "center",
            autoAdvance: true,
            mobileAutoAdvance: true,
            barDirection: "leftToRight",
            barPosition: "bottom",
            cols: 6,
            easing: "easeInOutExpo",
            mobileEasing: "",
            fx: "random",
            mobileFx: "",
            gridDifference: 250,
            height: "50%",
            imagePath: "images/",
            hover: true,
            loader: "pie",
            loaderColor: "#eeeeee",
            loaderBgColor: "#222222",
            loaderOpacity: .8,
            loaderPadding: 2,
            loaderStroke: 7,
            minHeight: "200px",
            navigation: true,
            navigationHover: true,
            mobileNavHover: true,
            opacityOnGrid: false,
            overlayer: true,
            pagination: true,
            playPause: true,
            pauseOnClick: true,
            pieDiameter: 38,
            piePosition: "rightTop",
            portrait: false,
            rows: 4,
            slicedCols: 12,
            slicedRows: 8,
            slideOn: "random",
            thumbnails: false,
            time: 7e3,
            transPeriod: 1500,
            onEndTransition: function () {},
            onLoaded: function () {},
            onStartLoading: function () {},
            onStartTransition: function () {}
        };
        var b = a.extend({}, d, b);
        var f = a(this).addClass("camera_wrap");
        f.wrapInner('<div class="camera_src" />').wrapInner('<div class="camera_fakehover" />');
        var g = a(".camera_fakehover", f);
        g.append('<div class="camera_target"></div>');
        if (b.overlayer == true) {
            g.append('<div class="camera_overlayer"></div>')
        }
        g.append('<div class="camera_target_content"></div>');
        var h;
        if (b.loader == "pie" && a.browser.msie && a.browser.version < 9) {
            h = "bar"
        } else {
            h = b.loader
        }
        if (h == "pie") {
            g.append('<div class="camera_pie"></div>')
        } else if (h == "bar") {
            g.append('<div class="camera_bar"></div>')
        } else {
            g.append('<div class="camera_bar" style="display:none"></div>')
        }
        if (b.playPause == true) {
            g.append('<div class="camera_commands"></div>')
        }
        if (b.navigation == true) {
            g.append('<div class="camera_prev"><span></span></div>').append('<div class="camera_next"><span></span></div>')
        }
        if (b.thumbnails == true) {
            f.append('<div class="camera_thumbs_cont" />')
        }
        if (b.thumbnails == true && b.pagination != true) {
            a(".camera_thumbs_cont", f).wrap("<div />").wrap('<div class="camera_thumbs" />').wrap("<div />").wrap('<div class="camera_command_wrap" />')
        }
        if (b.pagination == true) {
            f.append('<div class="camera_pag"></div>')
        }
        f.append('<div class="camera_loader"></div>');
        a(".camera_caption", f).each(function () {
            a(this).wrapInner("<div />")
        });
        var i = "pie_" + f.index(),
            j = a(".camera_src", f),
            k = a(".camera_target", f),
            l = a(".camera_target_content", f),
            m = a(".camera_pie", f),
            n = a(".camera_bar", f),
            o = a(".camera_prev", f),
            p = a(".camera_next", f),
            q = a(".camera_commands", f),
            r = a(".camera_pag", f),
            s = a(".camera_thumbs_cont", f);
        var t, u;
        var v = new Array;
        a("> div", j).each(function () {
                v.push(a(this).attr("data-src"))
            });
        var w = new Array;
        a("> div", j).each(function () {
                if (a(this).attr("data-link")) {
                    w.push(a(this).attr("data-link"))
                } else {
                    w.push("")
                }
            });
        var x = new Array;
        a("> div", j).each(function () {
                if (a(this).attr("data-target")) {
                    x.push(a(this).attr("data-target"))
                } else {
                    x.push("")
                }
            });
        var y = new Array;
        a("> div", j).each(function () {
                if (a(this).attr("data-portrait")) {
                    y.push(a(this).attr("data-portrait"))
                } else {
                    y.push("")
                }
            });
        var z = new Array;
        a("> div", j).each(function () {
                if (a(this).attr("data-alignment")) {
                    z.push(a(this).attr("data-alignment"))
                } else {
                    z.push("")
                }
            });
        var A = new Array;
        a("> div", j).each(function () {
                if (a(this).attr("data-thumb")) {
                    A.push(a(this).attr("data-thumb"))
                } else {
                    A.push("")
                }
            });
        var B = v.length;
        a(l).append('<div class="cameraContents" />');
        var C;
        for (C = 0; C < B; C++) {
                a(".cameraContents", l).append('<div class="cameraContent" />');
                if (w[C] != "") {
                    var D = a("> div ", j).eq(C).attr("data-box");
                    if (typeof D !== "undefined" && D !== false && D != "") {
                        D = 'data-box="' + a("> div ", j).eq(C).attr("data-box") + '"'
                    } else {
                        D = ""
                    }
                    a(".camera_target_content .cameraContent:eq(" + C + ")", f).append('<a class="camera_link" href="' + w[C] + '" ' + D + ' target="' + x[C] + '"></a>')
                }
            }
        a(".camera_caption", f).each(function () {
                var b = a(this).parent().index(),
                    c = f.find(".cameraContent").eq(b);
                a(this).appendTo(c)
            });
        k.append('<div class="cameraCont" />');
        var E = a(".cameraCont", f);
        var F;
        for (F = 0; F < B; F++) {
                E.append('<div class="cameraSlide cameraSlide_' + F + '" />');
                var G = a("> div:eq(" + F + ")", j);
                k.find(".cameraSlide_" + F).clone(G)
            }
        a(window).bind("load resize pageshow", function () {
                hb();
                H()
            });
        E.append('<div class="cameraSlide cameraSlide_' + F + '" />');
        var I;
        f.show();
        var t = k.width();
        var u = k.height();
        var J;
        a(window).bind("resize pageshow", function () {
                if (I == true) {
                    K()
                }
                a("ul", s).animate({
                    "margin-top": 0
                }, 0, hb);
                if (!j.hasClass("paused")) {
                    j.addClass("paused");
                    if (a(".camera_stop", V).length) {
                        a(".camera_stop", V).hide();
                        a(".camera_play", V).show();
                        if (h != "none") {
                            a("#" + i).hide()
                        }
                    } else {
                        if (h != "none") {
                            a("#" + i).hide()
                        }
                    }
                    clearTimeout(J);
                    J = setTimeout(function () {
                        j.removeClass("paused");
                        if (a(".camera_play", V).length) {
                            a(".camera_play", V).hide();
                            a(".camera_stop", V).show();
                            if (h != "none") {
                                a("#" + i).fadeIn()
                            }
                        } else {
                            if (h != "none") {
                                a("#" + i).fadeIn()
                            }
                        }
                    }, 1500)
                }
            });
        var L, M;
        var N, O, P, q, r;
        var Q, R;
        if (e() && b.mobileAutoAdvance != "") {
                O = b.mobileAutoAdvance
            } else {
                O = b.autoAdvance
            }
        if (O == false) {
                j.addClass("paused")
            }
        if (e() && b.mobileNavHover != "") {
                P = b.mobileNavHover
            } else {
                P = b.navigationHover
            }
        if (j.length != 0) {
                var S = a(".cameraSlide", k);
                S.wrapInner('<div class="camerarelative" />');
                var T;
                var U = b.barDirection;
                var V = f;
                a("iframe", g).each(function () {
                    var b = a(this);
                    var c = b.attr("src");
                    b.attr("data-src", c);
                    var d = b.parent().index(".camera_src > div");
                    a(".camera_target_content .cameraContent:eq(" + d + ")", f).append(b)
                });

                function W() {
                    a("iframe", g).each(function () {
                        a(".camera_caption", g).show();
                        var c = a(this);
                        var d = c.attr("data-src");
                        c.attr("src", d);
                        var e = b.imagePath + "blank.gif";
                        var h = new Image;
                        h.src = e;
                        if (b.height.indexOf("%") != -1) {
                            var i = Math.round(t / (100 / parseFloat(b.height)));
                            if (b.minHeight != "" && i < parseFloat(b.minHeight)) {
                                u = parseFloat(b.minHeight)
                            } else {
                                u = i
                            }
                        } else if (b.height == "auto") {
                            u = f.height()
                        } else {
                            u = parseFloat(b.height)
                        }
                        c.after(a(h).attr({
                            "class": "imgFake",
                            width: t,
                            height: u
                        }));
                        var j = c.clone();
                        c.remove();
                        a(h).bind("click", function () {
                            if (a(this).css("position") == "absolute") {
                                a(this).remove();
                                if (d.indexOf("vimeo") != -1 || d.indexOf("youtube") != -1) {
                                    if (d.indexOf("?") != -1) {
                                        autoplay = "&autoplay=1"
                                    } else {
                                        autoplay = "?autoplay=1"
                                    }
                                } else if (d.indexOf("dailymotion") != -1) {
                                    if (d.indexOf("?") != -1) {
                                        autoplay = "&autoPlay=1"
                                    } else {
                                        autoplay = "?autoPlay=1"
                                    }
                                }
                                j.attr("src", d + autoplay);
                                R = true
                            } else {
                                a(this).css({
                                    position: "absolute",
                                    top: 0,
                                    left: 0,
                                    zIndex: 10
                                }).after(j);
                                j.css({
                                    position: "absolute",
                                    top: 0,
                                    left: 0,
                                    zIndex: 9
                                })
                            }
                        })
                    })
                }
                W();
                if (b.hover == true) {
                    if (!e()) {
                        g.hover(function () {
                            j.addClass("hovered")
                        }, function () {
                            j.removeClass("hovered")
                        })
                    }
                }
                if (P == true) {
                    a(o, f).animate({
                        opacity: 0
                    }, 0);
                    a(p, f).animate({
                        opacity: 0
                    }, 0);
                    a(q, f).animate({
                        opacity: 0
                    }, 0);
                    if (e()) {
                        g.live("vmouseover", function () {
                            a(o, f).animate({
                                opacity: 1
                            }, 200);
                            a(p, f).animate({
                                opacity: 1
                            }, 200);
                            a(q, f).animate({
                                opacity: 1
                            }, 200)
                        });
                        g.live("vmouseout", function () {
                            a(o, f).delay(500).animate({
                                opacity: 0
                            }, 200);
                            a(p, f).delay(500).animate({
                                opacity: 0
                            }, 200);
                            a(q, f).delay(500).animate({
                                opacity: 0
                            }, 200)
                        })
                    } else {
                        g.hover(function () {
                            a(o, f).animate({
                                opacity: 1
                            }, 200);
                            a(p, f).animate({
                                opacity: 1
                            }, 200);
                            a(q, f).animate({
                                opacity: 1
                            }, 200)
                        }, function () {
                            a(o, f).animate({
                                opacity: 0
                            }, 200);
                            a(p, f).animate({
                                opacity: 0
                            }, 200);
                            a(q, f).animate({
                                opacity: 0
                            }, 200)
                        })
                    }
                }
                a(".camera_stop", V).live("click", function () {
                    O = false;
                    j.addClass("paused");
                    if (a(".camera_stop", V).length) {
                        a(".camera_stop", V).hide();
                        a(".camera_play", V).show();
                        if (h != "none") {
                            a("#" + i).hide()
                        }
                    } else {
                        if (h != "none") {
                            a("#" + i).hide()
                        }
                    }
                });
                a(".camera_play", V).live("click", function () {
                    O = true;
                    j.removeClass("paused");
                    if (a(".camera_play", V).length) {
                        a(".camera_play", V).hide();
                        a(".camera_stop", V).show();
                        if (h != "none") {
                            a("#" + i).show()
                        }
                    } else {
                        if (h != "none") {
                            a("#" + i).show()
                        }
                    }
                });
                if (b.pauseOnClick == true) {
                    a(".camera_target_content", g).mouseup(function () {
                        O = false;
                        j.addClass("paused");
                        a(".camera_stop", V).hide();
                        a(".camera_play", V).show();
                        a("#" + i).hide()
                    })
                }
                a(".cameraContent, .imgFake", g).hover(function () {
                    Q = true
                }, function () {
                    Q = false
                });
                a(".cameraContent, .imgFake", g).bind("click", function () {
                    if (R == true && Q == true) {
                        O = false;
                        a(".camera_caption", g).hide();
                        j.addClass("paused");
                        a(".camera_stop", V).hide();
                        a(".camera_play", V).show();
                        a("#" + i).hide()
                    }
                })
            }
        if (h != "pie") {
                n.append('<span class="camera_bar_cont" />');
                a(".camera_bar_cont", n).animate({
                    opacity: b.loaderOpacity
                }, 0).css({
                    position: "absolute",
                    left: 0,
                    right: 0,
                    top: 0,
                    bottom: 0,
                    "background-color": b.loaderBgColor
                }).append('<span id="' + i + '" />');
                a("#" + i).animate({
                    opacity: 0
                }, 0);
                var Z = a("#" + i);
                Z.css({
                    position: "absolute",
                    "background-color": b.loaderColor
                });
                switch (b.barPosition) {
                case "left":
                    n.css({
                        right: "auto",
                        width: b.loaderStroke
                    });
                    break;
                case "right":
                    n.css({
                        left: "auto",
                        width: b.loaderStroke
                    });
                    break;
                case "top":
                    n.css({
                        bottom: "auto",
                        height: b.loaderStroke
                    });
                    break;
                case "bottom":
                    n.css({
                        top: "auto",
                        height: b.loaderStroke
                    });
                    break
                }
                switch (U) {
                case "leftToRight":
                    Z.css({
                        left: 0,
                        right: 0,
                        top: b.loaderPadding,
                        bottom: b.loaderPadding
                    });
                    break;
                case "rightToLeft":
                    Z.css({
                        left: 0,
                        right: 0,
                        top: b.loaderPadding,
                        bottom: b.loaderPadding
                    });
                    break;
                case "topToBottom":
                    Z.css({
                        left: b.loaderPadding,
                        right: b.loaderPadding,
                        top: 0,
                        bottom: 0
                    });
                    break;
                case "bottomToTop":
                    Z.css({
                        left: b.loaderPadding,
                        right: b.loaderPadding,
                        top: 0,
                        bottom: 0
                    });
                    break
                }
            } else {
                m.append('<canvas id="' + i + '"></canvas>');
                var _;
                var Z = document.getElementById(i);
                Z.setAttribute("width", b.pieDiameter);
                Z.setAttribute("height", b.pieDiameter);
                var ab;
                switch (b.piePosition) {
                case "leftTop":
                    ab = "left:0; top:0;";
                    break;
                case "rightTop":
                    ab = "right:0; top:0;";
                    break;
                case "leftBottom":
                    ab = "left:0; bottom:0;";
                    break;
                case "rightBottom":
                    ab = "right:0; bottom:0;";
                    break
                }
                Z.setAttribute("style", "position:absolute; z-index:1002; " + ab);
                var bb;
                var cb;
                if (Z && Z.getContext) {
                    var db = Z.getContext("2d");
                    db.rotate(Math.PI * (3 / 2));
                    db.translate(-b.pieDiameter, 0)
                }
            }
        if (h == "none" || O == false) {
                a("#" + i).hide();
                a(".camera_canvas_wrap", V).hide()
            }
        if (a(r).length) {
                a(r).append('<ul class="camera_pag_ul" />');
                var eb;
                for (eb = 0; eb < B; eb++) {
                    a(".camera_pag_ul", f).append('<li class="pag_nav_' + eb + '" style="position:relative; z-index:1002"><span><span>' + eb + "</span></span></li>")
                }
                a(".camera_pag_ul li", f).hover(function () {
                    a(this).addClass("camera_hover");
                    if (a(".camera_thumb", this).length) {
                        var b = a(".camera_thumb", this).outerWidth(),
                            c = a(".camera_thumb", this).outerHeight(),
                            d = a(this).outerWidth();
                        a(".camera_thumb", this).show().css({
                                top: "-" + c + "px",
                                left: "-" + (b - d) / 2 + "px"
                            }).animate({
                                opacity: 1,
                                "margin-top": "-3px"
                            }, 200);
                        a(".thumb_arrow", this).show().animate({
                                opacity: 1,
                                "margin-top": "-3px"
                            }, 200)
                    }
                }, function () {
                    a(this).removeClass("camera_hover");
                    a(".camera_thumb", this).animate({
                        "margin-top": "-20px",
                        opacity: 0
                    }, 200, function () {
                        a(this).css({
                            marginTop: "5px"
                        }).hide()
                    });
                    a(".thumb_arrow", this).animate({
                        "margin-top": "-20px",
                        opacity: 0
                    }, 200, function () {
                        a(this).css({
                            marginTop: "5px"
                        }).hide()
                    })
                })
            }
        if (a(s).length) {
                var fb;
                if (!a(r).length) {
                    a(s).append("<div />");
                    a(s).before('<div class="camera_prevThumbs hideNav"><div></div></div>').before('<div class="camera_nextThumbs hideNav"><div></div></div>');
                    a("> div", s).append("<ul />");
                    a.each(A, function (b, c) {
                        if (a("> div", j).eq(b).attr("data-thumb") != "") {
                            var d = a("> div", j).eq(b).attr("data-thumb"),
                                e = new Image;
                            e.src = d;
                            a("ul", s).append('<li class="pix_thumb pix_thumb_' + b + '" />');
                            a("li.pix_thumb_" + b, s).append(a(e).attr("class", "camera_thumb"))
                        }
                    })
                } else {
                    a.each(A, function (b, c) {
                        if (a("> div", j).eq(b).attr("data-thumb") != "") {
                            var d = a("> div", j).eq(b).attr("data-thumb"),
                                e = new Image;
                            e.src = d;
                            a("li.pag_nav_" + b, r).append(a(e).attr("class", "camera_thumb").css({
                                    position: "absolute"
                                }).animate({
                                    opacity: 0
                                }, 0));
                            a("li.pag_nav_" + b + " > img", r).after('<div class="thumb_arrow" />');
                            a("li.pag_nav_" + b + " > .thumb_arrow", r).animate({
                                    opacity: 0
                                }, 0)
                        }
                    });
                    f.css({
                        marginBottom: a(r).outerHeight()
                    })
                }
            } else if (!a(s).length && a(r).length) {
                f.css({
                    marginBottom: a(r).outerHeight()
                })
            }
        var gb = true;
        if (a(q).length) {
                a(q).append('<div class="camera_play"></div>').append('<div class="camera_stop"></div>');
                if (O == true) {
                    a(".camera_play", V).hide();
                    a(".camera_stop", V).show()
                } else {
                    a(".camera_stop", V).hide();
                    a(".camera_play", V).show()
                }
            }
        ib();
        a(".moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom", g).each(function () {
                a(this).css("visibility", "hidden")
            });
        b.onStartLoading.call(this);
        jb();
        if (a(o).length) {
                a(o).click(function () {
                    if (!j.hasClass("camerasliding")) {
                        var c = parseFloat(a(".cameraSlide.cameracurrent", k).index());
                        clearInterval(L);
                        W();
                        a("#" + i + ", .camera_canvas_wrap", f).animate({
                            opacity: 0
                        }, 0);
                        ib();
                        if (c != 0) {
                            jb(c)
                        } else {
                            jb(B)
                        }
                        b.onStartLoading.call(this)
                    }
                })
            }
        if (a(p).length) {
                a(p).click(function () {
                    if (!j.hasClass("camerasliding")) {
                        var c = parseFloat(a(".cameraSlide.cameracurrent", k).index());
                        clearInterval(L);
                        W();
                        a("#" + i + ", .camera_canvas_wrap", V).animate({
                            opacity: 0
                        }, 0);
                        ib();
                        if (c == B - 1) {
                            jb(1)
                        } else {
                            jb(c + 2)
                        }
                        b.onStartLoading.call(this)
                    }
                })
            }
        if (e()) {
                g.bind("swipeleft", function (c) {
                    if (!j.hasClass("camerasliding")) {
                        var d = parseFloat(a(".cameraSlide.cameracurrent", k).index());
                        clearInterval(L);
                        W();
                        a("#" + i + ", .camera_canvas_wrap", V).animate({
                            opacity: 0
                        }, 0);
                        ib();
                        if (d == B - 1) {
                            jb(1)
                        } else {
                            jb(d + 2)
                        }
                        b.onStartLoading.call(this)
                    }
                });
                g.bind("swiperight", function (c) {
                    if (!j.hasClass("camerasliding")) {
                        var d = parseFloat(a(".cameraSlide.cameracurrent", k).index());
                        clearInterval(L);
                        W();
                        a("#" + i + ", .camera_canvas_wrap", V).animate({
                            opacity: 0
                        }, 0);
                        ib();
                        if (d != 0) {
                            jb(d)
                        } else {
                            jb(B)
                        }
                        b.onStartLoading.call(this)
                    }
                })
            }
        if (a(r).length) {
                a(".camera_pag li", f).click(function () {
                    if (!j.hasClass("camerasliding")) {
                        var c = parseFloat(a(this).index());
                        var d = parseFloat(a(".cameraSlide.cameracurrent", k).index());
                        if (c != d) {
                            clearInterval(L);
                            W();
                            a("#" + i + ", .camera_canvas_wrap", V).animate({
                                opacity: 0
                            }, 0);
                            ib();
                            jb(c + 1);
                            b.onStartLoading.call(this)
                        }
                    }
                })
            }
        if (a(s).length) {
                a(".pix_thumb img", s).click(function () {
                    if (!j.hasClass("camerasliding")) {
                        var c = parseFloat(a(this).parents("li").index());
                        var d = parseFloat(a(".cameracurrent", k).index());
                        if (c != d) {
                            clearInterval(L);
                            W();
                            a("#" + i + ", .camera_canvas_wrap", V).animate({
                                opacity: 0
                            }, 0);
                            a(".pix_thumb", s).removeClass("cameracurrent");
                            a(this).parents("li").addClass("cameracurrent");
                            ib();
                            jb(c + 1);
                            hb();
                            b.onStartLoading.call(this)
                        }
                    }
                });
                a(".camera_thumbs_cont .camera_prevThumbs", V).hover(function () {
                    a(this).stop(true, false).animate({
                        opacity: 1
                    }, 250)
                }, function () {
                    a(this).stop(true, false).animate({
                        opacity: .7
                    }, 250)
                });
                a(".camera_prevThumbs", V).click(function () {
                    var b = 0,
                        c = a(s).outerWidth(),
                        d = a("ul", s).offset().left,
                        e = a("> div", s).offset().left,
                        f = e - d;
                    a(".camera_visThumb", s).each(function () {
                            var c = a(this).outerWidth();
                            b = b + c
                        });
                    if (f - b > 0) {
                            a("ul", s).animate({
                                "margin-left": "-" + (f - b) + "px"
                            }, 500, H)
                        } else {
                            a("ul", s).animate({
                                "margin-left": 0
                            }, 500, H)
                        }
                });
                a(".camera_thumbs_cont .camera_nextThumbs", V).hover(function () {
                    a(this).stop(true, false).animate({
                        opacity: 1
                    }, 250)
                }, function () {
                    a(this).stop(true, false).animate({
                        opacity: .7
                    }, 250)
                });
                a(".camera_nextThumbs", V).click(function () {
                    var b = 0,
                        c = a(s).outerWidth(),
                        d = a("ul", s).outerWidth(),
                        e = a("ul", s).offset().left,
                        f = a("> div", s).offset().left,
                        g = f - e;
                    a(".camera_visThumb", s).each(function () {
                            var c = a(this).outerWidth();
                            b = b + c
                        });
                    if (g + b + b < d) {
                            a("ul", s).animate({
                                "margin-left": "-" + (g + b) + "px"
                            }, 500, H)
                        } else {
                            a("ul", s).animate({
                                "margin-left": "-" + (d - c) + "px"
                            }, 500, H)
                        }
                })
            }
    }
})(jQuery);
(function (a) {
    a.fn.cameraStop = function () {
        var b = a(this),
            c = a(".camera_src", b),
            d = "pie_" + b.index();
        c.addClass("stopped");
        if (a(".camera_showcommands").length) {
                var e = a(".camera_thumbs_wrap", b)
            } else {
                var e = b
            }
    }
})(jQuery);
(function (a) {
    a.fn.cameraPause = function () {
        var b = a(this);
        var c = a(".camera_src", b);
        c.addClass("paused")
    }
})(jQuery);
(function (a) {
    a.fn.cameraResume = function () {
        var b = a(this);
        var c = a(".camera_src", b);
        if (typeof autoAdv === "undefined" || autoAdv !== true) {
            c.removeClass("paused")
        }
    }
})(jQuery);