$(document).ready(function() {
	$("A.thumb, #sidebar A,.leftbox A, .contact-menu A, A.member_th, #writemessage").click(function(e){
		e.preventDefault();
		location.href = "/signup.php";
	});

	$("#moreoptions").click(function(e){
		e.preventDefault();
		if ( !$('#barlistfilter_right').length ) {
			$("#content").prepend('<div id="barlistfilter_right"></div>');
			$('#barlistfilter_right').load('barlistfilter.php', (typeof(browseparams)=='object' ? browseparams : null), function () {
				$('#barlistsubmit').hide();
				$('#barlistfilter_right').height( $('#barlistfilter').height() );
				$('#barlistfilter_right').show();

				$("#barrightform").submit(function(e){
					e.preventDefault();
					location.href = "http://magiclove.hu/signup.php";
				});
				$("#moreoptions").css('background-position','left -13px');
				$("#moreoptions").html(T.feweroptions);
			});
			return false;
		}

		if ( $('#barlistfilter_right').css('display') == 'block'){
			$('#barlistfilter_right').hide();
			$('#barlistsubmit').show();
			$("#moreoptions").html(T.moreoptions);
			$("#moreoptions").css('background-position','left 3px');	
		} else {
			$('#barlistsubmit').hide();
			$('#barlistfilter_right').height( $('#barlistfilter').height() );
			$('#barlistfilter_right').show();
			$("#moreoptions").css('background-position','left -13px');
			
			$("#moreoptions").html(T.feweroptions);
		}
		return false;
	});
});

(function($) {
	$.fn.defaultvalue = function() {
		var elements = this;
		var args = arguments;
		var c = 0;
		return(
			elements.each(function() {
				// Default values within scope
				var el = $(this);
				var def = args[c++];
				el.addClass("greytext");
				el.val(def).focus(function() {
					if(el.val() == def) {
						el.val("");
						el.removeClass("greytext");
					}
					el.blur(function() {
						if(el.val() == "") {
							el.val(def);
							el.addClass("greytext");
						}
					});
				});
				
			})
		);
	}
})(jQuery)

var hs = {};
