function display_menu(parent,named)
{
    if (document.getElementById('menu0')) {
        hide_menu('menu0');
    }
    if (document.getElementById('menu1')) {
        hide_menu('menu1');
    }
    if (document.getElementById('menu2')) {
        hide_menu('menu2');
    }
    if (document.getElementById('menu3')) {
        hide_menu('menu3');
    }
    if (document.getElementById('menu4')) {
        hide_menu('menu4');
    }
    if (document.getElementById('menu5')) {
        hide_menu('menu5');
    }
    if (document.getElementById('menu6')) {
        hide_menu('menu6');
    }
    if (document.getElementById('menu7')) {
        hide_menu('menu7');
    }
    if (document.getElementById('menu8')) {
        hide_menu('menu8');
    }
    if (document.getElementById('menu9')) {
        hide_menu('menu9');
    }
    if (document.getElementById('menu10')) {
        hide_menu('menu10');
    }

	var menu_element = document.getElementById(named);
	menu_element.style.display = "";
}

function hide_menu(named)
{
	var menu_element = document.getElementById(named);
	menu_element.style.display = "none";
}

/*********************************************************************
* No onMouseOut event if the mouse pointer hovers a child element 
* *** Please do not remove this header. ***
* This code is working on my IE7, IE6, FireFox, Opera and Safari
* 
* Usage: 
* <div onMouseOut="fixOnMouseOut(this, event, 'JavaScript Code');"> 
*		So many childs 
*	</div>
*
* @Author Hamid Alipour Codehead @ webmaster-forums.code-head.com		
**/
function is_child_of(parent, child) {
    if (child != null) {
        while (child.parentNode) {
            if ((child = child.parentNode) == parent) {
                return true;
            }
        }
    }
    return false;
}
function fixOnMouseOut(element, event, JavaScript_code) {
    var current_mouse_target = null;
    if (event.toElement) {
        current_mouse_target = event.toElement;
    } else if (event.relatedTarget) {
        current_mouse_target = event.relatedTarget;
    }
    if (!is_child_of(element, current_mouse_target) && element != current_mouse_target) {
        eval(JavaScript_code);
    }
}
/*********************************************************************/

function pause(milliseconds) {
    var dt = new Date();
    while ((new Date()) - dt <= milliseconds) { /* Do nothing */ }
}

function hide_menu_delay(named) {
    pause(2000);
    hide_menu(named);
}


function GetXmlHttpObject(handler) {     var objXMLHttp=null;    try {        objXMLHttp=new ActiveXObject("Msxml2.XMLHTTP")    }    catch(e) {        try {            objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")        }        catch(e) {            objXMLHttp=new XMLHttpRequest()            }    }    return objXMLHttp}function UpdateMainSection(pg) {    var URL = "main.aspx?pg="+pg  //+"&sid="+Math.random();    xmlHttp=GetXmlHttpObject()    if (xmlHttp==null) {        alert ("Browser does not support HTTP Request")        return    }     xmlHttp.onreadystatechange=UpdateMainSectionReady    xmlHttp.open("GET",URL,true)    xmlHttp.send(null)	//window.location.href="default.aspx#pg="+pg;}function UpdateMainSectionReady() {    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {         document.getElementById('main_block').innerHTML = xmlHttp.responseText;    }}

function UpdateRecentWork(pg) {    var URL = "recentwork.aspx?pg="+pg  //+"&sid="+Math.random();    xmlHttp=GetXmlHttpObject()    if (xmlHttp==null) {        alert ("Browser does not support HTTP Request")        return    }     xmlHttp.onreadystatechange=UpdateRecentWorkReady    xmlHttp.open("GET",URL,true)    xmlHttp.send(null)	//window.location.href="default.aspx#pg="+pg;}function UpdateRecentWorkReady() {    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {         document.getElementById('recentwork').innerHTML = xmlHttp.responseText;    }}
function UpdateLatestNews(pg) {
    var URL = "latestnews.aspx?pg=" + pg  //+"&sid="+Math.random();
    xmlHttp = GetXmlHttpObject()
    if (xmlHttp == null) {
        alert("Browser does not support HTTP Request")
        return
    }
    xmlHttp.onreadystatechange = UpdateLatestNewsReady
    xmlHttp.open("GET", URL, true)
    xmlHttp.send(null)
    //window.location.href="default.aspx#pg="+pg;
}
function UpdateLatestNewsReady() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
        document.getElementById('column_emgbody_latestnews').innerHTML = xmlHttp.responseText;
    }
}
function UpdateActivity(pg) {
    var URL = "activity.aspx?pg=" + pg  //+"&sid="+Math.random();
    xmlHttp = GetXmlHttpObject()
    if (xmlHttp == null) {
        alert("Browser does not support HTTP Request")
        return
    }
    xmlHttp.onreadystatechange = UpdateActivityReady
    xmlHttp.open("GET", URL, true)
    xmlHttp.send(null)
    //window.location.href="default.aspx#pg="+pg;
}
function UpdateActivityReady() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
        document.getElementById('column_emgbody').innerHTML = xmlHttp.responseText;
    }
}
