function limit(what,chars,counter) {

	if (what.value.length > chars) {
		what.value=what.value.substr(0,chars);
		alert('Max '+chars+' characters please!');
	}

	counting = (chars - what.value.length);
	c = document.getElementById(counter);
	c.innerHTML = counting;
}

function PopupPic(url,w,h) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0,location=no,scrollbars=yes'
	window.open(url+""+""+"", "", winprops)
} 

function PopCenter(url,t,w,h) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0,location=no,scrollbars=yes,status=yes'
	window.open(url+""+""+"", t, winprops)
} 

function setHm(){
   document.body.style.behavior='url(#default#homepage)';
   document.body.setHomePage(window.location.href);
}

function checkAll(formId, cName, check ) {
	for (i=0,n=formId.elements.length;i<n;i++)
		if (formId.elements[i].className.indexOf(cName) !=-1)
			formId.elements[i].checked = check;
}

function comute_layer(divid,pict) {

	var div_item=document.getElementById(divid);
	
	
	if(div_item.style.display=='none') {
		var pct='./i/'+pict+'_minus.png';
		setTimeout('chpict("'+pict+'","'+pct+'")',10);			
		div_item.style.display='block';  
	} else {
		var pct='./i/'+pict+'_plus.png';
		setTimeout('chpict("'+pict+'","'+pct+'")',10);	
		div_item.style.display='none';  
	}
	///alert(pct);

}

function chpict(pict, pct) {
	document.getElementById(pict).src=pct;				
}

function reset_search() {
	document.getElementById('rst_srch').value=1;
	document.getElementById('srch').submit();
}

function jump_to_href(selid) {
	window.location='#'+document.getElementById(selid).value;
}