var login_thickbox = {
    
    jQuery : $,

    init : function () {
		var obj = this;
		obj.add_event();
    },
	 
	add_event : function () {
		// close a iframe
		if ($(".login_form").length == 0) {
			if (id_element == '') {
				parent.location.href = parent.location;
			} else {
				parent.location.href = parent.location+'?thickbox_next='+id_element;
			}
			setTimeout(function() {
				self.parent.tb_remove();
			}, 2000);
		}

		$('.button').click(function() {
			$(this).unbind();
			$(this).click(function(){
				alert('Please only click the login button once.');
				return false;
			})
			$('.login_form').submit();
    		return false;
    	});
	}

};

login_thickbox.init();

