var z = 10;
function ShowHide1(id) {
document.getElementById(id).style.display = "block";
document.getElementById(id).style.zIndex = z++;
}
//Or, to literally just increase the zIndex by one:
function ShowHide2(id) {
var k = document.getElementById(id).style;
k.display = "block";
k.zIndex = parseInt(k.zIndex) + 1;
}

var req = createXMLHttpRequest();

function createXMLHttpRequest() {
 var ua;
 if(window.XMLHttpRequest) {
 try {
  ua = new XMLHttpRequest();
 } catch(e) {
  ua = false;
  alert("Your Browser is not supported");
 }
 }else if(window.ActiveXObject) {
  try {
	ua = new ActiveXObject("Microsoft.XMLHTTP");
  } catch(e) {
	ua = false;
	alert("Your Browser is not supported");
  }
 } 
 
return ua;
}

function initValue()
{
    window.hidedivid = window.showdivid;
	window.showdivid = frm;
	
}

function setValue(frm)
{
    if(window.showdivid){
		window.hidedivid = window.showdivid;
	}
	window.showdivid = frm;
	
}

function sendRequest(frm) {

	setValue(frm);
	document.getElementById('co'+frm).innerHTML = '<img src="zimages/minus.png" alt="view_details" border="0">';
	if(window.hidedivid) {
		document.getElementById('co'+window.hidedivid).innerHTML = '<img src="zimages/plus.png" alt="view_details" border="0">';
		document.getElementById(window.hidedivid).innerHTML = '';
		document.getElementById(window.hidedivid).style.display = 'none';
	}
	//alert(window.showdivid);
	
 var htmid = frm;
 var rnd982g = Math.random();
 var str = "";
 var url1 = "getrec.inc.php";
 //alert(req);
 if(req != null){
	
	  req.open('GET', url1+'?rec='+frm);
	  req.onreadystatechange = handleResponse;
	  req.send(null);

 } else {

	 alert('there was a problem \n report the bug now');
			return false;
 }
 return false;
}

function handleResponse() {
    if(req.readyState == 4){
        var response = req.responseText;
        var update = new Array();
		var allCollected = '';

        if(response.indexOf('|' != -1)) {
            update = response.split('|');

			if(update[0]==1){
				//alert(update[1]);
           		document.getElementById(window.showdivid).innerHTML = update[1];
				document.getElementById(window.showdivid).style.display = 'block';

			} else {
			// debug 
				document.getElementById(window.showdivid).innerHTML = 'didnt get anything valid sowie!!!';
				document.getElementById(window.showdivid).style.display = 'block';			
			}
        }
    }
}


