function ge(id){
	return document.getElementById(id);
}
function showpic(w,h,jpgnm,tit) {
	var ttt = ''; 
	if (tit) ttt=tit; 
	wind = window.open('/pic.php?tit='+ttt+'&src='+jpgnm+'','viewimg','status, width='+w+',height='+h+''); 
	wind.focus(); 
}
function sk() {
	s=ge('kategoriq');
	s.form.kursname.value=s.options[s.selectedIndex].text;
	s.form.kursid.value=s.options[s.selectedIndex].value.split("=kmk=")[1];
	//ge('shcena').innerHTML=" Öåíà: "+s.options[s.selectedIndex].value.split("=kmk=")[0]+" ëâ.";
}
function cf(wf,hm) {
	for (i=0; i<hm; i++) {
		if (wf.elements[i].value.length < 3) return false;
        }
	return true;
}

function hs(aword,sword) {
var wlh = new String(""+window.location.href+"");
if (aword!='') 
if (wlh.indexOf('/'+aword)>-1) 
wlh=wlh.replace(aword,sword+"/");
obj_hea = document.getElementById('hea');
for (i=obj_hea.childNodes.length-1; i>-1; i--)
if (null !== obj_hea.childNodes[i].attributes) {
//alert(obj_hea.childNodes[i].href+' =? '+window.location.href);
var nos=''+obj_hea.childNodes[i].href+''; nos = nos.slice(0,nos.length-1);
if (wlh.indexOf(nos)>-1) {
	obj_hea.childNodes[i].className='sel';
	return 1;
}
}
}
function trim (str0) {
	var	str = str0.replace(/^\s\s*/, ''),
		ws = /\s/,
		i = str.length;
	while (ws.test(str.charAt(--i)));
	return str.slice(0, i + 1);
}

