function check_all(id) { //checkva vsi4ki enabled checkboxove na koito id-to zapo4va s "id"

	if (document.all || document.getElementById) {
		navRoot = document.getElementsByTagName("input");
		for (i=0; i<navRoot.length; i++) {
			node = navRoot[i];
			if (node.id.substr(0,id.length)==id)	{
				if (!node.disabled)
					node.checked=document.getElementById(id).checked;
			}
		}
	}
}

function uncheck_all(id) { //checkva vsi4ki enabled checkboxove na koito id-to zapo4va s "id"
	var p=true;
	if (document.all || document.getElementById) {
		navRoot = document.getElementsByTagName("input");
		for (i=0; i<navRoot.length; i++) {
			node = navRoot[i];
			if (node.id.substr(0,id.length)==id && node.id!=id){
				if (!node.checked) p=false;
			}
		}
		document.getElementById(id).checked=p;
	}
}

function getObjectById(id) {
    for (i=0; i<document.all.length; i++) {
        if (document.all(i).id==id) {
            return document.all(i);
        }
    }
}

startList2 = function() {
	if (navigator.userAgent.indexOf('Opera') == -1) {
		if (document.all&&document.getElementById) {
			navRoot = document.getElementsByTagName("tr");
			for (i=0; i<navRoot.length; i++) {
				node = navRoot[i];
				if ((node.className=='ktr_1')||(node.className=='ktr_2')){
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
}

function popup(url, width, height){
	var winpops=window.open(url,"","scrollbars, width="+width+",left=5,top=5,height="+height);
}

function popup_imgs(url, width, height){
	var winpops=window.open(url,"","'toolbar=no,scrollbars=no', width="+width+",left=5,top=5,height="+height);
}

function popup_notes(url, width, height){
	var winpops=window.open(url,"","'toolbar=no,scrollbars=yes', width="+width+",left=5,top=5,height="+height);
}
/*checkbox drop functions*/
/***
<div id="location_drop" class="selectdrop" style="padding:2px;width: 226px;border:1px solid black;position:absolute;background:white;margin-top:20px;display:none;" onclick="fdrop1(event)">';
			<input type="checkbox" value="1"> 25,000 - 50,000 EUR<br>
			<input type="checkbox" value="2"> 25,000 - 50,000 EUR<br>
			<input type="checkbox" value="3"> 25,000 - 50,000 EUR<br>
			<input type="checkbox" value="4"> 25,000 - 50,000 EUR<br>
			</div>
<div onclick="fdrop(event,this);" id="location" style="width:230px;height:18px; border:1px solid black;">
</div>
<script type="text/javascript">
	document.body.onclick=fcollapse;
	window.onblur=fcollapse;
</script>
*/
function fdrop(event,t){
	if(document.getElementById(t.id+"_drop").style.display!="block"){
		document.getElementById(t.id+"_drop").style.display="block";
	}else{
		document.getElementById(t.id+"_drop").style.display="none";
	}

	event.cancelBubble=true;
}
function fdrop1(event){
		/*document.getElementById(t+"_drop").style.display="block";*/
	event.cancelBubble=true;
}
function fcollapse(event){
	navRoot = document.getElementsByTagName("div");
	for (i=0; i<navRoot.length; i++) {
		node = navRoot[i];
		if (node.id.indexOf("_drop")>0){
			node.style.display="none";
		}
	}
	event.cancelBubble=true;
}
function init(){
	document.body.onclick=fcollapse;
			window.onblur=fcollapse;
}
