﻿// JavaScript Document
//document.domain="jxjyzy.com";
function Login()
{
	var url = geturl()+"../WebService/LoginService.svc/";
	var	param='{"account":"'+document.getElementById("labAccount").value+'","password":"'+document.getElementById("labPwd").value+'"}';
    Call(url,"LoginIn",param,OnLoginResult);
}
function OnLoginResult(result)
{
	if(result==1)			
    	  	{
	    	var Type="",Account,UserID,Licence,Name,Pwd,Point="",MsgCount="",EmailCount="";
			var cook=readCookieEx("jxjyzy");
			if(cook!=null && cook!="")
			{			
				var arr=cook.split("&");
				for(var i=0;i<arr.length;i++)
				{
					var xx=arr[i].split("=");
					if(xx[0]=="Account")
					{
						Account=xx[1];
						continue;
					}
					if(xx[0]=="UserID")
					{
						UserID=xx[1];
						continue;
					}
					if(xx[0]=="Name")
					{
						Name=xx[1];
						continue;
					}
					if(xx[0]=="Pwd")
					{
						Pwd=xx[1];
						continue;			
					}
					if(xx[0]=="Licence")
					{
						Licence=xx[1];
						continue;
					}
					if(xx[0]=="Point")
					{
						Point=xx[1];
						continue;
					}
					if(xx[0]=="EmailCount")
					{
						EmailCount=xx[1];
						continue;
					}
					if(xx[0]=="MsgCount")
					{
						MsgCount=xx[1];
						continue;
					}
					if(xx[0]=="Type")
					{
						Type=xx[1];					;
						continue;
					}
				}
				if(Type=="1")
				{
				    var s="";
					s+="<div id='loginin'style='padding-top:4px'> 欢迎您!<font color=\"#FF0000\"><strong>"+Account+"</strong></font> 威望值:<font color=\"#FF0000\">"+Point+"</font> ";
					s+="短信(<a href=\""+geturl()+"User/UserInnerMessageList.aspx?Status=Receive\"><font color=\"#0000FF\">"+MsgCount+"</font></a>)<font color=\"#CCCCCC\">|</font> 邮件<a href=\""+geturl()+"EMail/EMailLogin.aspx?ReturnUrl=http://mail.jxjyzy.com/webmailgov/mail.jsp\"><font color=\"#0000FF\">"+EmailCount+"</font></a><font color=\"#CCCCCC\">|</font> <a href=\""+geturl()+"User/Index.aspx\">会员中心</a><font color=\"#CCCCCC\">|</font> <a href=\""+geturl()+"User/UserResEdit.aspx?EditMode=False\">上传资源</a><font color=\"#CCCCCC\">|</font> <a href=\"http://bbs.jxjyzy.com/space/\">我的博客</a><font color=\"#CCCCCC\">|</font> <a href=\"http://bbs.jxjyzy.com/showalbumlist.aspx?uid="+UserID+"\">我的相册</a><font color=\"#CCCCCC\">|</font> <a href=\"javascript:LoginOut();\">退出</a></div>";
				    document.getElementById("loginin").innerHTML=s;


				}
	        }
	  }
		
	if(result==-1)			
    	alert("登录失败");
    	 if(result==-2)			
    	alert("验证码输入错误！");
}
function LoginOut()
{
	var url =  geturl()+"../WebService/LoginService.svc/";
	param='';
	Call(url,"LoginOut",param,OnLoginOutResult);
	window.location="http://www.jxjyzy.com/"
}
function OnLoginOutResult(result)
{
	if(result==1)
	{
					var s="";
		    		s+="<div id='loginin'>用户名<label><input name='labAccount' type='text' class='login_input' id='labAccount' size='12'/></label>";
				    s+="密　码<label><input name='labPwd' type='password' class='login_input' id='labPwd' size='12' /></label>";
				    //s+="验证码<label><input name='labCode' type='text' class='login_input' id='labCode' size='8' /></label>";
				    //s+="<input type='image' src='http://www.jxjyzy.com/Login/ValidateImage.aspx' align='absmiddle' style=' width:35px; height:19px;'  border='0' value='验证码' />";
				    s+="<input name='Submit' type='image' onclick='Login();' id='Submit' value='提交' src='http://img.jxjyzy.com/images/login_buttonnew.gif' align='absmiddle'/>";
				    s+="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='"+geturl()+"login/Register.aspx'>新用户注册</a>&nbsp;&nbsp;<a href='"+geturl()+"login/GetPassword.aspx'>&nbsp;&nbsp;找回密码</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='"+geturl()+"Help/Help.aspx?HelperID=14'>忘记用户名</a></div>";				
					document.getElementById("loginin").innerHTML=s;
	}
}
			function geturl(){
  if (!top.gAbsolutePath){
		var loc = document.location;
		top.protocal = loc.protocol;
		top.host = loc.host;
		top.hostname = loc.hostname;
		top.port = loc.port;
		top.gAbsolutePath = top.protocal + "//" + top.host + (top.port != '' ? ':' + top.port : '') 
  }
  top.path = top.gAbsolutePath;
  return top.gAbsolutePath + "//";
}
		function getfullurl()
		{
			var loc = document.location;
			var path=loc.pathname.substr(loc.pathname.indexOf('/')+1, loc.pathname.lenght).replace("//","/");
		  	return path;
		}
		function readCookie(name)		
		{		
		  var cookieValue = "";		
		  var search = name + "=";		
		  if(document.cookie.length > 0)		
		  { 		
			offset = document.cookie.indexOf(search);		
			if (offset != -1)		
			{ 		
			  offset += search.length;		
			  end = document.cookie.indexOf(";", offset);		
			  if (end == -1) end = document.cookie.length;		
			  cookieValue = decodeURI(document.cookie.substring(offset, end));		
			}		
		  }		
		  return cookieValue;		
		};
		function readCookieEx(name)
		{
		  var cookieValue = "";
		  var search = name + "=";
		  if(document.cookie.length > 0){ 		
			offset = document.cookie.indexOf(search);		
			if (offset != -1)		
			{ 		
			  offset += search.length;		
			  end = document.cookie.indexOf(";", offset);		
			  if (end == -1) end = document.cookie.length;		
			  cookieValue = decodeURI(document.cookie.substring(offset, end));		
			}		
		  }		
		  return cookieValue;		
		};
		function Deletecookie (name) 
		{  
			var exp = new Date();    
			exp.setTime (exp.getTime() - 1);    
			var cval = readCookie (name);    
			document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();  
		}  
				function ContentSize(size)
		{
			var obj=document.all.Content;
			obj.style.fontSize=size+"px";
		}
		function Head()
		{
	
			var cook=readCookieEx("jxjyzy");
			if(cook!=null && cook!="")
			{
				var Type="",Account,UserID,Licence,Name,Pwd,Point="",MsgCount="",EmailCount="";
				var arr=cook.split("&");
				for(var i=0;i<arr.length;i++)
				{
					var xx=arr[i].split("=");
					if(xx[0]=="Account")
					{
						Account=xx[1];
						continue;
					}
					if(xx[0]=="UserID")
					{
						UserID=xx[1];
						continue;
					}
					if(xx[0]=="Name")
					{
						Name=xx[1];
						continue;
					}
					if(xx[0]=="Pwd")
					{
						Pwd=xx[1];
						continue;			
					}
					if(xx[0]=="Licence")
					{
						Licence=xx[1];
						continue;
					}
					if(xx[0]=="Point")
					{
						Point=xx[1];
						continue;
					}
					if(xx[0]=="EmailCount")
					{
						EmailCount=xx[1];
						continue;
					}
					if(xx[0]=="MsgCount")
					{
						MsgCount=xx[1];
						continue;
					}
					if(xx[0]=="Type")
					{
						Type=xx[1];	
						continue;
					}
				}
				if(Type=="1")
				{				
					document.writeln("    <div id='loginin'style='padding-top:4px'> 欢迎您!<font color=\"#FF0000\"><strong>"+Account+"</strong></font> 威望值:<font color=\"#FF0000\">"+Point+"</font> ");
					document.writeln("    短信<a href=\""+geturl()+"User/UserInnerMessageList.aspx?Status=Receive\"><font color=\"#0000FF\">("+MsgCount+")</font></a><font color=\"#CCCCCC\">|</font> 邮件<a href=\""+geturl()+"EMail/EMailLogin.aspx?ReturnUrl=http://mail.jxjyzy.com/webmailgov/mail.jsp\"><font color=\"#0000FF\">"+EmailCount+"</font></a><font color=\"#CCCCCC\">|</font> <a href=\""+geturl()+"User/Index.aspx\">会员中心</a><font color=\"#CCCCCC\">|</font> <a href=\""+geturl()+"User/UserResEdit.aspx?EditMode=False\">上传资源</a><font color=\"#CCCCCC\">|</font> <a href=\"http://bbs.jxjyzy.com/space/\">我的博客</a><font color=\"#CCCCCC\">|</font> <a href=\"http://bbs.jxjyzy.com/showalbumlist.aspx?uid="+UserID+"\">我的相册</a><font color=\"#CCCCCC\">|</font> <a href=\"javascript:LoginOut();\">退出</a></div>");
				}
				else
				{
					Deletecookie("jxjyzy");
					document.writeln("    <div id='loginin'>用户名<label><input name=\"labAccount\" type=\"text\" class=\"login_input\" id=\"labAccount\" size=\"12\"/></label>");
					document.writeln("    密　码<label><input name=\"labPwd\" type=\"password\" class=\"login_input\" id=\"labPwd\" size=\"12\" /></label>");
					//document.writeln("    验证码<label><input name=\"labCode\" type=\"text\" class=\"login_input\" id=\"labCode\" size=\"8\" /></label>");
					//document.writeln("    <input type=\'image\' src='http://www.jxjyzy.com/Login/ValidateImage.aspx\' align=\'absmiddle\' style=\" width:35px; height:19px;\"  border=\'0\' value=\'验证码\' />");
					document.writeln("    <input name=\"Submit\" type=\"image\" onclick=\'Login();\' id=\"Submit\" value=\"提交\" src='http://img.jxjyzy.com/images/login_buttonnew.gif' align=\"absmiddle\"/>");
					document.writeln("    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='"+geturl()+"login/Register.aspx\'>新用户注册</a>&nbsp;&nbsp;<a href='"+geturl()+"login/GetPassword.aspx\'>&nbsp;&nbsp;找回密码</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='"+geturl()+"Help/Help.aspx?HelperID=14\'>忘记用户名</a></div>");
				}
			}
			else
			{
				document.writeln("    <div id='loginin'>用户名<label><input name=\"labAccount\" type=\"text\" class=\"login_input\" id=\"labAccount\" size=\"12\"/></label>");
				document.writeln("    密　码<label><input name=\"labPwd\" type=\"password\" class=\"login_input\" id=\"labPwd\" size=\"12\" /></label>");
				//document.writeln("    验证码<label><input name=\"labCode\" type=\"text\" class=\"login_input\" id=\"labCode\" size=\"8\" /></label>");
				//document.writeln("    <input type=\'image\' src='http://www.jxjyzy.com/Login/ValidateImage.aspx\' align=\'absmiddle\' style=\" width:35px; height:19px;\"  border=\'0\' value=\'验证码\' />");
				document.writeln("    <input name=\"Submit\" type=\"image\" onclick=\'Login();\' id=\"Submit\" value=\"提交\" src='http://img.jxjyzy.com/images/login_buttonnew.gif' align=\"absmiddle\"/>");
				document.writeln("    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='"+geturl()+"login/Register.aspx\'>新用户注册</a>&nbsp;&nbsp;<a href='"+geturl()+"login/GetPassword.aspx\'>&nbsp;&nbsp;找回密码</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='"+geturl()+"Help/Help.aspx?HelperID=14\'>忘记用户名</a></div>");
			}
		}

