//
// ndungi kyalo : ndungi@gmail.com
//
//In Honor of IE :
//"They should have stopped at version 1..those wankers!" -- job ballard on 'In Honor of IE'
//"Shit! Have they no standards?!" --  William Shakespeare on seeing his sonnet left aligned instead of centered on IE
//"shenzi!" -- ndungi, presumably on 'In Honor of IE'

//globals:tabia mboff

//end globals:tabia mbaya

function popout(msg_div){
	var show=false;
	document.getElementById(msg_div).style.display = "block";
	}
	
function hidepop(msg_div){
		document.getElementById(msg_div).style.display = "none";
		}
function getEl(id){
	return document.getElementById(id);	
}

function highlight(element,color,bordercolor){
    document.getElementById(element).style.background=color;
    document.getElementById(element).style.border="1px solid "+bordercolor;
}

function unhighlight(element,color,bordercolor){
    document.getElementById(element).style.background=color;
    document.getElementById(element).style.border="1px solid "+bordercolor;
    document.getElementById(element).style.fontWeight=400;
}

function highlight_desc(element,color){
    document.getElementById(element).style.background=color;
    document.getElementById(element).style.fontWeight=600;
}

function unhighlight_desc(element,color){
    document.getElementById(element).style.background=color;
    document.getElementById(element).style.fontWeight=400;
}

function show_hide(item_id){
    
    if(document.getElementById(item_id).style.display != 'block'){//show
        document.getElementById(item_id).style.display = 'block';
    }
    else{//hide
        document.getElementById(item_id).style.display = 'none';
    }        
}

function show_border(element){
    
    if(element.style.border != '1px dotted red'){//show
        element.style.border = '1px dotted red';
    }
    else {//hide
        element.style.border = '1px dotted white';
    }        
}

function show_hide_menu(item_id){
    
    if(document.getElementById(item_id).style.display != 'block'){//show
        document.getElementById(item_id).style.display = 'block';
        document.getElementById(item_id).style.border = '1px solid black';
        document.getElementById(item_id).style.background = 'white';

    }
    else{//hide
       // alert(document.getElementById(div_id).style.display);
        document.getElementById(item_id).style.display = 'none';
        document.getElementById(item_id).style.border = 'none';
        document.getElementById(item_id).style.background = 'none';
    }        
}

function createXMLHttp(){
	var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)

 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}

return xmlhttp;
	
}
 

function getImage(div_id){
	var xmlhttp = createXMLHttp();
	var url = "javascript/getImage.js.php";
    xmlhttp.open("GET",url,true);
    xmlhttp.onreadystatechange = function(){
        if(xmlhttp.readyState == 4){
            var sText = xmlhttp.responseText;
            document.getElementById(div_id).innerHTML = sText;
        }
    }
    xmlhttp.send(null);
}


function redir_to(page){
	window.location = page;
}



function redir_to(page){
	window.location = page;
	}

function appendElement(node,tag,id,htm){
	var ne = document.createElement(tag);
	if(id) ne.id = id;
	if(htm) ne.innerHTML = htm;
	node.appendChild(ne);
	}
