
if (!documentRoot) var documentRoot = '/';

RelPathToImg=documentRoot+'public/data/img/';
function showChildren(obj) {
var notfound=true;
while (notfound) {
	obj=obj.parentNode;
	if (obj.className && obj.className.indexOf('item')!=-1) {
		notfound=false;
		}
	}
if (obj.className.indexOf('Active')!=-1) {
	obj.className=obj.className.replace(' Active','');
	}else{
	obj.className=obj.className+' Active';
	}
}

function fav_click_counter(CityId, SectionId, Id, Type) {
    rnd = new Date();
    var script = document.createElement('script');
    script.src = documentRoot+'counter.php?CityId='+CityId+'&SectionId='+SectionId+'&Id='+Id+'&Type='+Type+'&rnd='+rnd.getTime();
    document.body.appendChild(script);
}

function AjaxGet(url, callback) {
    try {
        xml = new XMLHttpRequest();
    } catch (e) {
        try {
            xml = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xml = new ActiveXObject("Microsoft.XMLHTTP");
             } catch (e) {
                return false;
             }
        }
    }
    xml.onreadystatechange = function() {
        if (xml.readyState == 4) callback(xml.responseText);
    }
    xml.open('GET', url, true);
    xml.send(null);
    return xml;
}

function ajax_get_list(href) {
    if (!AjaxGet(href + (href.indexOf('?') < 0 ? '?' : '&') + "Ajax=1", function(data) {
        document.getElementById('ajax_data').innerHTML = data;
    } )) window.location.href = href;
}
