the_v2lib_win = null;

function V2LibWindowOpen(the_url, the_title, the_width, the_height) {
	
	if(the_v2lib_win==null || the_v2lib_win.closed) {
		the_v2lib_win = window.open(the_url, the_title, "width=" + the_width + ",height=" + the_height );
	}
	
	the_v2lib_win.focus();
	
}




function V2LibDebugInspectObject(the_object) {
	var rtn = "";

	obj = eval(the_object);
	for(x in obj) {
		rtn += x + ": " + obj[x] + "\n";
	}
	alert (rtn);
}




function V2LibValidateReset() {
	
	return confirm("Are you sure you want to reset the form?");
	
}




function V2LibValidateDelete() {
	
	return confirm("Are you sure you want to delete this item?");
	
}




function V2LibnTextClear(the_item, the_default) {
	
	if(the_item.value==the_default) {
		the_item.value='';
	}
	
}



function V2LibTextDefault(the_item, default_value) {

	if(the_item.value == '') {
		the_item.value=default_value;
	}

}



function V2LibRunJSOnKeycode_return(the_function) {
	var rtn = true;
	
	if(window.event.keyCode) {
		the_key = window.event.keyCode;
	} else {
	
	}
	
	if(window.event.keyCode==13) {
		
		eval(the_function);
		
		rtn = false;
		
	} else {
		rtn = true;
	}
	
	return(rtn);
}
