function gebi(id){
	return top.document.getElementById(id);
}


index={
	isShow:false,
	show:function(){
		if(this.isShow) return;
		this.isShow=true;
		$('#hide-logo-list').css('opacity',0).show().animate({
			opacity:1
		},600);
	},
	moveRight:function(cnt){
		var margin=parseInt($('#logo-list-inner').css('margin-left'));
		var width=$('#logo-list').width();
		var animated=false; var pos=0; var i=0; var j=0; var size=$('#logo-list-inner img').size();
		$('#logo-list-inner img').each(function(){
			if(!animated){
				j++;
				pos=pos+$(this).width()+20;
				if(pos>-margin+width){
					i++;
					if(i>=cnt || size==j){
						$('#logo-list-inner').animate({
							marginLeft:-pos+width
						},200);
						animated=true;
					}
				}
			}
		});

		
		if(!animated){
			var li=$('#logo-list-inner .item:first');
			var li_width=li.width();
			li.remove();
			margin=margin+li_width;
			$('#logo-list-inner').append(li).css('margin-left',margin+'px');
			this.moveRight(cnt);
		}
	},
	
	
	moveLeft:function(cnt){
		var margin=parseInt($('#logo-list-inner').css('margin-left'));
		var width=$('#logo-list').width();
		var animated=false; var pos=0; var final_pos=-1;
		$('#logo-list-inner img').each(function(){
			if(!animated){
				pos=$(this).parent().position().left;
				if(pos<-margin){
					final_pos=pos;
				}
			}
		});
		if(final_pos!=-1){
			$('#logo-list-inner').animate({
				marginLeft:-final_pos
			},200);
		} else {
			var li=$('#logo-list-inner .item:last');
			var li_width=li.width();
			li.remove();
			margin=margin-li_width;
			$('#logo-list-inner').prepend(li).css('margin-left',margin+'px');
			index.moveLeft(cnt);
		}
	}
}

news={
	update:function(year){
		$('.news-arh-link').removeClass('active').addClass('noactive');
		$('#news_content').load('/news/js.html?year='+year);
		$('#news_link_'+year).addClass('active').removeClass('noactive');
	}
}

function xshowForm(){
	$('#o_link').hide();
	$('#o_title').show();
	$('#order_form').show(500);
}

function xhideForm(){
	$('#order_form').hide(500,function(){
		$('#o_link').show();
		$('#o_title').hide();
	});	
	
}

function xtelephone(o){
	if($(o).attr('checked')) $('#phone').show(); else $('#phone').hide();
}
