function si(url, w, h){
	w+= 40;
	h+= 40;
	sw = screen.width;
	sh = screen.height;
	sbars = 'no';
	if( w > sw ){
		w = sw;
		sbars = 'yes';
	}
	if( h > sh ){
		h = sh;
		sbars = 'yes';
	}
	l = (sw/2)-(w/2);
	t = (sh/2)-(h/2);
	window.open(url, '_blank', 'scrollbars='+sbars+',location=no,menubar=no,resizable=yes,width='+w+',height='+h+',left='+l+',top='+t);
	return false;
}

function exfname(from){
	if(from.indexOf('/') > -1){
		answer = from.substring(from.lastIndexOf('/'),from.length);
	}else{
		answer = from.substring(from.lastIndexOf('\\'),from.length);
	}
//	pos = answer.lastIndexOf('.');
//	if( pos > -1 ){
//		answer = answer.substring(0, pos);
//	}
	answer = answer.replace(/[^a-z0-9.]/, '');
	answer = answer.replace(/ /,'');
	return answer;
}


function gettitle(fname, ob){
	ob.value = fname;
}

function check(frm, toggle) { 
	var boxes = frm['ids[]'];
	if( typeof(boxes.length) == "undefined" || boxes == null){
		boxes.checked = toggle;
	}else{
		for (var i = 0; i < boxes.length; i++) { 
			boxes[i].checked = toggle;
		} 
	}
} 

function invert(frm){
	var boxes = frm['ids[]']; 
	if( typeof(boxes.length) == "undefined" || boxes == null){
		boxes.checked = !boxes.checked;
	}else{
		for (var i = 0; i < boxes.length; i++) { 
			boxes[i].checked = !boxes[i].checked;
		} 
	}
} 