var byteset = new function()
{
    this.init = function(e)
    {
        var self = this;
        if (! self.isDefined(window, 'supersleight')) {
            window.setInterval(function() {
                    self.swapTagline();
                }, 8000);
        }
        this.search = 'Search...';
        var s = jQuery('#searchbox').attr('value');
        if (s == '') {
            jQuery('#searchbox').attr('value', this.search);
        }
        jQuery('#searchbox').focus(self.searchFocus);
        jQuery('#searchbox').blur(self.searchBlur);
    };

    this.searchFocus = function(e)
    {
       var self = byteset;
        var s = jQuery('#searchbox').attr('value');
        if (s == self.search) {
            jQuery('#searchbox').attr('value', '');
        }
    };

    this.searchBlur = function(e)
    {
        var self = byteset;
        var s = jQuery('#searchbox').attr('value');
        if (s == '') {
            jQuery('#searchbox').attr('value', self.search);
        }
    };

    this.isDefined = function(object, variable)
    {
        return (typeof(eval(object)[variable]) != 'undefined');
    };

    this.swapTagline = function()
    {
        var base = "/wp-content/themes/amore-chan-01";
        var toggle = (jQuery('#tagline').attr('src').search('Webapplication.png') != -1) ? true : false;
        if (toggle) {
            jQuery('#tagline').fadeOut(2000, function() {
                    jQuery('#tagline').attr('src', base + '/images/Engineer.png');
                });
            jQuery('#tagline').fadeIn(1500);
        }
        else {
            jQuery('#tagline').fadeOut(2000, function() {
                    jQuery('#tagline').attr('src', base + '/images/Webapplication.png');
                });
            jQuery('#tagline').fadeIn(1500);
        }
    }
};
jQuery(document).ready(function() {byteset.init();});    

