// JavaScript Documenthttp:
$(document).ready(function(){
    $.extend({
        door_switch:function(obj,classname,obj2){
            $(obj).each(function(i){
                $(this).css('cursor','pointer').mouseover(function(){
                    $(this).addClass(classname).siblings().removeClass();
                    $(obj2).hide();
                    $(obj2).eq(i).show();
                })
            })
        }
    })
    $.door_switch('.repoter_ul_header ul li','active_ul_hearder','.door_reporter_div');
    $.door_switch('.repoter_ul_header ul li','active_ul_hearder','.door_reporter_div');
    $.door_switch('.ul1 li','xs','.d_left');
    $.door_switch('.ul2 li','xs','.d_right');

    $.door_switch('.move_door2_title ul li','active_li','.move_div');
    $.door_switch('.move_door3_title ul li','active_li','.move_div2');

	$.door_switch('.min_door ul li','active_aa','.start_div');
	$.door_switch('.move_door01 li','move_active','.flot01_div_c');
	$.door_switch('.min_door2 ul li','active_aa','.start_div2');
	$.door_switch('.type_lis li','active_li','.type_css_lis');
	$.door_switch('.door_huanul li','active','.door_list');	
	
	$.door_switch('.slh_door li','slh_active','.slh_innerdiv');
	
	$('.reporter_div2 ul li').each(function(i){
		$(this).hover(function(){
			$(this).addClass('list_current');
		},function(){
			$('.reporter_div2 ul li').removeClass();
		})
	})
    if($('.jCarouselLite').length >0){
    	$('.jCarouselLite').jCarouselLite({
    		btnNext: '.left03',
    		btnPrev: '.left04',
    		visible:5,
    		mytop:'35px',
    		myleft:'45px'
    	});
    }
    if($('#min_img').length >0){
    	$('#min_img').jCarouselLite({
    		btnNext: '.imgleft',
    		btnPrev: '.imgright',
    		visible:1,
    		mytop:'-05px',
    		myleft:'60px'
    	});
    }
    if($('.jCarouselLite2').length>0){
    	$('.jCarouselLite2').jCarouselLite({
    		btnNext: '.left03',
    		btnPrev: '.left05',
    		visible:4,
    		mytop:'55px',
    		myleft:'45px'
    	});
    }
    
	if($('.pic_show_div').length>0){
    	$('.pic_show_div').jCarouselLite({
    		btnNext: '.a_left',
    		btnPrev: '.a_right',
    		visible:8,
    		mytop:'0px',
    		myleft:'10px'
    	});
	}
	if($('.pic_show_div2').length > 0){
    	$('.pic_show_div2').jCarouselLite({
    		btnNext: '.a_left',
    		btnPrev: '.a_right',
    		visible:6,
    		mytop:'0px',
    		myleft:'30px'
    	});
	}
	//头部搜索代码
	$('#search_ahref_div').find('a').each(function(i){
		$(this).click(function(){
			$('#tbname').attr('value',$(this).attr('value'));
		});
	});	
	//用户名密码清空操作	 
	 $('.logindiv').find('input[type="text"][name="username"]').focus(function(){
		var flag = true;
		if(flag){
			$(this).attr('value','');
			flag = false;
		}
	 });
	 $('.logindiv').find('input[type="password"][name="password"]').focus(function(){
		var flag = true;
		if(flag){
			$(this).attr('value','');
			flag = false;
		}
	 });
	 $('.loginingys').find('input[type="text"][name="username"]').focus(function(){
		var flag = true;
		if(flag){
			$(this).attr('value','');
			flag = false;
		}
	 });
	 $('.loginingys').find('input[type="password"][name="password"]').focus(function(){
		var flag = true;
		if(flag){
			$(this).attr('value','');
			flag = false;
		}
	 });
	 
    
    $('.fx_01 a img').click(function(){ //点击复制到剪切板分享给好友
        var txt = window.location.href;
        copyToClipboard(txt);
    })
    //$('.user_cz div').attr("style", "width:100%")

		
	
})
function copyToClipboard(txt) {   
    if(window.clipboardData){   
        window.clipboardData.clearData();   
        window.clipboardData.setData("Text", txt);   
    }else if(navigator.userAgent.indexOf("Opera") != -1){   
        window.location = txt;   
    }else if (window.netscape){   
        try{   
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");   
        } catch (e) {   
            alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");   
        }   
        var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);   
        if (!clip){
            return; 
        }  
        var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);   
        if (!trans){
            return; 
        }   
        trans.addDataFlavor('text/unicode');   
        var str = new Object();   
        var len = new Object();   
        var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);   
        var copytext = txt;   
        str.data = copytext;   
        trans.setTransferData("text/unicode",str,copytext.length*2);   
        var clipid = Components.interfaces.nsIClipboard;   
        if (!clip){
            return false; 
        }    
        clip.setData(trans,null,clipid.kGlobalClipboard);  
    }
    alert("复制成功！")
}
		function showGrade(data){
			switch(data){
				case 1:
					document.write('小学一年级');
				break;
				case 2:
					document.write('小学二年级');
				break;
				case 3:
					document.write('小学三年级');
				break;
				case 4:
					document.write('小学四年级');
				break;
				case 5:
					document.write('小学五年级');
				break;
				case 6:
					document.write('小学六年级');
				break;
				case 7:
					document.write('初中一年级');
				break;
				case 8:
					document.write('初中二年级');
				break;
				case 9:
					document.write('初中三年级');
				break;
				case 10:
					document.write('高中一年级');
				break;
				case 11:
					document.write('高中二年级');
				break;
				case 12:
					document.write('高中三年级');
				break;
			}
		}
		
		function showKM(data){
			switch(data){
				case 1:
					document.write('语文'); 
				break;
				case 2:
					document.write('数学');
				break;
				case 3:
					document.write('物理');
				break;
				case 1:
					document.write('化学');
				break;
				case 5:
					document.write('政治');
				break;
				case 6:
					document.write('历史');
				break;
				case 7:
					document.write('地理');
				break;
				case 8:
					document.write('生物');
				break;
				case 9:
					document.write('英语');
				break;
			}
		}
        
        
		




