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=1, width="+width+",left=5,top=5,height="+height);
}

function popup_imgs(url, width, height){
	var winpops=window.open(url,"","'toolbar=0,scrollbars=1,resizable=1',width="+width+",left=5,top=5,height="+height);
}

function popup_notes(url, width, height){
	var winpops=window.open(url,"","'toolbar=0,scrollbars=1',width="+width+",left=5,top=5,height="+height);
}

function bookmark() {

	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);
	
	if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
		document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
		document.write('onMouseOver=" window.status=');
		document.write("txt; return true ");
		document.write('"onMouseOut=" window.status=');
		document.write("' '; return true ");
		document.write('">'+ txt + '</a>');
	}else{
		txt += "  (Ctrl+D)";
		document.write(txt);
	} 
}



function homepage() {
	if (document.all){
		document.write('<A HREF="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.BG-Atlanta.com\');">');
		document.write('Натиснете тук, за да стане BG-Atlanta.com Ваша начална страница</a>');
	}else{
		document.write('<a href="http://www.BG-Atlanta.com">Drag this link onto your Home button to make this your Home Page.</a>');
	}
}


function confirmSubmit() {
	var agree=confirm("Сигурни ли сте, че искате да изтриете този обект?");
	
	if (agree) {
		return true ;
	}else{
		return false ;
	}
}


function insertAtCursor(myField, myValue) {
			myField.focus();
	
		//IE support
		if (document.selection) {
			myField.focus();
			sel = document.selection.createRange();
			sel.text = myValue;
		}
		//MOZILLA/NETSCAPE support
		else if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
		} else {
			myField.value += myValue;
		}
	}
		
var i = 0;
var j = 0;
var k = 0;
var l = 0;

function insertLink(form) {
	insertAtCursor(form, '[link=http://www.WebSite.com] ');
}

function insertSmile01(form) {
	insertAtCursor(form, '[angry] ');
}

function insertSmile02(form) {
	insertAtCursor(form, '[big_smile] ');
}

function insertSmile03(form) {
	insertAtCursor(form, '[confused] ');
}

function insertSmile04(form) {
	insertAtCursor(form, '[cool] ');
}

function insertSmile05(form) {
	insertAtCursor(form, '[crazy] ');
}

function insertSmile06(form) {
	insertAtCursor(form, '[embarrased] ');
}

function insertSmile07(form) {
	insertAtCursor(form, '[heart] ');
}

function insertSmile08(form) {
	insertAtCursor(form, '[lol] ');
}

function insertSmile09(form) {
	insertAtCursor(form, '[ooooh] ');
}

function insertSmile10(form) {
	insertAtCursor(form, '[roll_eyes] ');
}

function insertSmile11(form) {
	insertAtCursor(form, '[sad] ');
}

function insertSmile12(form) {
	insertAtCursor(form, '[smile] ');
}

function insertSmile13(form) {
	insertAtCursor(form, '[star] ');
}

function insertSmile14(form) {
	insertAtCursor(form, '[tounge_out] ');
}

function insertSmile15(form) {
	insertAtCursor(form, '[wink] ');
}

function insertSmile16(form) {
	insertAtCursor(form, '[wink_alt] ');
}
