var custom = {
	
	global : new Array(),
	
	init_timer:function(){
		var h = $("#h_1").text() + $("#h_2").text() ;
		var m = $("#m_1").text() + $("#m_2").text() ;
		var s = $("#s_1").text() + $("#s_2").text() ;
		
		f = true;
		setInterval(function(){
			
			if (f)
				{
				s = s-1;
				if (s < 0)
					{
					s = 59;
					m = m - 1;
					if (m < 0)
						{
						m = 59;
						h = h - 1;
						
						if (h >=0)
							{
							h = h + "";
							var x = h.split('');
							if (x.length == 1)
								{
								x[1] = x[0];
								x[0] = "0";
								}
							
							$("#h_1").text(x[0]);
							$("#h_2").text(x[1]);
							}
						else 
							{
							f = false;
							$("#main_counter").hide();
							$("#play_but").show();
							}
						}
					m = m + "";
					var x = m.split('');
					if (x.length == 1)
						{
						x[1] = x[0];
						x[0] = "0";
						}
					
					if (f)
						{
						$("#m_1").text(x[0]);
						$("#m_2").text(x[1]);
						}
					}
				
				s = s + "";
				var x = s.split('');
				if (x.length == 1)
					{
					x[1] = x[0];
					x[0] = "0";
					}
				
				if (f)
					{
					$("#s_1").text(x[0]);
					$("#s_2").text(x[1]);
					}
				}
		} , 970 , h,m,s ,f);
	},
	
	init_pop:function(adr){
		
		var overlay = "<div class='overlay'></div>";
		var pop_up = "<div class='pop_up'></div>";
		
		$.get("/" + adr , function (data){
			
			$("body").append(overlay);
			$("body").append(pop_up);
			
			$(".pop_up").html(data);
			
			$(".overlay").animate({"opacity" : "0.1"} , 300);
			$(".pop_up").animate({"opacity" : "1"} , 300);
			$(".overlay , .pop_up .close").click(function(){
				custom.close_pop();
			})
		})		
	
	},
	
	close_pop:function(){
		$(".overlay,.pop_up").animate({"opacity" : 0} , 300 , function(){
			$(this).remove();
		})
	},
	
	open_tab:function(obj){
		$(".one_tab").removeClass("active");
		if (obj.attr("class") != "add_friend")
			{
			obj.addClass("active");
			}
		else $(".one_tab[href='#search']").addClass("active");
		
		$(".personal").hide();
		var adr = obj.attr("href");
		
		$(adr).show();
	}
}



