	var XMLHttpReq;
	var PREFIX = "Sort";
	var activeId="all";
	var MyMar1;
 	var ie=false;
 	var ff=false;
 	function initBrowser(){
 		if (parseInt(navigator.appVersion.charAt(0))>=4){
				var isNN=(navigator.appName=='Netscape')?1:0;
				var isIE=(navigator.appName.indexOf('Microsoft')!=-1)?1:0;
		}
		if (isIE){
			ie=true;
		}
		else{
			ff=true;
		}
	}
	
	function createXMLHttpRequest() {
		if(window.XMLHttpRequest) { //Mozilla
			XMLHttpReq = new XMLHttpRequest();
		}
		else if (window.ActiveXObject) { // IE
			try {
				XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
	}

function sendActionLoadNews(e){
		createXMLHttpRequest();
		if(e==0){
			XMLHttpReq.open("GET", "xml/news.xml", true);
			XMLHttpReq.onreadystatechange = processResponse;
		}
		else{
			XMLHttpReq.open("GET", "../xml/news.xml", true);
			XMLHttpReq.onreadystatechange = processResponseNews;
		}
		XMLHttpReq.send(null);
}

function sendActionLoadRecruit(e){
		createXMLHttpRequest();
		if(e==0){
			XMLHttpReq.open("GET", "../xml/recruit.xml", true);
			XMLHttpReq.onreadystatechange = displayData;
		}
		XMLHttpReq.send(null);
}

function processResponse(){
		if (XMLHttpReq.readyState == 4) {
        		if (XMLHttpReq.status == 200) {
        		xmlData = XMLHttpReq.responseXML;
				uNews = xmlData.getElementsByTagName("new");			
				
				var contents4=document.getElementById("contents4");
				var ntable=document.createElement("table");
				contents4.appendChild(ntable);
				ntable.setAttribute("align","left");
				ntable.style.fontSize="12px";
				ntable.setAttribute("width","100%");
				ntable.setAttribute("height","100%");
				ntable.setAttribute("id","contents");
				if(uNews.length==0) 
				str2 ="<p>No news:</p><hr>";
				else{
				str2 ="<p>Top News</p><hr>"                                 
				for (var j=0; j<uNews.length; j++)
				{
				  var uTitle= uNews[j].getElementsByTagName("title");
				  var uDate = uNews[j].getElementsByTagName("date");
				  var uNote = uNews[j].getElementsByTagName("note");
				  var uUrl  = uNews[j].getElementsByTagName("url");
			
				  i=j+1;
				  
				  str = "";
				  str += "<div id=\"subnews"+i+"\"";
				  if(uUrl.length >0)
				  {
					str += " onclick=\"location.href=\'";
					str += uUrl[0].firstChild.nodeValue+"\'\"";
				  }
				  str += ">";
			
				  str += "<p id=\"p1\">";
				  str += i+"."+uTitle[0].firstChild.nodeValue;
				  str += "<\/p>";
				  str += "<p id=\"p2\">";
				  str += uDate[0].firstChild.nodeValue;
				  str += "<\/p>";
				  str += "<p id=\"p3\">";
				  str += uNote[0].firstChild.nodeValue;
				  str += "<\/p>";
			
				  if(uUrl.length >0)
				  {
					str += "<p id=\"p4\">";
					str += "<a href=\""+uUrl[0].firstChild.nodeValue+"\" title=\""+uTitle[0].firstChild.nodeValue+"\">";
					str += "more";
					str += "<\/a><\/p>";
				  }
				  str += "<\/div><hr>";
				  str2 +=str;
				  
				  var ntr=document.createElement("tr");
				  var ntd=document.createElement("td");
				  var nimg=document.createElement("img");
				  var a=document.createElement("a");
				  nimg.setAttribute("src","images/points.png");
				  var ntitle=document.createTextNode(uTitle[0].firstChild.nodeValue);
				  ntd.appendChild(nimg);
				  a.appendChild(ntitle);
				  a.setAttribute("href",uUrl[0].firstChild.nodeValue);
				  a.style.textDecoration="none";
				  //ntd.onclick=function(){location.href=uUrl[0].firstChild.nodeValue};
				  ntd.onmouseover=function(){this.setAttribute('bgColor','#DDDDDD');this.style.textDecoration='underline'};
				  ntd.onmouseout=function(){this.setAttribute('bgColor','#FFFFFF');this.style.textDecoration=''};
				  ntd.style.cursor='pointer';
				  ntr.appendChild(ntd);
				  ntd.appendChild(a);
				  a.style.color='#000000';
				  var ntbody=document.createElement("tbody");
				  ntbody.appendChild(ntr);
				  ntable.appendChild(ntbody);
				}
				 var topnews=document.getElementById("rolllinkk1");
				 topnews.innerHTML =str2;
					rolllinkk2.innerHTML=rolllinkk1.innerHTML;
					MyMar1=setInterval(Marquee1,100); 
					rolllinkk.onmouseover=function() {clearInterval(MyMar1)};
					rolllinkk.onmouseout=function() {MyMar1=setInterval(Marquee1,100)};
                                }
                                var top=document.getElementById("rolllinkk1");
                                top.innerHTML =str2;
                                
				// topnews.appendChild(document.createElement("br"));
				// topnews.appendChild(document.createTextNode("sdfsdfsdf"));
				 
				// topnews.appendChild(document.createTextNode("sdfsdfsdf"));
			}else { 
                		document.getElementById("rolllinkk1").innerHTML = "<b>Loading...<\/b>";
            }
		}

}


function Marquee1(){
	if(rolllinkk2.offsetTop-rolllinkk.scrollTop <=0) //
	rolllinkk.scrollTop-=rolllinkk1.offsetHeight //
	else{
	rolllinkk.scrollTop++
	}
}




function processResponseNews(){
		if (XMLHttpReq.readyState == 4) {
        		if (XMLHttpReq.status == 200) {
        		xmlData = XMLHttpReq.responseXML;
				uNews = xmlData.getElementsByTagName("new");			

				area=document.getElementById("newsArea");

				for (var j=0; j<uNews.length; j++)
				{
				  var uTitle= uNews[j].getElementsByTagName("title");
				  var uDate = uNews[j].getElementsByTagName("date");
				  var uNote = uNews[j].getElementsByTagName("note");
				  var uUrl  = uNews[j].getElementsByTagName("url");
			
				  i=j+1;
				  
				  
				  var ntr=document.createElement("tr");
				  var ntd1=document.createElement("td");
				  var ntd2=document.createElement("td");
				  var ntd3=document.createElement("td");
				  var nimg=document.createElement("img");
				  
				  var a=document.createElement("a");
				  nimg.setAttribute("src","../images/points.png");
				  var ntitle=document.createTextNode(uTitle[0].firstChild.nodeValue);
				  ntd1.appendChild(nimg);
				  ntd1.appendChild(document.createTextNode(uTitle[0].firstChild.nodeValue));
				  ntd3.setAttribute("align","right");
				  a.appendChild(document.createTextNode("[more]"));
				  a.setAttribute("href",'./'+uDate[0].firstChild.nodeValue+'.html');
				  a.setAttribute("title",uTitle[0].firstChild.nodeValue);
				  ntd2.appendChild(document.createTextNode(uNote[0].firstChild.nodeValue));
				  //ntd.onclick=function(){location.href=uUrl[0].firstChild.nodeValue};
				  ntr.onmouseover=function(){this.style.backgroundColor= '#EEEEEE'};
				  ntr.onmouseout=function(){this.style.backgroundColor= '#FFFFFF'};
				  ntr.onclick=function(){location.href=(this.childNodes[2].firstChild.getAttribute("href"))};
				  ntr.style.cursor='pointer';
				  ntr.appendChild(ntd1);
				  ntr.appendChild(ntd2);
				  ntr.appendChild(ntd3);
				  ntd3.appendChild(a);
				  a.style.color='#000000';
				  var ntbody=document.createElement("tbody");
				  ntbody.appendChild(ntr);
				  area.appendChild(ntbody);
				}
			}else { 
                		document.getElementById("newsArea").innerHTML = "<b>Loading...<\/b>";
            }
		}

}






