jQuery(function($) {
	$.fn.search = function() {
		return this.focus(function() {
			if( this.value == this.defaultValue ) {
				this.value = "";
			}
		}).blur(function() {
			if( !this.value.length ) {
				this.value = this.defaultValue;
			}
		});
	};
	$(".s").search();
});

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};
/* jQuery UI functions */
/* Current issue editorial hover */
$(document).ready(function(){
	$("#latest").hover(
	  function () {
		$(this).addClass("latest_ovr");
	  },
	  function () {
		$(this).removeClass("latest_ovr");
	  }
	);
});

$(document).ready(function(){
	$(".review-item").hover(
	  function () {
		$(this).addClass("review-ovr");
	  },
	  function () {
		$(this).removeClass("review-ovr");
	  }
	);
// Easy Pullquotes by Mike Jolley
			// Go through each span element with a classname of "pullquote"
	$('span.pullquote').each(function() {
					// Get the text of the span
		text = $(this).text();
					// Get rid of unwanted charactors
		text=text.replace( /\((.*)\)/gi, " " );
					// Check if this is to be a right or left pull quote and output it
		if ($(this).is(".right")) 
			$(this).parent().before('<blockquote class="pullquote right"><p>'+ text +'</p></blockquote>');
		else
			$(this).parent().before('<blockquote class="pullquote"><p>'+ text +'</p></blockquote>');
	});
			// End pull quote code
});
// module tabs for feature blok
$(function() {
		//$("#feature").tabs();
		$('#feature').tabs({ cookie: { expires: 30 } });

	});
