//menu

$(document).ready(function(){
	$('.bottomnav a:last').css('border',0);
	$('.news_list li:odd').addClass('newseven');
	//index-product
	$('.productli li a').hover(function(){
		$(this).children('p').stop(true,true).slideDown()
		},function(){
		$(this).children('p').stop(true,true).slideUp()
	})
//menu
	$('.teacher li').eq(1).addClass('mtwo');
	$(".viewcon").find("img").each(function(index, element) {
        if($(this).width() > 950) {
			$(this).css({"height":"auto","width":"100%"});
		}
    });

	 $('.codepic').hover(function(){$('.code').fadeIn()},function(){$('.code').fadeOut()});
    $('.backup,.topbut').click(function(){
        $('body,html').animate({scrollTop:0},500)
    });
    $(".backup").hide();
    $(function () {
        $(window).scroll(function(){
            if ($(window).scrollTop()>500){
                $(".backup").fadeIn(1000);
            }else{
                $(".backup").fadeOut(1000);
            }
        })
   })
/*	$('.nav').each(function(index, element) {
		$(this).children('a').last().css('border',0)
    });
	$('.proTwo li').last().each(function(index, element) {
		$(this).children('a').css('border',0)
    });
*/	
//banner
var p=1;
var banner=$('#ul01');
var w=Math.round(($("#ul01 li").width()/$(window).width())*100);
var isIE=!!window.ActiveXObject;
var isIE6=isIE&&!window.XMLHttpRequest;
if (isIE){
if (isIE6){
w=w+1;
}
}
var bannernum=$('#ul01 li').length;
banner.width();
var newW=bannernum*100+'%';
$('#ul01').css('width',newW);
var liW=(100/bannernum)+'%';
$('#ul01 li').css('width',liW);

$('#left').bind('click',leftbut);
$('#right').bind('click',rightbut);
//index;
function leftbut(){
		if(p==1){
			$('.slider a:first').addClass('end');
		}else{
			$('.slider a:last').removeClass('end');
			banner.animate({ 'margin-left' : '+='+w+'%' }, "slow");
			p--;
		}
}
function rightbut(){
		if(p == bannernum){
			$('.slider a:last').addClass('end');
		}else{
			$('.slider a:first').removeClass('end');
			banner.animate({ 'margin-left' : '-='+w+'%' }, "slow");
			p++;
		}
}

  });

