function init(id){
var div = document.getElementById(id+"_t");
var divs = document.getElementById(id+"_t"+"_s");
div.title = '点击这里编辑';
divs.style.display='none';
div.onmouseover = function() {
div.style.color = '#888';
div.style.backgroundColor = '#ffffd3';
}
div.onmouseout = function() {
div.style.backgroundColor = '';
div.style.color = '#000';
}
}
function init_desc(id){
var div = document.getElementById(id+"_d");
var divs = document.getElementById(id+"_d"+"_s");
div.title = '点击这里编辑';
divs.style.display='none';
div.onmouseover = function() {
div.style.color = '#888';
div.style.backgroundColor = '#ffffd3';
}
div.onmouseout = function() {
div.style.backgroundColor = '';
div.style.color = '#000';
}
}
function postXmlDocument(id,value) {
var div = document.getElementById(id+"_t");
var div1 = document.getElementById(id+"_t"+"_h");
var divs = document.getElementById(id+"_t"+"_s");
div.style.display = 'none';
div1.style.display = 'none';
divs.style.display = 'block';
divs.innerHTML = "正在保存...";
var xmlhttp = new XMLHttpRequest();
//var xmlhttp = new ActiveXObject( "Microsoft.XMLHTTP" );
xmlhttp.Open( "POST", "titlexml.f",true);
xmlhttp.setRequestHeader("Content-Type","text/xml")
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4){
if(xmlhttp.status==200){
div.innerHTML= xmlhttp.responseText;
div.style.display = 'block';
divs.style.display = 'none';
}
else{
divs.innerHTML = "抱歉,保存数据失败。原因:" + xmlhttp.statusText
}
}
}
xmlhttp.Send( "" + id + "" + value + "");
//alert(xmlhttp.responseXML.xml);
}
function postDescXmlDocument(id,value) {
var div = document.getElementById(id+"_d");
var div1 = document.getElementById(id+"_d"+"_h");
var divs = document.getElementById(id+"_d"+"_s");
div.style.display = 'none';
div1.style.display = 'none';
divs.style.display = 'block';
divs.innerHTML = "正在保存...";
var xmlhttp = new XMLHttpRequest();
xmlhttp.Open( "POST", "descxml.f",true);
xmlhttp.setRequestHeader("Content-Type","text/xml")
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4){
if(xmlhttp.status==200){
div.innerHTML= xmlhttp.responseText;
div.style.display = 'block';
divs.style.display = 'none';
}
else{
divs.innerHTML = "抱歉,保存数据失败。原因:" + xmlhttp.statusText
}
}
}
xmlhttp.Send( "" + id + "" + value + "");
//alert(xmlhttp.responseXML.xml);
}
function titleClick(id){
var div = document.getElementById(id+"_t");
var div1 = document.getElementById(id+"_t"+"_h");
div.style.display = 'none';
div1.style.display = 'block';
text = div.innerText;
div1.innerHTML="
";
document.getElementById("textfield"+id).select();
}
function descClick(id){
var div = document.getElementById(id+"_d");
var div1 = document.getElementById(id+"_d"+"_h");
var divs = document.getElementById(id+"_d"+"_s");
div.style.display = 'none';
divs.style.display = 'none';
div1.style.display = 'block';
text = div.innerText;
div1.innerHTML="";
document.getElementById("textarea"+id).select();
}
function descCancle(id){
var div = document.getElementById(id+"_d");
var div1 = document.getElementById(id+"_d"+"_h");
div1.style.display = 'none';
div.style.display = 'block';
}
function titleCancle(id){
var div = document.getElementById(id+"_t");
var div1 = document.getElementById(id+"_t"+"_h");
div1.style.display = 'none';
div.style.display = 'block';
}
//add tag
_ge = function(id) {
return document.getElementById(id);
}
function tagrs_showForm(){
_ge('tagadderlink').style.display = 'none';
_ge('tagadder').style.display = 'block';
_ge('addtagbox').focus();
}
function link_showForm(){
_ge('linkadderlink').style.display = 'none';
_ge('linkadder').style.display = 'block';
_ge('addlinkbox').focus();
}
function tagrs_hideForm(){
tagrs_clearForm();
_ge('tagadderlink').style.display = 'block';
_ge('tagadder').style.display = 'none';
}
function link_hideForm(){
link_clearForm();
_ge('linkadderlink').style.display = 'block';
_ge('linkadder').style.display = 'none';
}
function link_clearForm(){
document.forms.linkadderform.togroupid.value = '';
}
function tagrs_clearForm(){
document.forms.f.k.value = '';
}
function postLinkXmlDocument(id,value) {
var div = document.getElementById("linkdiv");
var xmlhttp = new XMLHttpRequest();
xmlhttp.Open( "POST", "/linkxml.f",true);
xmlhttp.setRequestHeader("Content-Type","text/xml")
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4){
if(xmlhttp.status==200){
div.innerHTML= xmlhttp.responseText;
link_clearForm();
}
else{
div.innerHTML = "抱歉,保存数据失败。原因:" + xmlhttp.statusText
}
}
}
xmlhttp.Send( "" + id + "" + value + "");
}
function postTagXmlDocument(id,value) {
var div = document.getElementById("tagdiv");
var xmlhttp = new XMLHttpRequest();
xmlhttp.Open( "POST", "tagxml.f",true);
xmlhttp.setRequestHeader("Content-Type","text/xml")
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4){
if(xmlhttp.status==200){
div.innerHTML= xmlhttp.responseText;
tagrs_clearForm();
}
else{
div.innerHTML = "抱歉,保存数据失败。原因:" + xmlhttp.statusText
}
}
}
xmlhttp.Send( "" + id + "" + value + "");
}
function getTagsInInput(userid) {
var div = document.getElementById("mytags");
var showtag = document.getElementById("showtaglink");
div.innerHTML="正在加载...";
showtag.style.display = 'none';
var xmlhttp = new XMLHttpRequest();
xmlhttp.Open( "GET", "/usertag.f?userid="+userid,true);
xmlhttp.setRequestHeader("Content-Type","text/xml")
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4){
if(xmlhttp.status==200){
//alert(xmlhttp.responseText);
div.innerHTML= xmlhttp.responseText;
}
else{
div.innerHTML = "抱歉,出错了。原因:" + xmlhttp.statusText
}
}
}
xmlhttp.Send(null);
}