// JavaScript Document
function openClose(obj, id, p){
 switchImages(obj);
 switchLink(id, p, obj);
}

function switchLink(id, p, obj){
 url = 	"showmore.php?task="+obj.getAttribute('flag')+"&p="+p;
 temp = obj.getAttribute('flag');
 obj.setAttribute("flag", obj.getAttribute('flags'));
 obj.setAttribute("flags", temp);
 objXML = isdom(url); 
 obj = document.getElementById(id);//alert(obj);
 obj.innerHTML = objXML.responseText;
}

function isdom(url){
  var xmlhttp = false;
  try {
   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) {
    xmlhttp = false;
   }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined')    xmlhttp = new XMLHttpRequest();
  xmlhttp.open("GET",url,false);
  xmlhttp.send(null);
  return xmlhttp;
 }

function switchImages(obj){
 temp = obj.src;
 obj.src = obj.lowsrc;
 obj.lowsrc = temp;
}