function O2(){
	this.arr = function(){
		o = {
			"box"  : ".remindBox",
			"msg"  : "ok",
			"t"  : 1000,
			"s"  : 1000,
			"coor"  : [],
			"info" : "success",
			"defSite" : "false",
			"url"  : ""
		};
		return o;
	}();
	
	this.setArr = function(r){
		for(a in this.arr){
			if(r[a] === undefined){
				r[a] = this.arr[a];
			};
		};
	};
	
	this.info = function(info, arr){
		switch(info){
			case 'success':
				$(arr.box).find("span").removeClass().addClass("success").text(arr.msg);
			break
			
			case 'loading':
				$(arr.box).find("span").removeClass().addClass("loading").text(arr.msg);
			break
			
			case 'error':
				$(arr.box).find("span").removeClass().addClass("error").text(arr.msg);
			 break
			 
			default:
				return false;
		};
	};
};

O2.prototype.remindDef = function(r){
	var arr = {};
		
	if(arguments.length != 0){ this.setArr(r); arr = r; } else { arr = this.arr; };
	
	var setBox = "<div class='remindBox'><div class='remContent'><span></span></div></div>";
	
	$("body").append(setBox);
	
	var _remBox = $(arr.box);
	
	if(arr.defSite == "false")
	{
		var H = $(window).height(),
			W = $(window).width(),
			w = _remBox.width(),
			h = _remBox.height();
			
		_remBox.css({"left": W/2 - w/2 + "px", "top": H/2 - h + $(window).scrollTop() + "px"});
		
	} else {
		
		_remBox.addClass("lit").css({"left": arr.coor[0] - 30 + 'px', "top": arr.coor[1] + 10 + 'px'});
	};
	
	this.info(arr.info, arr);
	
	_remBox.animate({opacity: 1}, 300, function(){
		if(arr.info != "loading"){
			$(this).delay(arr.t).animate({opacity: 0}, 500, function(){
				$(this).remove();
				if(arr.url != ""){
					window.location.href = arr.url;
				};
			});
		};
	});
};

O2.prototype.returned = function(r){
	var arr = {},
		_this = this;
	
	if(arguments.length != 0){ this.setArr(r); arr = r; } else { arr = this.arr; };
	
	var _remBox = $(arr.box);
	
	setTimeout(function(){
		_this.info(arr.info, arr);
		
		_remBox.delay(arr.t).animate({opacity: 0}, 500, function(){
			$(this).remove();
			if(arr.url != ""){
				window.location.href = arr.url;
			};
		});
	}, arr.s);
};

var O = new O2();

$(function(){
	$(".line-last").each(function(){
		$(this).find("a:last").css("background-image","none");
	});
});
