function CheckCh (e) {
	var ev = e ? e : event;
	var key = ev.which ? ev.which : ev.keyCode;
	
	switch (key){
	case 8:  break;
	case 48: break;
	case 49: break;
	case 50: break;
	case 51: break;
	case 52: break;
	case 53: break;
	case 54: break;
	case 55: break;
	case 56: break;
	case 57: break;
	case 37: break;
	case 38: break;
	case 39: break;
	case 40: break;
	default: 
	ev.returnValue = false;
	if (ev.preventDefault) ev.preventDefault ();
	return false;
	}
	
}

function popupPicts(pictURL, title) {
	theURL = "../php/popup.php?pictURL="+pictURL+"&title="+title;
	new_win = window.open(theURL, 'popup', 'width=200, height=200, location=no, menubar=no, scrollbars=yes, resizable=no, toolbar=no, statusbar=yes');
	return;
}

function trim(str){

 while (str.substring(0,1) == ' ')
  str = str.substring(1, str.length);

 while (str.substring(str.length-1, str.length) == ' ')
  str = str.substring(0,str.length-1);

 return str;
}

function toggleDiv(id,flagit) {

	if (flagit=="1"){
		if (document.layers) document.layers[''+id+''].visibility = "show"
		else if (document.all) document.all[''+id+''].style.visibility = "visible"
		else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
		/*if(id=='menu2_hover'){
			document.getElementById('aa').style.height=300;
		}*/
		}
	else
		if (flagit=="0"){
		if (document.layers) document.layers[''+id+''].visibility = "hide"
		else if (document.all) document.all[''+id+''].style.visibility = "hidden"
		else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
	}
}
