var xmlHttp = createXmlHttpRequestObject ();
var servername = '123';
function createXmlHttpRequestObject ()
{
    var xmlHttp;
    if (window.ActiveXObject)
    {
        try
        {
            xmlHttp = new ActiveXObject ("Microsoft.XMLHTTP");
        }
        catch (e)
        {
            xmlHttp = false
        }
    }
    else
    {
        try
        {
            xmlHttp = new XMLHttpRequest ();
        }
        catch (e)
        {
            xmlHttp = false
        }
    }

    if (!xmlHttp) alert ("Ошибка создания объекта XMLHttpRequest");
    else return xmlHttp;
}

function $(element) {
	element = document.getElementById(element);
	return element;
}
//---------added for main_menu

function divHover(e){
	$("li"+e).firstChild.firstChild.style.background="url(/images/mm_act.gif) 0 0 no-repeat";
	$("li"+e).firstChild.style.background="url(/images/mm_act_r.gif) 100% 0 no-repeat";
	$("dm"+e).style.display='block';
}
function divUnHover(e){
	$("li"+e).firstChild.firstChild.style.background="";
	$("li"+e).firstChild.style.background="";
	$("dm"+e).style.display='none';
}

//-----------added for catalog

function cha(i){
	var e=document.getElementsByTagName("div");

	document.getElementById("he"+i).style.textDecoration="none";
	document.getElementById("he"+i).childNodes[0].style.textDecoration="none";
	try{
	document.getElementById("he"+(i+1)).style.textDecoration="underline";
	document.getElementById("he"+(i+1)).childNodes[0].style.textDecoration="underline";
	}
	catch(ex){};
	try{
	document.getElementById("he"+(i-1)).style.textDecoration="underline";
	document.getElementById("he"+(i-1)).childNodes[0].style.textDecoration="underline";
	}catch(ex){};

	var j=0;
	if(i==0)
	j=1;

	for(var is=0;is<e.length;is++){
		if(e[is].className=="production prod"+i){
			e[is].style.display="block";
		}
		if(e[is].className=="production prod"+j){
			e[is].style.display="none";
		}
	}
	
/*	var dpri=document.getElementsByName("prod"+i);
	for(var ii=0; ii<dpri.length; ii++){
		dpri[ii].style.display="block";
	}
	var j=0;
	if(i==0)
	j=1;
	var dprj = document.getElementsByName("prod"+j);
	for(var ii=0; ii<dprj.length; ii++){
		dprj[ii].style.display="none";
	}*/
}