function Header()
{
	document.writeln("  <!--header start-->");
	document.writeln("  <div id=\"header\">");
	document.writeln("    <!--登录-->");
	document.writeln("    <div id=\"login\" style=\"padding-left:10px;padding-top:5px;background-image:url(http://img.jxjyzy.com/images/login_bg_new.jpg);height:28px;text-align:left;\">");
	document.writeln("    <span id=\"header_map_link\"><img src='http://img.jxjyzy.com/images/setindex.gif' width=\"13\" height=\"11\" /><a onclick=\'javascript:addHome()\' href=\'http://www.jxjyzy.com/#\'>设为首页</a>&nbsp;&nbsp;&nbsp;&nbsp;<img src='http://img.jxjyzy.com/images/map.gif' width=\"13\" height=\"11\" /><a href=\"/sitemap.htm\">网站地图</a></span>");
	document.writeln("    <SCRIPT language=JavaScript type=text/javascript>Head();</SCRIPT>");
	document.writeln("    </div>");
	document.writeln("    <!--网站logo-->");
	document.writeln("    <div id=\"logo\"><a href=\"http://www.jxjyzy.com\"><img src='http://img.jxjyzy.com/images/logonew.gif' alt=\"江西省基础教育网logo\" width=\"345\" height=\"74\" /></a></div>");
	document.writeln("    <!--头部导航-->");
	document.writeln("    <div id=\"nav\">");
	document.writeln("    <ul>");
	document.writeln("        <li><a href=\"/TeacherTraining/Default.htm\"><font color=\"#FF0000\"><strong>培训</strong></font></a></li>");
	document.writeln("        <li><a href=\"/Activity/default.htm\"><font color=\"#FF0000\"><strong>活动</strong></font></a></li>");
	document.writeln("        <li><a href=\"http://bbs.jxjyzy.com/\"><font color=\"#FF0000\"><strong>论坛</strong></font></a></li>");
	document.writeln("        <li><a href=\"http://bbs.jxjyzy.com/spaceindex.aspx\">博客</a></li>");
	document.writeln("        <li><a href=\"http://bbs.jxjyzy.com/albumindex.aspx\">相册</a></li>");
	document.writeln("        <li><a href=\"/EMail/EMailLogin.aspx?ReturnUrl=http://mail.jxjyzy.com/webmailgov/mail.jsp\">邮箱</a></li>");
	document.writeln("        <li id=\"four\"><strong><a href=\"/TeacherChoose/ActivityIndex.aspx\"><font color=\"#FF0000\">课程建设</font></a></strong></li>");
	document.writeln("        <li id=\"four\"><a href=\"http://man.jxjyzy.com/login/login.aspx\"><font color=\"#FF0000\">管理入口</font></a></li>");
	document.writeln("        <li id=\"other\" style='width:49px;padding:0px 4px 0px 4px;'><a href=\"/Categories/ResourceByGrade.html\">资源分类</a></li>");
	document.writeln("        <li id=\"five\" style='width:85px;padding:0px;'><a href=\"/EnglishProject/index.htm\"><font color=\"green\"><b>学生学习专栏</b></font></a></li> ");
	document.writeln("    </ul>");
	document.writeln("    <ul>");
	document.writeln("        <li><a href=\"/Resource/Search.htm\">资源</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/Detail_New_154_72.html\">素材</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/Detail_New_153_72.html\">课件</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/Detail_New_152_72.html\">教案</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/Detail_New_151_72.html\">试题</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/Detail_New_155_72.html\">文章</a></li>");
	document.writeln("        <li id=\"four\"><a href=\"/Coursehtml/JingPin.html\">精品课程</a></li>");
	document.writeln("        <li id=\"four\"><a href=\"/Coursehtml/TongBu.html\">同步课堂</a></li>");
	document.writeln("        <li id=\"four\"><a href=\"/Coursehtml/JingSai.html\">竞赛活动</a></li>");
	document.writeln("        <li id=\"four\"><a href=\"/Coursehtml/DiEr.html\">第二课堂</a></li>");
	document.writeln("    </ul> ");
	document.writeln("    <ul>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_72.html\">语文</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_81.html\">数学</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_73.html\">英语</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_88.html\">物理</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_89.html\">化学</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_90.html\">生物</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_80.html\">政治</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_86.html\">历史</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_87.html\">地理</a></li>");
	document.writeln("        <li><a href=\"/ResourceHtml/New_163.html\">综合</a></li>");
	document.writeln("        <li><a href=\"/Resource/Search.htm?SearchType=Name&amp;_t=1&amp;Content=%E4%B8%AD%E8%80%83&amp;Hidden=中考&amp;ClassID=-1&amp;SegmentID=-1&amp;GradeID=-1&amp;SubjectID=-1&amp;FormatParentID=-1&amp;Submit.x=0&amp;Submit.y=0\">中考</a></li>");
	document.writeln("        <li><a href=\"/Resource/Search.htm?SearchType=Name&amp;_t=1&amp;Content=%25E9%25AB%2598%25E8%2580%2583&Hidden=%E9%AB%98%E8%80%83&amp;ClassID=-1&amp;SegmentID=-1&amp;GradeID=-1&amp;SubjectID=-1&amp;FormatParentID=-1&amp;Submit.x=0&amp;Submit.y=0\">高考</a></li>");
	document.writeln("    </ul> ");
	document.writeln("    </div>");
	document.writeln("  </div>");
	document.writeln("  <!--header end--> ");
}
		
