function get_real_width() {
    var a = 0;
    if (navigator.platform.indexOf("iPhone") != -1) a = $(window).width();
    else if (navigator.platform.indexOf("iPad") != -1) a = $(window).width();
    else a = window.innerWidth;
    return a
}
function main_menu() {
    $("#menu a").click(function () {
        if ($("body").hasClass("folio") && $(this).attr("id") == "menuwork") {} else if ($(this).hasClass("active")) return false;
        if ($(this).attr("id") != "menublog") {
            if ($("body").hasClass("work")) work_exit();
            else if ($("body").hasClass("home")) home_exit();
            else if ($("body").hasClass("about")) about_exit();
            else if ($("body").hasClass("contact")) contact_exit();
            else if ($("body").hasClass("blog")) contact_exit();
            else if ($("body").hasClass("sketchbook")) sketchbook_exit();
            else if ($("body").hasClass("folio") && $(this).attr("id") != "menuwork") folio_exit()
        }
        if ($(this).attr("id") == "menuhome") {
            home_init()
        } else if ($("body").hasClass("folio") && $(this).attr("id") == "menuwork") $(window).scrollTop($("#morework").offset().top - 120);
        else if ($(this).attr("id") == "menuwork") work_init();
        else if ($(this).attr("id") == "menusketchbook") sketchbook_init();
        else if ($(this).attr("id") == "menuabout") about_init();
        else if ($(this).attr("id") == "menucontact") contact_init();
        else if ($(this).attr("id") == "menublog") blog_init();
        return false
    })
}
function url_params() {
    var a = window.location.hash;
    return a.substring(1)
}
function handle_pages(a) {
    if (a == "home") start();
    else if (a == "work") work_init();
    else if (a == "sketch") sketchbook_init();
    else if (a == "about") about_init();
    else if (a == "contact") contact_init();
    else if (a == "squarespace") folio_page_init("./panels/squarespace.php");
    else if (a == "honda") folio_page_init("./panels/honda.php");
    else if (a == "catermax") folio_page_init("./panels/catermax.php");
    else if (a == "la-redoute") folio_page_init("./panels/la-redoute.php");
    else if (a == "bertus-gym") folio_page_init("./panels/bertus-gym.php");
    else if (a == "hayes-and-pike") folio_page_init("./panels/hayes-and-pike.php");
    else if (a == "todo") folio_page_init("./panels/todo.php");
    else if (a == "the-malta-guide") folio_page_init("./panels/the-malta-guide.php");
    else if (a == "commonwealth") folio_page_init("./panels/commonwealth.php");
    else start()
}
function start() {
    show_loader();
    setTimeout("home_init();", 800)
}
function cache() {
    var a = new Array;
    a.push("./panels/thumb_squarespace.png");
    a.push("./panels/thumb_catermax.png");
    a.push("./panels/thumb_honda.png");
    a.push("./panels/thumb_la-redoute.png");
    a.push("./panels/thumb_bertus-gym.png");
    a.push("./panels/thumb_hayes-and-pike.png");
    a.push("./panels/thumb_the-malta-guide.png");
    a.push("./panels/thumb_commonwealth.png");
    a.push("./panels/thumb_todo.png");
    a.push("./panels/catermax-1.png");
    a.push("./panels/honda-1.png");
    a.push("./panels/redoute-1.png");
    a.push("./panels/bertu-1.png");
    a.push("./panels/hayes-1.png");
    a.push("./panels/tmg-1.png");
    a.push("./panels/cigf-1.png");
    a.push("./panels/dribbble-1.jpg");
    a.push("./img/photo.png");
    var b = [];
    for (var c = 0; c < a.length; c++) {
        b[c] = new Image;
        b[c].src = a[c]
    }
}
function draw_grid(a, b, c) {
    var d = $(".gridline", a).get();
    var e = $(".gridgutter", a).get();
    var f = $(".grid", a).width();
    var g = f / b * .8;
    var h = (f - g * b) / (b - 1);
    if (c) {
        g = f / b * .78;
        h = (f - g * b) / (b - 1)
    }
    var i = 0;
    $.each(d, function (a, b) {
        if (i == 0) i += g;
        else i += g + h;
        $(this).css("left", i)
    });
    i = 0;
    $.each(e, function (a, b) {
        i += g + h;
        $(this).css("left", i)
    })
}
function call_me() {
    var a = "+1 (347) 206-3868";
    if ($("body").hasClass("contact")) {
        if (get_real_width() >= 768) {
            $("#callmetrigger").attr("href", "skype:" + a);
            $("#callmetrigger").text(a)
        } else {
            $("#callmetrigger").attr("href", "tel:" + a);
            $("#callmetrigger").text(a)
        }
    }
    $("#callmetrigger").lettering()
}
function window_resize() {
    modify_cols();
    $(".iconlcd").each(function (a) {
        $(this).height($(this).width() * .777);
        $(".grid", this).css("left", 0);
        $(".grid", this).css("bottom", $(this).height() * .02);
        $(".grid", this).css("height", $(this).height() * .89);
        $(".grid", this).css("width", $(this).width());
        $(".topbar", this).css("top", $(this).width() * .079);
        $(".circle", this).css("top", $(this).width() * .024);
        $(".circle", this).css("left", $(this).width() * .024);
        $(".circle", this).css("width", $(this).width() * .026);
        $(".circle", this).css("height", $(this).width() * .026);
        $(".thumb", this).css("top", $(this).width() * .089);
        $(".thumb", this).css("left", $(this).width() * .01);
        $(".thumb", this).css("width", $(this).width() * .985);
        $(".thumb", this).css("height", $(this).width() * .685);
        if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
            $(".thumb", this).css("left", $(this).width() * .008);
            $(".thumb", this).css("width", $(this).width() * .987)
        }
        $(".dash", this).css("width", $(this).width() * .04);
        $(".dash", this).css("top", $(this).width() * .04);
        $(".dash", this).css("left", $(this).width() * .933)
    });
    $(".iconiphone").each(function (a) {
        $(this).height($(this).width() * 2.182);
        var b = $(this).width();
        var c = $(this).height();
        $(".grid", this).css("left", 0);
        $(".grid", this).css("top", b * .25);
        $(".grid", this).css("height", c * .77);
        $(".grid", this).css("width", b);
        $(".topbar", this).css("top", b * .222);
        $(".bottombar", this).css("top", b * 1.922);
        $(".circle", this).css("top", b * 2);
        $(".circle", this).css("left", b * .444);
        $(".circle", this).css("width", b * .089);
        $(".circle", this).css("height", b * .089);
        $(".thumb", this).css("top", b * .234);
        $(".thumb", this).css("width", b);
        $(".thumb", this).css("height", c * .78);
        $(".dash", this).css("width", b * .111);
        $(".dash", this).css("top", b * .111);
        $(".dash", this).css("left", b * .444)
    });
    $(".iconipad").each(function (a) {
        $(this).height($(this).width() * .777);
        $(".grid", this).css("left", $(this).width() * .09);
        $(".grid", this).css("top", 0);
        $(".grid", this).css("height", $(this).height());
        $(".grid", this).css("width", $(this).width() * .82);
        $(".topbar", this).css("height", $(this).height() * 1);
        $(".topbar", this).css("width", 1);
        $(".topbar", this).css("left", $(this).width() * .083);
        $(".topbar", this).css("top", 0);
        $(".bottombar", this).css("height", $(this).height() * 1);
        $(".bottombar", this).css("width", 1);
        $(".bottombar", this).css("right", $(this).width() * .083);
        $(".bottombar", this).css("top", 0);
        $(".circle", this).css("top", $(this).width() * .38);
        $(".circle", this).css("left", $(this).width() * .024);
        $(".circle", this).css("width", $(this).width() * .032);
        $(".circle", this).css("height", $(this).width() * .032);
        $(".dash", this).css("height", $(this).width() * .04);
        $(".dash", this).css("width", 1);
        $(".dash", this).css("top", $(this).height() * .49);
        $(".dash", this).css("right", $(this).width() * .038);
        $(".thumb", this).css("left", $(this).width() * .092);
        $(".thumb", this).css("top", $(this).width() * .01);
        $(".thumb", this).css("width", $(this).width() * .82);
        $(".thumb", this).css("height", $(this).height() * .985);
        if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
            $(".thumb", this).css("width", $(this).width() * .81);
            $(".thumb", this).css("top", $(this).width() * .008)
        }
    });
    $.each($(".iconlcd"), function (a, b) {
        draw_grid(this, 12, true)
    });
    $.each($(".iconiphone"), function (a, b) {
        draw_grid(this, 4)
    });
    $.each($(".iconipad"), function (a, b) {
        draw_grid(this, 6)
    });
    call_me()
}
function modify_cols() {
    var a = get_real_width();
    if (a >= 768 && a <= 815) {
        swap_cols(".foliodescwrapper", "five", "eight");
        swap_cols("#aboutbiowrapper", "five", "eight");
        swap_cols("#aboutintrowrapper", "six", "eight");
        swap_cols("#contactemail", "two", "three");
        swap_cols("#contactprenumber", "five", "three");
        swap_cols("#contactdribbble", "three", "four");
        swap_cols("#folioshortpadding", "one", "")
    } else {
        swap_cols(".foliodescwrapper", "eight", "five");
        swap_cols("#aboutbiowrapper", "eight", "five");
        swap_cols("#aboutintrowrapper", "eight", "six");
        swap_cols("#contactemail", "three", "two");
        swap_cols("#contactprenumber", "three", "five");
        swap_cols("#contactdribbble", "four", "three");
        swap_cols("#folioshortpadding", "", "one")
    }
    if (a <= 767) {
        swap_cols("body.work .iconiphone", "eight", "five")
    } else {
        swap_cols("body.work .iconiphone", "five", "eight")
    }
}
function swap_cols(a, b, c) {
    $(a).removeClass(b + "col");
    $(a).addClass(c + "col")
}
function valid_browsers() {
    if ($.browser.msie && parseInt($.browser.version) <= 8) return false;
    return true
}
function home_grid_hover() {
    $("#main").mousemove(function (a) {
        var b = a.pageX;
        var c = a.pageY;
        if (b >= $("#homeweb").offset().left && b <= $("#homeiphone").offset().left) {
            animate_grid("#homeweb .animatedgrid", true)
        } else if (b >= $("#homeiphone").offset().left && b <= $("#homeprint").offset().left) {
            animate_grid("mobile", true)
        } else if (b >= $("#homeprint").offset().left && b <= $("#homeprint").offset().left + $("#homeprint").width()) {
            animate_grid("#homeprint .animatedgrid", true)
        } else animate_grid("clear", true)
    });
    $("#main").mouseleave(function (a) {
        animate_grid("clear", true)
    })
}
function animate_grid(a, b) {
    var c = 200;
    var d = 600;
    var e = "";
    if (a != activeicon) {
        if (b) {
            if (activeicon == "mobile") {
                $("#homeiphone .animatedgrid").stop().animate({
                    opacity: 0
                }, d);
                $("#homeipad .animatedgrid").stop().animate({
                    opacity: 0
                }, d)
            } else $(activeicon).stop().animate({
                opacity: 0
            }, d)
        }
        if (a == "mobile") {
            $("#homeiphone .animatedgrid").stop().animate({
                opacity: 1
            }, c);
            $("#homeipad .animatedgrid").stop().animate({
                opacity: 1
            }, c)
        } else if (a != "clear") {
            $(a).stop().animate({
                opacity: 1
            }, c)
        }
        activeicon = a;
        if (a == "clear") $("#homeserviceswrapperhover").stop().animate({
            opacity: 0
        }, d);
        else $("#homeserviceswrapperhover").stop().animate({
            opacity: 1
        }, c * 2);
        e = "Explore ";
        if (a == "mobile") e += a;
        else if (a.indexOf("print") != -1) e += "print";
        else e += "web";
        e += " design & other work";
        $("#homeserviceswrapperhover p").html(e)
    }
}
function change_body_class(a) {
    page = a;
    $("body").removeClass();
    $("body").addClass(a)
}
function menu_scroll() {
    if (!$("#topwrapper").hasClass("smallfixed")) {
        var a = $(window).scrollTop();
        var b = 132;
        if (a >= b) menu_small();
        else menu_full()
    }
}
function menu_full() {
    menu_toggle("full");
    $("#topwrapper").css("position", "relative");
    $("#topwrapper").css("left", "0px");
    $("#topwrapper").css("top", "0px");
    $("#menupadding").hide()
}
function menu_small() {
    menu_toggle("small");
    var a = $("#topwrapper").offset().left;
    $("#topwrapper").css("position", "fixed");
    $("#topwrapper").css("left", a + "px");
    $("#topwrapper").css("top", "-1px");
    $("#menupadding").show()
}
function menu_small_fixed() {
    menu_toggle("smallfixed");
    var a = $("#topwrapper").offset().left;
    $("#topwrapper").css("position", "fixed");
    $("#topwrapper").css("left", a + "px");
    $("#topwrapper").css("top", "-1px");
    $("#menupadding").show()
}
function menu_toggle(a) {
    if (!$("#topwrapper").hasClass(a)) {
        if (a == "small" || a == "smallfixed") $("#topwrapper").hide();
        $("#topwrapper").removeClass("smallfixed");
        $("#topwrapper").removeClass("small");
        $("#topwrapper").removeClass("full");
        $("#topwrapper").addClass(a);
        if (a == "small" || a == "smallfixed") $("#topwrapper").fadeIn(250)
    }
}
function cycle_down_arrow_part2() {
    $(".arrowdown img").animate({
        opacity: .2
    }, 1200, function () {
        cycle_down_arrow()
    })
}
function cycle_down_arrow() {
    if (cycledownarrow) {
        $(".arrowdown img").animate({
            opacity: 1
        }, 1400, function () {
            cycle_down_arrow_part2()
        })
    } else $(".arrowdown img").animate({
        opacity: .2
    }, 1400)
}
function folio_page_color(a) {
    if (a == "greenpattern") {
        if (get_real_width() > 1024) {
            $("body").css("background", "url(./img/pattern-green.png) repeat");
            $("header").css("background", "url(./img/pattern-green.png) repeat");
            return
        } else a = "rgb(226, 255, 239)"
    }
    if (a == "greypattern") {
        if (get_real_width() > 1024) {
            $("body").css("background", "url(./img/pattern-grey.png) repeat");
            $("header").css("background", "none");
            return
        } else a = "rgb(245, 245, 245)"
    }
    if ($("body").css("backgroundColor") != a) {
        $("body").css("background-image", "none");
        $("header").css("background-image", "none");
        $("body").stop().animate({
            backgroundColor: a
        }, 500);
        $("header").stop().animate({
            backgroundColor: a
        }, 500)
    }
}
function sketchbook_scrolling() {
    $(window).scroll(function () {
        if ($("body").hasClass("sketchbook")) {
            if ($(window).scrollTop() >= 200) folio_page_color(foliodark);
            else folio_page_color(greencol)
        }
    })
}
function folio_page_scrolling() {
    $(window).scroll(function () {
        if ($(window).scrollTop() > 200) cycledownarrow = false;
        if ($(window).scrollTop() >= $("#foliothumbwrapper").offset().top - 700) folio_page_color(greencol);
        else if ($(window).scrollTop() >= 400) folio_page_color(foliodark);
        else folio_page_color(greencol)
    })
}
function handle_down_arrow(a) {
    cycledownarrow = true;
    if (a) $(".arrowdown img").css("opacity", "1");
    else $(".arrowdown img").css("opacity", "0");
    $(".arrowdown a").click(function () {
        if (a) {
            home_exit();
            work_init()
        } else {
            var b = $("#" + $(this).parent().parent().attr("id") + "-2").offset().top - 100;
            $("html,body").animate({
                scrollTop: b
            }, {
                duration: 1100,
                easing: "easeOutQuad"
            })
        }
        cycledownarrow = false;
        return false
    });
    $("#foliofirst").click(function () {
        $(".arrowdown a").trigger("click");
        return false
    });
    setTimeout("cycle_down_arrow()", 1e3);
    if (!a) folio_page_scrolling()
}
function reset_window(a) {
    if (a) window.location.hash = a;
    hide_loader();
    $(window).scrollTop(0);
    $(window).unbind("scroll");
    window_resize();
    $("#main").css("margin-top", 0);
    $("#main").css("padding-top", 66);
    $("#pagetitle p").lettering();
    $(".foliotitle").lettering()
}
function folio_exit() {
    sliding_doors(".top .top", "close");
    sliding_doors(".foliodescwrapper", "close");
    sliding_doors(".arrowdown", "close")
}
function folio_page_init(a) {
    $("#menu a").removeClass("active");
    $("#menuwork").addClass("active");
    show_loader();
    showgrid = true;
    change_body_class("folio");
    $("#main").load(a, function () {
        track_folio_visits(a);
        a = a.replace("./panels/", "");
        a = a.replace(".php", "");
        reset_window(a);
        folio_page_color(greencol);
        sliding_doors(".top .top", "open");
        sliding_doors(".foliodescwrapper", "open");
        handle_down_arrow()
    })
}
function track_folio_visits(a) {
    visitedfolio.push(a);
    $(".folioitem").each(function (a) {
        if ($.inArray($("a", this).attr("href"), visitedfolio) >= 0) {
            $(this).stop().css("left", "0px");
            $(this).animate({
                opacity: .3
            }, pagefadeout)
        }
    });
    if (visitedfolio.length >= $(".folioitem").size()) trackmsg = "Thank you for checking out all of my work";
    else if (visitedfolio.length < $(".folioitem").size() / 2) trackmsg = "Other work you still haven't seen";
    else trackmsg = "A few more items you still haven't seen";
    $("#morework p").text(trackmsg)
}
function folio_triggers() {
    $(".foliotrigger").click(function () {
        var a = $(this).attr("href");
        work_exit();
        setTimeout('folio_page_init("' + a + '")', pagefadein);
        return false
    });
    $(".foliotrigger").mouseenter(function () {
        if (showgrid) {
            $(".grid", this).stop().animate({
                opacity: .7
            }, pagefadein / 3);
            $("p", this).stop().animate({
                opacity: 1
            }, pagefadein / 3)
        }
    });
    $(".foliotrigger").mouseleave(function () {
        if (showgrid) {
            $(".grid", this).stop().animate({
                opacity: 0
            }, pagefadeout / 3);
            $("p", this).stop().animate({
                opacity: 0
            }, pagefadeout / 3)
        }
    })
}
function sliding_doors(a, b) {
    var c = "1";
    var d = "-=25";
    var e = "25px";
    var f = "easeOutCirc";
    var g = 1300;
    var h = 0;
    if (b == "close") {
        c = 0;
        d = "+=25";
        e = "0px";
        f = "easeOutCirc";
        g = 1100
    }
    var i = get_real_width();
    if (i <= 767) {
        $(a).css("opacity", c);
        return
    }
    if (i <= 1024) {
        $(a).animate({
            opacity: c
        }, pagefadein);
        return
    }
    var j = $(a).offset();
    if (j) h = g * ((get_real_width() - j.left) / get_real_width());
    if (h > 600) h = 600;
    if (j) {
        if (j.left <= get_real_width() / 2) {
            $(a).css("position", "relative");
            $(a).css("left", e);
            $(a).animate({
                opacity: c,
                left: d
            }, {
                duration: h,
                easing: f
            })
        } else {
            $(a).css("position", "relative");
            $(a).css("right", e);
            $(a).animate({
                opacity: c,
                right: d
            }, {
                duration: h,
                easing: f
            })
        }
    }
}
function contact_exit() {
    $(".iconiphone").each(function (a) {
        sliding_doors(this, "close")
    });
    $(".contactintro").each(function (a) {
        sliding_doors(this, "close")
    });
    $(".contactcopy").each(function (a) {
        sliding_doors(this, "close")
    })
}
function blog_exit() {}
function blog_init() {
    window.open("http://blog.kennethcachia.com")
}
function contact_init() {
    $("#menu a").removeClass("active");
    $("#menucontact").addClass("active");
    $("#main").animate({
        opacity: 0
    }, pagefadeout, function () {
        show_loader();
        $("#main").load("contact.php", function () {
            reset_window("contact");
            folio_page_color(contactcol);
            change_body_class("contact");
            $(".iconiphone").each(function (a) {
                sliding_doors(this, "open")
            });
            $(".contactintro").each(function (a) {
                sliding_doors(this, "open")
            });
            $(".contactcopy").each(function (a) {
                sliding_doors(this, "open")
            })
        })
    })
}
function about_init() {
    $("#menu a").removeClass("active");
    $("#menuabout").addClass("active");
    $("#main").animate({
        opacity: 0
    }, pagefadeout, function () {
        show_loader();
        $("#main").load("about.php", function () {
            reset_window("about");
            folio_page_color(aboutred);
            change_body_class("about");
            animate_main_div();
            $("p.copy").each(function (a) {
                sliding_doors(this, "open")
            });
            $("p.intro").each(function (a) {
                sliding_doors(this, "open")
            });
            $(".listitems").each(function (a) {
                sliding_doors(this, "open")
            });
            $("#photo").each(function (a) {
                sliding_doors(this, "open")
            })
        })
    })
}
function sketchbook_exit() {
    $("p.intro").each(function (a) {
        sliding_doors(this, "close")
    });
    $(".foliopanel").each(function (a) {
        sliding_doors(this, "close")
    })
}
function sketchbook_init() {
    $("#menu a").removeClass("active");
    $("#menusketchbook ").addClass("active");
    $("#main").animate({
        opacity: 0
    }, pagefadeout, function () {
        show_loader();
        $("#main").load("sketchbook.php", function () {
            reset_window("sketch");
            folio_page_color(greencol);
            change_body_class("sketchbook");
            animate_main_div();
            sketchbook_scrolling();
            $("p.intro").each(function (a) {
                sliding_doors(this, "open")
            });
            $(".foliopanel").each(function (a) {
                sliding_doors(this, "open")
            })
        })
    })
}
function work_init() {
    $("#menu a").removeClass("active");
    $("#menuwork ").addClass("active");
    $("#main").animate({
        opacity: 0
    }, pagefadeout, function () {
        show_loader();
        showgrid = true;
        $("#main").load("work.php", function () {
            reset_window("work");
            folio_page_color(greencol);
            change_body_class("work");
            $("#webborder").fadeIn(300, function () {
                $("#main").css("opacity", 1);
                $(".folioitem").each(function (a) {
                    sliding_doors(this, "open")
                })
            })
        })
    })
}
function about_exit() {
    $("p.copy").each(function (a) {
        sliding_doors(this, "close")
    });
    $("p.intro").each(function (a) {
        sliding_doors(this, "close")
    });
    $(".listitems").each(function (a) {
        sliding_doors(this, "close")
    });
    $("#photo").each(function (a) {
        sliding_doors(this, "close")
    })
}
function work_exit() {
    showgrid = false;
    $(".folioitem").each(function (a) {
        sliding_doors(this, "close")
    })
}
function pattern(a) {
    var b;
    if (!a) {
        b = get_real_width() / 24 * (($(window).height() - 306) / 24);
        if (get_real_width() <= 767) b *= 5
    } else {
        b = get_real_width() / 24 * ($(window).height() / 24)
    }
    $("#main").append('<div class="patternwrap">');
    var c = 0;
    while (c <= b) {
        var d = Math.floor(Math.random() * 10);
        if (d <= 5) $(".patternwrap").append('<div class="pattern pattern1"></div>');
        else $(".patternwrap").append('<div class="pattern pattern2"></div>');
        c++
    }
    $("#main").append("</div>")
}
function home_exit() {
    $("p.copy").each(function (a) {
        sliding_doors(this, "close")
    });
    $("p.intro").each(function (a) {
        sliding_doors(this, "close")
    });
    $(".listitems").each(function (a) {
        sliding_doors(this, "close")
    });
    $(".iconlcd").each(function (a) {
        sliding_doors(this, "close")
    })
}
function animate_main_div() {}
function home_init() {
    $("#menu a").removeClass("active");
    $("#menuhome ").addClass("active");
    $("#main").animate({
        opacity: 0
    }, pagefadeout, function () {
        show_loader();
        $("#main").load("home.php", function () {
            reset_window("home");
            folio_page_color(homecol);
            change_body_class("home");
            animate_main_div();
            $("p.copy").each(function (a) {
                sliding_doors(this, "open")
            });
            $("p.intro").each(function (a) {
                sliding_doors(this, "open")
            });
            $(".listitems").each(function (a) {
                sliding_doors(this, "open")
            });
            $(".iconlcd").each(function (a) {
                sliding_doors(this, "open")
            });
            handle_down_arrow(true);
            $("body.home #aboutbiowrapper").fitVids()
        })
    })
}
function invalid_browsers() {
    $("#main").animate({
        opacity: 0
    }, pagefadeout, function () {
        show_loader();
        $("#main").load("invalidbrowser.php", function () {
            reset_window();
            folio_page_color(greencol);
            change_body_class("error-invalidbrowser");
            animate_main_div()
        })
    })
}
function hide_loader() {
    $("#main").remove(".loader");
    $("#main").removeClass("loading")
}
function show_loader() {
    $("#main").empty();
    $("#main").addClass("loading");
    $("#main").append('<div class="loader"></div>');
    $("#main").css("opacity", "1");
    $(".loader").css("left", get_real_width() / 2 - 16);
    $(".loader").css("top", $(window).height() / 4)
}
function explore_click() {
    $(".iconlcd").unbind("mouseenter");
    $(".iconlcd").unbind("mouseleave");
    $(".iconlcd").unbind("click");
    $(".iconiphone").unbind("mouseenter");
    $(".iconiphone").unbind("mouseleave");
    $(".iconiphone").unbind("click");
    $(".iconipad").unbind("mouseenter");
    $(".iconipad").unbind("mouseleave");
    $(".iconipad").unbind("click");
    home_exit();
    work_init()
}
function explore_out() {
    $("#homeintro3").stop().animate({
        color: "#666"
    }, pagefadeout)
}
function explore() {
    $("#homeintro3").stop().animate({
        color: "#000"
    }, pagefadein)
}
var cycledownarrow = true;
var visitedfolio = new Array;
var activeicon = "";
var pagefadein = 600;
var pagefadeout = 400;
var showgrid = true;
var homecol = "rgb(217, 143, 121)";
var greencol = "rgb(200, 220, 215)";
var contactcol = "rgb(218, 218, 213)";
var aboutred = "rgb(217, 143, 121)";
var foliodark = contactcol;
$(document).ready(function () {
    $(window).resize(function (a) {
        window_resize()
    });
    if (!valid_browsers()) {
        $("header").hide();
        invalid_browsers()
    } else {
        main_menu();
        cache();
        var a = url_params();
        if (!a) start();
        else handle_pages(a)
    }
})
