﻿$(document).ready(function() { PEPS.rollover.init() }); PEPS = {};
PEPS.rollover = { init: function() { this.preload(); $(".ro").hover(function() { $(this).attr("src", PEPS.rollover.newimage($(this).attr("src"))) }, function() { $(this).attr("src", PEPS.rollover.oldimage($(this).attr("src"))) }) }, preload: function() { $(window).bind("load", function() { $(".ro").each(function(c, h) { $("<img>").attr("src", PEPS.rollover.newimage($(this).attr("src"))) }) }) }, newimage: function(c) { return c.substring(0, c.search(/(\.[a-z]+)$/)) + "_o" + c.match(/(\.[a-z]+)$/)[0] }, oldimage: function(c) {
    return c.replace(/_o\./,
".")
} 
};
$(document).ready(function() {
    scrollMore();
    
    $("#ServicesName").focus(function() {
        $(this).filter(function() {
            return $(this).val() == "" || $(this).val() == "Name/Company"
        }).removeClass("watermarkOn").val("");
    });

    $("#ServicesName").blur(function() {
        $(this).filter(function() {
            return $(this).val() == ""
        }).addClass("watermarkOn").val("Name/Company");
    });

    $("#ServicesEmail").focus(function() {
        $(this).filter(function() {
            return $(this).val() == "" || $(this).val() == "Email/Phone Number"
        }).removeClass("watermarkOn").val("");
    });

    $("#ServicesEmail").blur(function() {
        $(this).filter(function() {
            return $(this).val() == ""
        }).addClass("watermarkOn").val("Email/Phone Number");
    });

    $("#ServicesQuestions").focus(function() {
        $(this).filter(function() {
            return $(this).val() == "" || $(this).val() == "Reasonable explanation as to why and how you want us to make you awesome"
        }).removeClass("watermarkOn").val("");
    });

    $("#ServicesQuestions").blur(function() {
        $(this).filter(function() {
            return $(this).val() == ""
        }).addClass("watermarkOn").val("Reasonable explanation as to why and how you want us to make you awesome");
    });
    $("#Search").focus(function() { $(this).filter(function() { return $(this).val() == "" || $(this).val() == "Search" }).removeClass("watermarkOn").val("") }); $("#Search").blur(function() { $(this).filter(function() { return $(this).val() == "" }).addClass("watermarkOn").val("Search") }); $("#Name").focus(function() { $(this).filter(function() { return $(this).val() == "" || $(this).val() == "Name" }).removeClass("watermarkOn").val("") }); $("#Name").blur(function() { $(this).filter(function() { return $(this).val() == "" }).addClass("watermarkOn").val("Name") });
    $("#Email").focus(function() { $(this).filter(function() { return $(this).val() == "" || $(this).val() == "Email/Phone" }).removeClass("watermarkOn").val("") }); $("#Email").blur(function() { $(this).filter(function() { return $(this).val() == "" }).addClass("watermarkOn").val("Email/Phone") }); $("#Questions").focus(function() { $(this).filter(function() { return $(this).val() == "" || $(this).val() == "Questions, comments or just about anything..." }).removeClass("watermarkOn").val("") }); $("#Questions").blur(function() {
        $(this).filter(function() {
            return $(this).val() ==
""
        }).addClass("watermarkOn").val("Questions, comments or just about anything...")
    }); $("#Address").focus(function() { $(this).filter(function() { return $(this).val() == "" || $(this).val() == "Enter your address" }).removeClass("watermarkOn").val("") }); $("#Address").blur(function() { $(this).filter(function() { return $(this).val() == "" }).addClass("watermarkOn").val("Enter your address") })
});
(function(c) {
    c.fn.tweet = function(h) {
        var a = { username: ["seaofclouds"], avatar_size: null, count: 3, intro_text: null, outro_text: null, join_text: null, auto_join_text_default: "i said,", auto_join_text_ed: "i", auto_join_text_ing: "i am", auto_join_text_reply: "i replied to", auto_join_text_url: "i was looking at", loading_text: null, query: null }; c.fn.extend({ linkUrl: function() {
            var b = [], d = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi; this.each(function() { b.push(this.replace(d, '<a href="$1">$1</a>')) });
            return c(b)
        }, linkUser: function() { var b = [], d = /[\@]+([A-Za-z0-9-_]+)/gi; this.each(function() { b.push(this.replace(d, '<a href="http://twitter.com/$1">@$1</a>')) }); return c(b) }, linkHash: function() { var b = [], d = / [\#]+([A-Za-z0-9-_]+)/gi; this.each(function() { b.push(this.replace(d, ' <a href="http://search.twitter.com/search?q=&tag=$1\u00e2\u008c\u00a9=all&from=' + a.username.join("%2BOR%2B") + '">#$1</a>')) }); return c(b) }, capAwesome: function() {
            var b = []; this.each(function() {
                b.push(this.replace(/(a|A)wesome/gi,
"AWESOME"))
            }); return c(b)
        }, capEpic: function() { var b = []; this.each(function() { b.push(this.replace(/(e|E)pic/gi, "EPIC")) }); return c(b) }, makeHeart: function() { var b = []; this.each(function() { b.push(this.replace(/[<]+[3]/gi, "<tt class='heart'>\u00e2\u0099\u00a5</tt>")) }); return c(b) } 
        }); function l(b) {
            var d = Date.parse(b), i = arguments.length > 1 ? arguments[1] : new Date; d = parseInt((i.getTime() - d) / 1000); return d < 60 ? "less than a minute ago" : d < 120 ? "about a minute ago" : d < 2700 ? parseInt(d / 60).toString() + " minutes ago" :
d < 5400 ? "about an hour ago" : d < 86400 ? "about " + parseInt(d / 3600).toString() + " hours ago" : d < 172800 ? "1 day ago" : parseInt(d / 86400).toString() + " days ago"
        } h && c.extend(a, h); return this.each(function() {
            var b = c('<ul class="tweet_list">').appendTo(this), d = '<p class="tweet_intro">' + a.intro_text + "</p>", i = '<p class="tweet_outro">' + a.outro_text + "</p>", k = c('<p class="loading">' + a.loading_text + "</p>"); if (typeof a.username == "string") a.username = [a.username]; var g = ""; if (a.query) g += "q=" + a.query; g += "&q=from:" + a.username.join("%20OR%20from:");
            g = "http://search.twitter.com/search.json?&" + g + "&rpp=" + a.count + "&callback=?"; a.loading_text && c(this).append(k); c.getJSON(g, function(m) {
                a.loading_text && k.remove(); a.intro_text && b.before(d); c.each(m.results, function(f, e) {
                    f = a.join_text == "auto" ? e.text.match(/^(@([A-Za-z0-9-_]+)) .*/i) ? a.auto_join_text_reply : e.text.match(/(^\w+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+) .*/i) ? a.auto_join_text_url : e.text.match(/^((\w+ed)|just) .*/im) ? a.auto_join_text_ed : e.text.match(/^(\w*ing) .*/i) ? a.auto_join_text_ing :
a.auto_join_text_default : a.join_text; f = '<span class="tweet_join"> ' + f + " </span>"; f = a.join_text ? f : " "; var j = '<a class="tweet_avatar" href="http://twitter.com/' + e.from_user + '"><img src="' + e.profile_image_url + '" height="' + a.avatar_size + '" width="' + a.avatar_size + '" alt="' + e.from_user + '\'s avatar" border="0"/></a>'; j = a.avatar_size ? j : ""; var n = '<a href="http://twitter.com/' + e.from_user + "/statuses/" + e.id + '" title="view tweet on twitter">' + l(e.created_at) + "</a>"; e = '<span class="tweet_text">' + c([e.text]).linkUrl().linkUser().linkHash().makeHeart().capAwesome().capEpic()[0] +
"</span>"; b.append("<li>" + j + n + f + e + "</li>"); b.children("li:first").addClass("tweet_first"); b.children("li:odd").addClass("tweet_even"); b.children("li:even").addClass("tweet_odd")
                }); a.outro_text && b.after(i)
            })
        })
    }
})(jQuery);
function scrollMore() {
    jQuery("body").prepend('<span id="scrollMore">Scroll for More <em>&darr;</em></span>');

    if (jQuery('#scrollMore').css('position') == 'absolute') {
        jQuery('#scrollMore').hide();
    }
    else {
        jQuery(window).scroll(function() {
            var opacity = 1.3 - (jQuery(window).scrollTop() / 750);
            if (opacity > 1) opacity = 1;
            if (opacity < 0) opacity = 0;
            jQuery('#scrollMore').fadeTo(200, opacity);
        });

        jQuery('#scrollMore').click(function() {
            jQuery('html,body').animate({ scrollTop: jQuery(window).scrollTop() + 400 + 'px' }, 300);
        }).hover(function() {
            jQuery(this).fadeTo(200, 1);
        });
    }
}
