/**
 * Show/Hide Child Subjects
 * @param {int} parent
 * 
 */
 function shSubject(parentSubject) {
 	
 	if($('dv_'+parentSubject).style.display == 'none') {
 		$('dv_'+parentSubject).style.display = 'block';
 		$('imgs_'+parentSubject).src="images/collapse.gif";
 	} else {
 		$('dv_'+parentSubject).style.display = 'none';
 		$('imgs_'+parentSubject).src="images/expand.gif";
 	}
 }
 
 function searAuList(startIndex) {
	if($('sbSearch').value.trim() == ''){
		$('csMain').selectedIndex = -1;
		return;
	}
	
	var selId = -1;	
	st = (startIndex != null ? startIndex : 0);
	for(var i = st; i < $('csMain').options.length; i++) {
		
		if($('_au').checked){
			if($('csMain').options[i].text.indexOf($('sbSearch').value.trim()) != -1) {
				selId = i;
				break;
			}			
		}else {			
			if($('csMain').options[i].text.toLowerCase().indexOf($('sbSearch').value.toLowerCase().trim()) != -1) {
				selId = i;
				break;
			}			
		}
	}
	 
	if (selId == '-1' && startIndex != null) {
		//selId = parseInt($('lPos').value) -1; 
		$('lPos').value = '-1';
		$('csMain').selectedIndex = '-1';
		searAuList();
		return;
	}
	
	$('lPos').value = parseInt(selId) + 1; 
	$('csMain').selectedIndex = selId;
  }
  
  function findNext() {
 	searAuList($('lPos').value);
  }
 
 function browseAU(){
 	if($('csMain').selectedIndex == '-1')
 		return;
 	st = './?_action=article&au='+$('csMain').options[$('csMain').selectedIndex].value+'&_au='+escape($('csMain').options[$('csMain').selectedIndex].text);
 	document.location = st;
 }

