$(function($) {
    /*****
    * Textbox Setup
    **/
    $('input.textbox').each(function() {
        $(this).val($(this).attr('title'));
    }).focus(function() {
        if ($(this).val() == $(this).attr('title')) {
            $(this).val('');
        }
    }).blur(function() {
        if ($(this).val() == '') {
            $(this).val($(this).attr('title'));
        }
    });
    /**
    * End textbox Setup
    *****/

//    if (window.document.getElementById("ctl00_txtMasterEmail") != null) {
//        var sPath = window.location.pathname;
//        var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
//        if (sPage.toLowerCase() != "signup.aspx") {
//            window.document.getElementById("ctl00_txtMasterEmail").focus();
//        }
//    }




    /*****
    * Click Throughs
    **/
    $('.logo').click(function() {
        window.location = "default.aspx";
    }).css('cursor', 'pointer');
    /**
    * End Click Throughs




  /*****
    * Slideshow setup
    **/
    $('#slideshow').cycle({ fx: 'fade', timeout: 5000 });
    /**
    * End slideshow setup
    *****/




    /*****
    * Setup social links in footer
    **/
    var url = 'myeverywish.com';
    var title = 'My Every Wish - Gift Giving Made Simple';

    var socialId = new Array(
    'ff',
	'in',
	'go',
	'my',
	'mx',
	'or',
	'fb',
	'tu',
	'ya',
	'be',
	'su',
	'di',
	'de',
	'tw'
  );
    var socialName = new Array(
    'friend feed',
    'linked in',
    'google',
    'myspace',
    'mixx',
    'orkut',
    'facebook',
    'tumblr',
    'yahoo',
    'bebo',
    'stumble upon',
    'digg',
    'delicious',
    'twitter'
  );
    var shareLink = new Array(
    'http://friendfeed.com/share?url=' + url + '&title=' + title,
    'http://www.linkedin.com/shareArticle?mini=true&url' + url + '&title=' + title + '&summary=&source=',
    'http://www.google.com/bookmarks/mark?op=edit&bkmk=' + url + '&title=' + title,
    'http://www.myspace.com/Modules/PostTo/Pages/?u=' + url + '&t=' + title,
    'http://www.mixx.com/submit/story?page_url=' + url + '&title=' + title,
    'http://promote.orkut.com/preview?nt=orkut.com&du=' + url + '&tt=' + title + '&cn=',
    'http://www.facebook.com/sharer.php?u=' + url + '&t=' + title,
    'http://www.tumblr.com/share?v=3&u=' + url + '&t=' + title + '&s=',
    'http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&u=' + url + '&t=' + title,
    'http://bebo.com/c/share?Url=' + url + '&Title=' + title,
    'http://www.stumbleupon.com/submit?url=' + url + '&title=' + title,
    'http://digg.com/submit?phase=2&url=' + url + '&title=' + title,
    'http://del.icio.us/post?url=' + url + '&title=' + title,
    'http://twitter.com/home?status=' + title + ' : ' + url
  );

    for (var i = 0; i < socialId.length; i++) {
        $('#social-links').append('<a href="' + shareLink[i] + '" target="_blank" class="social"><img src="images/social/' + socialId[i] + '.jpg" alt="' + socialId[i] + '" /><div class="social-bubble">' + socialName[i] + '</div></a>');
    }

    $('.social').hover(function() {
        $('.social-bubble', this).show();
    }, function() {
        $('.social-bubble', this).hide();
    });
    /**s
    * End social links
    *****/
});