//加为收藏
function addFav()
{
window.external.AddFavorite('http://www.jxjyzy.com',' ');
}
function addAnnounceFav()
{
	window.external.AddFavorite(getfullurl(),' ');
}

//设为首页
function addHome()
{
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.jxjyzy.com');
}
function AdvertisementMiddle()
{
	document.write("<div id='ad_article_cotent' style='margin:0 0 5px 5px; float:right;display:none;'></div>");
}
//底部尾文件
function Bottom() 
{
document.writeln("  <div id=\"bottom\">    ");
document.writeln("    <div style=\"text-align:center;\">");
document.writeln("	    <ul>");
document.writeln("        	<li><a href='"+geturl()+"Help/Help.aspx'>网站简介</a> -  <a href=\"/sitemap.htm\">网站地图</a> - <a href='"+geturl()+"Help/Help.aspx'>会员服务</a> -  <a href='"+geturl()+"ArticleHtml/Announce64.html'>广告服务</a> -  <a href=\"Help/Help.aspx?HelperID=2\">联系我们</a> -  <a href=\"javascript:FeedBack()\">意见建议</a> -   <a onclick=\'javascript:addHome()\' href=\'http://www.jxjyzy.com/#\'>设为首页</a>  - <a href='javascript:addFav()'>加入收藏</a>  -  <a href='"+geturl()+"Help/Help.aspx'>网站帮助</a> -  <a href='"+geturl()+"Help/DownLoad.aspx'>常用软件下载</a></li>");
document.writeln("            <li>Copyright © 2009 jxjyzy.com Inc. All Rights Reserved.  江西省基础教育资源网 版权所有</li>");
//document.writeln("            <li>网站备案号: 赣ICP备08000352号-1  用户服务:0791-8513731 技术支持:0791-8530343    <a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=52ea0a3207fc24abade1bd022193654bfa60a399506bdf86605c465cafa0cd349deb2f30759af3eade7138fa31683ec1\" target=\"_blank\" onclick=\"var tempSrc=http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=52ea0a3207fc24abade1bd022193654bfa60a399506bdf86605c465cafa0cd349deb2f30759af3eade7138fa31683ec1;var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border='0' SRC=http://wpa.qq.com/pa?p=1:8023718:1 alt='点击这里给我发消息'></a>   &nbsp;&nbsp;<script src=\'http://s73.cnzz.com/stat.php?id=419855&web_id=419855&show=pic\' language=\'JavaScript\' charset=\'gb2312\'></script></li>");
document.writeln("           <li>网站备案号: 赣ICP备08000352号-1  用户服务:0791-8513731 技术支持:0791-8530343     <a href=http://wpa.qq.com/msgrd?V=1&Uin=8023718&Site=-&Menu=no target=_blank><img border=0 SRC=http://wpa.qq.com/pa?p=1:8023718:4 alt=点击这里给我发消息>QQ技术支持</a>    &nbsp;&nbsp;<script src='http://s73.cnzz.com/stat.php?id=419855&web_id=419855&show=pic' language='JavaScript' charset='gb2312'></script></li>");
document.writeln("        <ul id=\"bottom_logo\">");
document.writeln("       	  <li><a href=\"http://www.miibeian.gov.cn/\" target=\"_blank\"><img src='http://img.jxjyzy.com/images/beian.gif' width=\"118\" height=\"48\" /></a></li>");
document.writeln("            <li><a href=\"http://218.87.4.80/zxbj.asp\" target=\"_blank\"><img src='http://img.jxjyzy.com/images/buliang.jpg' width=\"118\" height=\"48\" /></a></li>");
document.writeln("            <li><a href=\"http://nanchang.cyberpolice.cn/\" target=\"_blank\"><img src='http://img.jxjyzy.com/images/wl110.jpg' width=\"118\" height=\"48\" /></a></li>");
document.writeln("        </ul>");
document.writeln("        ");
document.writeln("    </div> ");
document.writeln("  </div>");    
}
