
  $(window).resize(function(){

	});

 $(document).ready(function(){
		menu();
		elements()
		cabinet_link();
		popup();
		pay_systems();
		pictures();
	});

 function menu(){
	 	$(".menu .menu_table td[class!='border']").hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')});
	 	$(".menu .menu_table td[class!='border']").click(function(){
		    href = $(this).find("a.link").attr('href');
            //window.location = href;
		});
	 }
 function elements(){
		if($(".left_accordion").length) $(".left_accordion").accordion({ header: "span.title", disabled: true, active: 2, event: '' });
		if($(".index_accordion").length) $(".index_accordion").accordion({ header: "span.title" });
		if($(".blue_tabs").length) $(".blue_tabs").tabs();
		if($(".brown_tabs").length) $(".brown_tabs").tabs();
		$(".tabs ul li:has('br')").addClass('line2');
		$(".slider li").click(function(){$(this).addClass('s_show');});
		$(".table tr:even").addClass("even");
		$(".forex_news .f_news:even").addClass("even");
	 }
 function popup(){
		$(".forex_news .f_news span.link").click(function(){
				f_news = $(this).parents(".f_news");
				var title = $(f_news).find('.detail .tit').html();
				var content = $(f_news).find('.detail .cont').html();
				if(title&&content) {
					var pucode ='<div class="popup">'+
									'<div class="p_t"></div>'+
									'<div class="p_bg">'+
										'<div class="p_title"><div>'+title+'</div><span class="close"></span></div>'+
										'<div class="p_cont">'+content+'</div><!-- p_cont -->'+
									'</div>'+
									'<div class="p_b"></div>'
								'</div><!-- popup -->';
					$(f_news).addClass('fn_hover');
					$(f_news).append(pucode);
					show_popup($(f_news).find(".popup"));
					$(f_news).find(".popup .close").click(function(){close_popup($(this).parents(".f_news"))});
				}
			});
	 }
 function show_popup(popup){
	 	d_height = $(document).height();
		if($.browser.msie&&$.browser.version==6) $(popup).css("display","block");
		else $(popup).fadeIn("2000");
		bottom = d_height-$(popup).offset().top - $(popup).height();
		m_t = bottom-10;
		if(bottom<0) $(popup).css('margin-top',m_t+'px')
	  }
 function close_popup(f_news){
	 	popup = $(f_news).find(".popup");
		if($.browser.msie&&$.browser.version==6) $(popup).css("display","none");
		else $(popup).fadeOut("2000");
		$(popup).remove();
		$(popup).css('margin','0')
	 }
 function cabinet_link(){
	 	$(".cabinet_link .open,.cabinet_link .link").click(function(){
				$(this).parents(".cabinet_link").toggleClass('cl_show');
			});
		$(".cabinet_link").hover(function(){},
			function(){
				$(this).removeClass('cl_show');
			});
	 }
 function pay_systems(){
	 	$(".pay_systems .title .open").click(function(){$(this).parents(".title").toggleClass('ps_show')});
		$(".pay_systems .title").hover(function(){},function(){$(this).removeClass('ps_show')});
	 }
 function pictures(){
		if($(".contentdiv img[align=left]").length) $(".contentdiv img[align=left]").addClass('pic_l');
		if($(".contentdiv img[align=right]").length) $(".contentdiv img[align=right]").addClass('pic_r');
	 }
